stem 0.5.8 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ module Stem
2
2
  module Family
3
3
  include Util
4
4
  extend self
5
+ autoload :Member, 'stem/family/member'
5
6
 
6
7
  def ami_for(family, release, architecture = "x86_64")
7
8
  amis = Stem::Image::tagged(:family => family,
@@ -0,0 +1,48 @@
1
+ module Stem
2
+ module Family
3
+ class Member
4
+ include Util
5
+ attr_reader :family, :sha1, :source_ami, :time
6
+
7
+ def initialize(family, config, userdata)
8
+ aggregate_hash_options_for_ami!(config)
9
+ @time = Time.now.utc
10
+ @family = family
11
+ @sha1 = Family.image_hash(config, userdata)
12
+ @source_ami = config['ami']
13
+ @userdata = userdata
14
+ end
15
+
16
+ def ==(member)
17
+ [ :family, :sha1, :source_ami, :time ].map do |attribute|
18
+ self.send(attribute) == member.send(attribute)
19
+ end.all?
20
+ end
21
+
22
+ def already_built?
23
+ !Stem::Image.tagged(:family => family, :sha1 => sha1).empty?
24
+ end
25
+
26
+ def capture(instance_id)
27
+ Stem::Image.create(name, instance_id, tags)
28
+ end
29
+
30
+ def name
31
+ "#{family}-#{timestamp.gsub(':', '_')}"
32
+ end
33
+
34
+ def tags
35
+ {
36
+ :created => timestamp,
37
+ :family => family,
38
+ :sha1 => sha1,
39
+ :source_ami => source_ami
40
+ }
41
+ end
42
+
43
+ def timestamp
44
+ time.iso8601
45
+ end
46
+ end
47
+ end
48
+ end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ prerelease:
5
+ version: 0.6.0
5
6
  platform: ruby
6
7
  authors:
7
8
  - Peter van Hardenberg
@@ -11,89 +12,97 @@ autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
14
 
14
- date: 2011-03-31 00:00:00 -07:00
15
+ date: 2011-04-01 00:00:00 -07:00
15
16
  default_executable:
16
17
  dependencies:
17
18
  - !ruby/object:Gem::Dependency
18
19
  name: swirl
19
- type: :runtime
20
- version_requirement:
21
- version_requirements: !ruby/object:Gem::Requirement
20
+ prerelease: false
21
+ requirement: &id001 !ruby/object:Gem::Requirement
22
+ none: false
22
23
  requirements:
23
24
  - - ~>
24
25
  - !ruby/object:Gem::Version
25
26
  version: 1.7.5
26
- version:
27
+ type: :runtime
28
+ version_requirements: *id001
27
29
  - !ruby/object:Gem::Dependency
28
30
  name: rspec
29
- type: :development
30
- version_requirement:
31
- version_requirements: !ruby/object:Gem::Requirement
31
+ prerelease: false
32
+ requirement: &id002 !ruby/object:Gem::Requirement
33
+ none: false
32
34
  requirements:
33
35
  - - ~>
34
36
  - !ruby/object:Gem::Version
35
37
  version: 2.5.0
36
- version:
38
+ type: :development
39
+ version_requirements: *id002
37
40
  - !ruby/object:Gem::Dependency
38
41
  name: rspec-core
39
- type: :development
40
- version_requirement:
41
- version_requirements: !ruby/object:Gem::Requirement
42
+ prerelease: false
43
+ requirement: &id003 !ruby/object:Gem::Requirement
44
+ none: false
42
45
  requirements:
43
46
  - - ~>
44
47
  - !ruby/object:Gem::Version
45
48
  version: 2.5.0
46
- version:
49
+ type: :development
50
+ version_requirements: *id003
47
51
  - !ruby/object:Gem::Dependency
48
52
  name: rspec-expectations
49
- type: :development
50
- version_requirement:
51
- version_requirements: !ruby/object:Gem::Requirement
53
+ prerelease: false
54
+ requirement: &id004 !ruby/object:Gem::Requirement
55
+ none: false
52
56
  requirements:
53
57
  - - ~>
54
58
  - !ruby/object:Gem::Version
55
59
  version: 2.5.0
56
- version:
60
+ type: :development
61
+ version_requirements: *id004
57
62
  - !ruby/object:Gem::Dependency
58
63
  name: rspec-mocks
59
- type: :development
60
- version_requirement:
61
- version_requirements: !ruby/object:Gem::Requirement
64
+ prerelease: false
65
+ requirement: &id005 !ruby/object:Gem::Requirement
66
+ none: false
62
67
  requirements:
63
68
  - - ~>
64
69
  - !ruby/object:Gem::Version
65
70
  version: 2.5.0
66
- version:
71
+ type: :development
72
+ version_requirements: *id005
67
73
  - !ruby/object:Gem::Dependency
68
74
  name: timecop
69
- type: :development
70
- version_requirement:
71
- version_requirements: !ruby/object:Gem::Requirement
75
+ prerelease: false
76
+ requirement: &id006 !ruby/object:Gem::Requirement
77
+ none: false
72
78
  requirements:
73
79
  - - ~>
74
80
  - !ruby/object:Gem::Version
75
81
  version: 0.3.5
76
- version:
82
+ type: :development
83
+ version_requirements: *id006
77
84
  - !ruby/object:Gem::Dependency
78
85
  name: vcr
79
- type: :development
80
- version_requirement:
81
- version_requirements: !ruby/object:Gem::Requirement
86
+ prerelease: false
87
+ requirement: &id007 !ruby/object:Gem::Requirement
88
+ none: false
82
89
  requirements:
83
90
  - - ~>
84
91
  - !ruby/object:Gem::Version
85
92
  version: 1.6.0
86
- version:
93
+ type: :development
94
+ version_requirements: *id007
87
95
  - !ruby/object:Gem::Dependency
88
96
  name: webmock
89
- type: :development
90
- version_requirement:
91
- version_requirements: !ruby/object:Gem::Requirement
97
+ prerelease: false
98
+ requirement: &id008 !ruby/object:Gem::Requirement
99
+ none: false
92
100
  requirements:
93
101
  - - ~>
94
102
  - !ruby/object:Gem::Version
95
103
  version: 1.6.2
96
- version:
104
+ type: :development
105
+ version_requirements: *id008
97
106
  description: minimalist EC2 instance management
98
107
  email:
99
108
  - pvh@heroku.com
@@ -109,6 +118,7 @@ files:
109
118
  - LICENSE
110
119
  - README.md
111
120
  - lib/stem/cli.rb
121
+ - lib/stem/family/member.rb
112
122
  - lib/stem/family.rb
113
123
  - lib/stem/group.rb
114
124
  - lib/stem/image.rb
@@ -120,6 +130,7 @@ files:
120
130
  - lib/stem/userdata.rb
121
131
  - lib/stem/util.rb
122
132
  - lib/stem.rb
133
+ - bin/stem
123
134
  has_rdoc: true
124
135
  homepage: http://github.com/pvh/stem
125
136
  licenses: []
@@ -130,21 +141,21 @@ rdoc_options: []
130
141
  require_paths:
131
142
  - lib
132
143
  required_ruby_version: !ruby/object:Gem::Requirement
144
+ none: false
133
145
  requirements:
134
146
  - - ">="
135
147
  - !ruby/object:Gem::Version
136
148
  version: "0"
137
- version:
138
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
+ none: false
139
151
  requirements:
140
152
  - - ">="
141
153
  - !ruby/object:Gem::Version
142
154
  version: "0"
143
- version:
144
155
  requirements: []
145
156
 
146
157
  rubyforge_project:
147
- rubygems_version: 1.3.5
158
+ rubygems_version: 1.6.1
148
159
  signing_key:
149
160
  specification_version: 2
150
161
  summary: an EC2 instance management library designed to get out of your way and give you instances