Class: Eien::CLI::Apps

Inherits:
CLI
  • Object
show all
Defined in:
lib/eien/cli/apps.rb

Instance Method Summary collapse

Methods inherited from CLI

exit_on_failure?

Instance Method Details

#create(name) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/eien/cli/apps.rb', line 24

def create(name)
  rescue_and_exit do
    context = ::Eien.context_or_default(options[:context])

    require_context!(context)

    ::Eien::Apps::CreateTask.new(
      context,
      name,
      options[:namespace] || name,
    ).run!
  end
end

#delete(app) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/eien/cli/apps.rb', line 55

def delete(app)
  rescue_and_exit do
    context = ::Eien.context_or_default(options[:context])

    require_context!(context)

    if confirm!("You are about to delete #{app} app.", app)
      ::Eien::Apps::DeleteTask.new(
        context,
        app,
      ).run!
    end
  end
end

#listObject



11
12
13
14
15
16
17
18
19
# File 'lib/eien/cli/apps.rb', line 11

def list
  rescue_and_exit do
    context = ::Eien.context_or_default(options[:context])

    require_context!(context)

    ::Eien::Apps::ListTask.new(context).run!
  end
end

#select(app) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/eien/cli/apps.rb', line 40

def select(app)
  rescue_and_exit do
    context = ::Eien.context_or_default(options[:context])

    require_context!(context)

    ::Eien::Apps::SelectTask.new(
      context,
      app,
    ).run!
  end
end

#statusObject



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/eien/cli/apps.rb', line 73

def status
  rescue_and_exit do
    context = ::Eien.context_or_default(options[:context])
    app = ::Eien.app_or_default(options[:app])

    require_context!(context)
    require_context!(app)

    ::Eien::Apps::StatusTask.new(
      context,
      app,
    ).run!
  end
end