Class: Fum::Commands::Status

Inherits:
Fum::Command show all
Includes:
DNS
Defined in:
lib/fum/commands/status.rb

Instance Method Summary collapse

Methods included from DNS

#dns, #dns_names_equal, #ensure_trailing_dot, #find_records, #update_zone, #update_zones

Methods inherited from Fum::Command

#initialize, #stage

Methods included from Util

#die

Constructor Details

This class inherits a constructor from Fum::Command

Instance Method Details

#execute(options) ⇒ Object

  • :type



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/fum/commands/status.rb', line 22

def execute(options)

  stage_name = options[:stage_name]
  stage_decl = stage(@application.main_decl, stage_name)

  analyzer = StageAnalyzer.new(stage_decl)
  analyzer.analyze(options)

  envs = analyzer.env_map.values

  unless envs.empty?
    envs.each { |env|
      puts "#{env[:env].name} (#{env[:state]})"
    }
  else
    puts "No environments found for stage #{stage_name}."
  end


end

#parse_optionsObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/fum/commands/status.rb', line 6

def parse_options
  opts = Trollop::options do
    banner "usage: status [options] <stage-name>, where options are:"
  end
  if ARGV.empty?
    die "Please specify a stage name."
  end

  opts[:stage_name] = ARGV.shift

  opts
end