awful 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26f73b86154c9ea1c9f9a1118555121ec2ec4d6e
4
- data.tar.gz: 129ef7375025775df791dc538a098a419c62c4a2
3
+ metadata.gz: a102ebb758f56e3699436ff0e32fa5a3a7b1db36
4
+ data.tar.gz: 6b73e714e85aeb3a10aff2d57c038818dded6a74
5
5
  SHA512:
6
- metadata.gz: 0e5f284806a404647de961a2fd325edca785c099376f1c56664e31268bfb1516cc6604ac6769631084d3cb9445009f65390e6b14dc4affb8962d115d309ea48f
7
- data.tar.gz: 06052a701f4a304e7b6438bba4f9eb837fb329e559ff50dd3cc8f61aae7bf6f9c4015f7109ad4454b972e19bf05779e0161a6717b7ab7d8f0b88fcd20e467951
6
+ metadata.gz: 76ffecd19a005dc4542f94c867e4940a5064dce71378c05ce5a8053231b088a4af7a15bded7cbbb741fde91c954c369b92b124ebfb695d46ab2c70bbcfab4fd6
7
+ data.tar.gz: 957a113135a6f9ea94e968e645cf8d9a34f7591f7fbc86edadb30e11cfaf49ab4c5c48a76c8fbdf43969ca93a6f20046ca5cddeb3663176f46d4443f35064982
@@ -117,6 +117,39 @@ module Awful
117
117
  end
118
118
  end
119
119
 
120
+ desc 'update NAME', 'update an existing instance'
121
+ def user_data(name)
122
+ opt = load_cfg(options)
123
+ ec2.describe_instances.map(&:reservations).flatten.map(&:instances).flatten.find do |instance|
124
+ instance.instance_id == name or (n = tag_name(instance) and n.match(name))
125
+ end.tap do |instance|
126
+ ec2.modify_instance_attribute(instance_id: instance.instance_id, user_data: {
127
+ #value: Base64.strict_encode64(opt[:user_data])
128
+ value: opt[:user_data]
129
+ })
130
+ end
131
+ end
132
+
133
+ desc 'stop NAME', 'stop a running instance'
134
+ def stop(name)
135
+ ec2.describe_instances.map(&:reservations).flatten.map(&:instances).flatten.find do |instance|
136
+ instance.instance_id == name or (n = tag_name(instance) and n == name)
137
+ end.instance_id.tap do |id|
138
+ if yes? "Really stop instance #{name} (#{id})?", :yellow
139
+ ec2.stop_instances(instance_ids: Array(id))
140
+ end
141
+ end
142
+ end
143
+
144
+ desc 'start NAME', 'start a running instance'
145
+ def start(name)
146
+ ec2.describe_instances.map(&:reservations).flatten.map(&:instances).flatten.find do |instance|
147
+ instance.instance_id == name or (n = tag_name(instance) and n == name)
148
+ end.instance_id.tap do |id|
149
+ ec2.start_instances(instance_ids: Array(id))
150
+ end
151
+ end
152
+
120
153
  desc 'delete NAME', 'terminate a running instance'
121
154
  def delete(name)
122
155
  id =
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-17 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler