Class: ITunes::Store::Transporter::Command::Base
- Inherits:
-
Object
- Object
- ITunes::Store::Transporter::Command::Base
- Includes:
- Option
- Defined in:
- lib/itunes/store/transporter/command.rb
Constant Summary
Constants included from Option
Option::APPLE_ID, Option::DESTINATION, Option::FAILURE, Option::ITC_PROVIDER, Option::SHORTNAME, Option::SUCCESS, Option::TRANSPORT, Option::VENDOR_ID
Instance Method Summary collapse
-
#initialize(config, default_options = {}) ⇒ Base
constructor
A new instance of Base.
- #run(options = {}) ⇒ Object
Constructor Details
Instance Method Details
#run(options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/itunes/store/transporter/command.rb', line 21 def run( = {}) = .merge() argv = () stdout_lines = [] stderr_lines = [] # TODO: hooks exitcode = @shell.exec(argv) do |line, name| if name == :stdout stdout_lines << line $stdout.puts line if config[:print_stdout] else stderr_lines << line $stderr.puts line if config[:print_stderr] end end # TODO: problem as some errors exit 0, e.g., account locked if exitcode == 0 handle_success(stdout_lines, stderr_lines, ) else handle_error(stdout_lines, stderr_lines, , exitcode) end end |