Class: Sumomo::Stack::EC2Tasks
- Inherits:
-
Object
- Object
- Sumomo::Stack::EC2Tasks
- Defined in:
- lib/sumomo/ec2.rb
Instance Method Summary collapse
- #download_file(name, local_path) ⇒ Object
-
#initialize(bucket_name, &block) ⇒ EC2Tasks
constructor
A new instance of EC2Tasks.
- #mkdir(name) ⇒ Object
- #script ⇒ Object
- #tag(name, value) ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(bucket_name, &block) ⇒ EC2Tasks
Returns a new instance of EC2Tasks.
126 127 128 129 130 131 |
# File 'lib/sumomo/ec2.rb', line 126 def initialize(bucket_name, &block) @script = "" @bucket_name = bucket_name = [] instance_eval(&block) if block end |
Instance Method Details
#download_file(name, local_path) ⇒ Object
139 140 141 142 143 |
# File 'lib/sumomo/ec2.rb', line 139 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
133 134 135 136 137 |
# File 'lib/sumomo/ec2.rb', line 133 def mkdir(name) @script += "sudo mkdir -p \#{name}\n SNIPPET\nend\n" |
#script ⇒ Object
145 146 147 |
# File 'lib/sumomo/ec2.rb', line 145 def script @script end |
#tag(name, value) ⇒ Object
153 154 155 |
# File 'lib/sumomo/ec2.rb', line 153 def tag(name, value) << [name, value] end |
#tags ⇒ Object
149 150 151 |
# File 'lib/sumomo/ec2.rb', line 149 def end |