Class: InteractiveS3::Commands::S3Command
- Defined in:
- lib/interactive_s3/commands/s3_command.rb
Constant Summary collapse
- S3_PATH_PREFIX =
/^s3:\/\//
- LOCAL_PATH_PREFIX =
/^:/
- OPTION_PREFIX =
/^--/
- HELP_SUB_COMMAND =
/^help$/
- TARGET_SUB_COMMANDS =
%w(mv rb rm).freeze
Instance Attribute Summary
Attributes inherited from Base
#arguments, #name, #s3, #state
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(context, name, arguments = []) ⇒ S3Command
constructor
A new instance of S3Command.
Constructor Details
#initialize(context, name, arguments = []) ⇒ S3Command
Returns a new instance of S3Command.
9 10 11 12 |
# File 'lib/interactive_s3/commands/s3_command.rb', line 9 def initialize(context, name, arguments = []) super parse_arguments end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/interactive_s3/commands/s3_command.rb', line 14 def execute pid = Process.spawn( *command_with_arguments, out: $stdout, err: $stderr ) wait_for_process(pid) $? && $?.success? rescue SystemCallError => e puts e. false ensure if reset_target? s3.reset unless s3.exists? end end |