Class: Terraspace::CLI::Down
- Includes:
- Concerns::PlanPath, TfcConcern, Terraspace::Cloud::Streamer, Terraspace::Cloud::Vcs::Commenter
- Defined in:
- lib/terraspace/cli/down.rb
Instance Method Summary collapse
Methods included from TfcConcern
Methods included from Terraspace::Cloud::Vcs::Commenter
#able_to_comment?, #cloud_comment, #finalize_vars, #kind, #pr_comment, #vcs, #vcs_vars
Methods included from Terraspace::Cloud::Streamer
Methods included from Concerns::PlanPath
Methods inherited from Base
Methods included from Util::Pretty
Methods included from Util::Sure
Methods included from Util::Logging
Constructor Details
This class inherits a constructor from Terraspace::CLI::Base
Instance Method Details
#perform ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/terraspace/cli/down.rb', line 16 def perform success = nil if @options[:yes] && !tfc? success = plan else skip_plan = true end if success or skip_plan success = destroy end success rescue Exception => e @exception = true logger.info "Exception #{e.class}: #{e.}".color(:red) logger.info e.backtrace.join("\n") false end |
#run ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/terraspace/cli/down.rb', line 8 def run cloud_update.cani? @stream = cloud_stream.open("down") success = perform cloud_stream.close(success, @exception) exit 1 unless success end |