Class: RSMP::Schema::CLI
- Inherits:
-
Thor
- Object
- Thor
- RSMP::Schema::CLI
- Defined in:
- lib/rsmp_schema/cli.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
avoid Thor returnin 0 on failures, see github.com/coinbase/salus/pull/380/files.
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
avoid Thor returnin 0 on failures, see github.com/coinbase/salus/pull/380/files
31 32 33 |
# File 'lib/rsmp_schema/cli.rb', line 31 def self.exit_on_failure? true end |
Instance Method Details
#convert ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rsmp_schema/cli.rb', line 9 def convert unless [:in] puts "Error: Input option missing" exit end unless [:out] puts "Error: Output option missing" exit end unless File.exist? [:in] puts "Error: Input path file #{[:in]} not found" exit end sxl = RSMP::Convert::Import::YAML.read [:in] RSMP::Convert::Export::JSONSchema.write sxl, [:out] end |