Class: Sumomo::Stack::EC2Tasks
- Inherits:
-
Object
- Object
- Sumomo::Stack::EC2Tasks
- Defined in:
- lib/sumomo/ec2.rb
Instance Attribute Summary collapse
-
#script ⇒ Object
readonly
Returns the value of attribute script.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #download_file(name, local_path) ⇒ Object
-
#initialize(bucket_name, &block) ⇒ EC2Tasks
constructor
A new instance of EC2Tasks.
- #mkdir(name) ⇒ Object
- #tag(name, value) ⇒ Object
Constructor Details
#initialize(bucket_name, &block) ⇒ EC2Tasks
Returns a new instance of EC2Tasks.
123 124 125 126 127 128 |
# File 'lib/sumomo/ec2.rb', line 123 def initialize(bucket_name, &block) @script = '' @bucket_name = bucket_name = [] instance_eval(&block) if block end |
Instance Attribute Details
#script ⇒ Object (readonly)
Returns the value of attribute script.
142 143 144 |
# File 'lib/sumomo/ec2.rb', line 142 def script @script end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
144 145 146 |
# File 'lib/sumomo/ec2.rb', line 144 def end |
Instance Method Details
#download_file(name, local_path) ⇒ Object
136 137 138 139 140 |
# File 'lib/sumomo/ec2.rb', line 136 def download_file(name, local_path) @script += " sudo aws s3 cp s3://\#{@bucket_name}/uploads/\#{name} \#{local_path}\n SNIPPET\nend\n" |
#mkdir(name) ⇒ Object
130 131 132 133 134 |
# File 'lib/sumomo/ec2.rb', line 130 def mkdir(name) @script += " sudo mkdir -p \#{name}\n SNIPPET\nend\n" |
#tag(name, value) ⇒ Object
146 147 148 |
# File 'lib/sumomo/ec2.rb', line 146 def tag(name, value) << [name, value] end |