Class: S3CmdDSL
- Inherits:
-
BaseCommands::BaseDSLCommands
- Object
- BaseCommands::BaseDSLCommands
- S3CmdDSL
- Includes:
- BaseCommands, CloudFrontCommands
- Defined in:
- lib/dsl/s3cmd.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ S3CmdDSL
constructor
A new instance of S3CmdDSL.
- #method_missing(method, *args) ⇒ Object
Methods included from CloudFrontCommands
#cfcreate, #cfdelete, #cfinfo, #cflist, #cfmodify
Methods included from BaseCommands
#accesslog, #cp, #del, #du, #fixbucket, #get, #info, #la, #ls, #mb, #mv, #put, #rb, #setacl, #sign, #sync
Methods included from DSLCommands
Methods inherited from BaseCommands::BaseDSLCommands
#execute, #path, #save_script, #send_block_command
Constructor Details
#initialize(name) ⇒ S3CmdDSL
Returns a new instance of S3CmdDSL.
9 10 11 12 13 |
# File 'lib/dsl/s3cmd.rb', line 9 def initialize(name) @name = name @path = `which s3cmd`.strip @commands = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
15 16 17 18 19 |
# File 'lib/dsl/s3cmd.rb', line 15 def method_missing(method, *args) meth = method.to_s.gsub("_", "-").gsub(/^/, "--") @commands[meth] = args.join(', ') self end |