Class: Crowbar::Client::App::Batch
- Defined in:
- lib/crowbar/client/app/batch.rb
Overview
A Thor based CLI wrapper for batch commands
Instance Method Summary collapse
-
#build(file) ⇒ String
Batch build command.
-
#export(file = nil) ⇒ String
Batch export command.
Methods inherited from Base
banner, handle_argument_error, #initialize
Constructor Details
This class inherits a constructor from Crowbar::Client::App::Base
Instance Method Details
#build(file) ⇒ String
Batch build command
It will create/edit/commit proposals defined in an YAML format. You can directly provide a path to a file or just pipe the content from stdin. To pipe the content from stdin you should just write a ‘-` instead of a specific filename.
70 71 72 73 74 75 76 77 78 |
# File 'lib/crowbar/client/app/batch.rb', line 70 def build(file) Command::Batch::Build.new( *command_params( file: file ) ).execute rescue => e catch_errors(e) end |
#export(file = nil) ⇒ String
Batch export command
It will collect the information of the proposals in a YAML format. You can directly provide a path to a file or just pipe the content into stdout. To pipe the content to stdout you should just write a ‘-` instead of a specific filename.
126 127 128 129 130 131 132 133 134 |
# File 'lib/crowbar/client/app/batch.rb', line 126 def export(file = nil) Command::Batch::Export.new( *command_params( file: file ) ).execute rescue => e catch_errors(e) end |