Class: Convergence::CLI
- Inherits:
-
Thor
- Object
- Thor
- Convergence::CLI
- Defined in:
- lib/convergence/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
15 16 17 |
# File 'lib/convergence/cli.rb', line 15 def self.exit_on_failure? true end |
Instance Method Details
#apply(file) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/convergence/cli.rb', line 19 def apply(file) opts = { input: file } if [:dry_run] require 'convergence/command/dryrun' Convergence::Command::Dryrun.new(opts, config: config).execute elsif [:rollback_dry_run] require 'convergence/command/rollback_dryrun' Convergence::Command::RollbackDryrun.new(opts, config: config).execute else require 'convergence/command/apply' Convergence::Command::Apply.new(opts, config: config).execute end end |
#diff(file1, file2) ⇒ Object
34 35 36 37 38 |
# File 'lib/convergence/cli.rb', line 34 def diff(file1, file2) require 'convergence/command/diff' opts = { diff: [file1, file2] } Convergence::Command::Diff.new(opts, config: config).execute end |
#export ⇒ Object
42 43 44 45 46 |
# File 'lib/convergence/cli.rb', line 42 def export require 'convergence/command/export' opts = {} Convergence::Command::Export.new(opts, config: config).execute end |
#version ⇒ Object
49 50 51 52 |
# File 'lib/convergence/cli.rb', line 49 def version require 'convergence/version' puts "version #{Convergence::VERSION}" end |