Class: Fum::Commands::Status
- Inherits:
-
Fum::Command
- Object
- Fum::Command
- Fum::Commands::Status
- 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
Methods included from Util
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() stage_name = [:stage_name] stage_decl = stage(@application.main_decl, stage_name) analyzer = StageAnalyzer.new(stage_decl) analyzer.analyze() 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_options ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fum/commands/status.rb', line 6 def opts = Trollop:: do "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 |