heirloom 0.6.1 → 0.7.0rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG +11 -1
  2. data/lib/heirloom/acl/s3.rb +1 -1
  3. data/lib/heirloom/archive/authorizer.rb +1 -1
  4. data/lib/heirloom/archive/builder.rb +1 -3
  5. data/lib/heirloom/archive/destroyer.rb +2 -19
  6. data/lib/heirloom/archive/lister.rb +1 -1
  7. data/lib/heirloom/archive/reader.rb +1 -1
  8. data/lib/heirloom/archive/teardowner.rb +48 -0
  9. data/lib/heirloom/archive/verifier.rb +2 -2
  10. data/lib/heirloom/archive.rb +16 -3
  11. data/lib/heirloom/aws/s3.rb +8 -4
  12. data/lib/heirloom/aws/simpledb.rb +6 -1
  13. data/lib/heirloom/catalog/add.rb +31 -0
  14. data/lib/heirloom/catalog/delete.rb +37 -0
  15. data/lib/heirloom/catalog/list.rb +22 -0
  16. data/lib/heirloom/catalog/setup.rb +30 -0
  17. data/lib/heirloom/catalog/show.rb +35 -0
  18. data/lib/heirloom/catalog/verify.rb +39 -0
  19. data/lib/heirloom/catalog.rb +65 -0
  20. data/lib/heirloom/cli/authorize.rb +4 -4
  21. data/lib/heirloom/cli/catalog.rb +62 -0
  22. data/lib/heirloom/cli/destroy.rb +4 -4
  23. data/lib/heirloom/cli/download.rb +24 -13
  24. data/lib/heirloom/cli/list.rb +2 -2
  25. data/lib/heirloom/cli/setup.rb +21 -6
  26. data/lib/heirloom/cli/shared.rb +12 -3
  27. data/lib/heirloom/cli/show.rb +3 -3
  28. data/lib/heirloom/cli/tag.rb +3 -3
  29. data/lib/heirloom/cli/teardown.rb +75 -0
  30. data/lib/heirloom/cli/upload.rb +17 -26
  31. data/lib/heirloom/cli.rb +7 -1
  32. data/lib/heirloom/directory/directory.rb +1 -1
  33. data/lib/heirloom/version.rb +1 -1
  34. data/lib/heirloom.rb +7 -6
  35. data/spec/acl/s3_spec.rb +2 -7
  36. data/spec/archive/destroyer_spec.rb +4 -17
  37. data/spec/archive/lister_spec.rb +1 -1
  38. data/spec/archive/reader_spec.rb +9 -9
  39. data/spec/archive/teardowner_spec.rb +42 -0
  40. data/spec/archive_spec.rb +23 -3
  41. data/spec/aws/s3_spec.rb +5 -0
  42. data/spec/aws/simpledb_spec.rb +13 -3
  43. data/spec/catalog/add_spec.rb +28 -0
  44. data/spec/catalog/delete_spec.rb +35 -0
  45. data/spec/catalog/list_spec.rb +21 -0
  46. data/spec/catalog/setup_spec.rb +29 -0
  47. data/spec/catalog/show_spec.rb +32 -0
  48. data/spec/catalog/verify_spec.rb +47 -0
  49. data/spec/catalog_spec.rb +63 -0
  50. data/spec/cli/catalog_spec.rb +42 -0
  51. data/spec/cli/destroy_spec.rb +1 -1
  52. data/spec/cli/download_spec.rb +68 -26
  53. data/spec/cli/setup_spec.rb +11 -4
  54. data/spec/cli/shared_spec.rb +23 -0
  55. data/spec/cli/teardown_spec.rb +52 -0
  56. data/spec/cli/upload_spec.rb +6 -5
  57. metadata +44 -17
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+ require 'heirloom/cli'
3
+
4
+ describe Heirloom do
5
+
6
+ before do
7
+ options = { :level => 'info',
8
+ :name => 'archive_name',
9
+ :metadata_region => 'us-west-1' }
10
+
11
+ @logger_stub = stub 'logger', :error => true, :info => true
12
+ @config_mock = mock 'config'
13
+ @config_mock.stub :logger => @logger_stub,
14
+ :access_key => 'key',
15
+ :secret_key => 'secret',
16
+ :metadata_region => 'us-west-1'
17
+ @archive_mock = mock 'archive'
18
+ @catalog_mock = mock 'catalog'
19
+ @catalog_mock.stub :regions => ['us-west-1', 'us-west-2']
20
+ @catalog_mock.stub :base => 'base'
21
+ Trollop.stub(:options).and_return options
22
+ Heirloom::HeirloomLogger.should_receive(:new).with(:log_level => 'info').
23
+ and_return @logger_stub
24
+ Heirloom::CLI::Teardown.any_instance.should_receive(:load_config).
25
+ with(:logger => @logger_stub,
26
+ :opts => options).
27
+ and_return @config_mock
28
+ Heirloom::Archive.should_receive(:new).
29
+ with(:name => 'archive_name',
30
+ :config => @config_mock).
31
+ and_return @archive_mock
32
+ Heirloom::Catalog.should_receive(:new).
33
+ with(:name => 'archive_name',
34
+ :config => @config_mock).
35
+ and_return @catalog_mock
36
+ @teardown = Heirloom::CLI::Teardown.new
37
+ end
38
+
39
+ it "should delete s3 buckets, catalog and simpledb domain" do
40
+ @teardown.should_receive(:ensure_domain_exists).
41
+ with(:name => 'archive_name',
42
+ :config => @config_mock)
43
+ @teardown.should_receive(:ensure_archive_domain_empty).
44
+ with(:archive => @archive_mock,
45
+ :config => @config_mock)
46
+ @archive_mock.should_receive(:delete_buckets)
47
+ @archive_mock.should_receive(:delete_domain)
48
+ @catalog_mock.should_receive(:delete_from_catalog)
49
+ @teardown.teardown
50
+ end
51
+
52
+ end
@@ -6,10 +6,8 @@ describe Heirloom do
6
6
  before do
7
7
  @regions = ['us-west-1', 'us-west-2']
8
8
  options = { :level => 'info',
9
- :base => 'base',
10
9
  :git => false,
11
10
  :exclude => ['exclude1', 'exclude2'],
12
- :region => @regions,
13
11
  :directory => '/buildme',
14
12
  :public => false,
15
13
  :secret => 'secret12',
@@ -24,6 +22,8 @@ describe Heirloom do
24
22
  :secret_key => 'secret',
25
23
  :metadata_region => 'us-west-1'
26
24
  @archive_mock = mock 'archive'
25
+ @catalog_stub = stub 'catalog', :regions => @regions,
26
+ :base => 'base'
27
27
  Trollop.stub(:options).and_return options
28
28
  Heirloom::HeirloomLogger.should_receive(:new).with(:log_level => 'info').
29
29
  and_return @logger_stub
@@ -36,6 +36,10 @@ describe Heirloom do
36
36
  :name => 'archive_name',
37
37
  :config => @config_mock).
38
38
  and_return @archive_mock
39
+ Heirloom::Catalog.should_receive(:new).
40
+ with(:name => 'archive_name',
41
+ :config => @config_mock).
42
+ and_return @catalog_stub
39
43
  @upload = Heirloom::CLI::Upload.new
40
44
  end
41
45
 
@@ -54,9 +58,6 @@ describe Heirloom do
54
58
  @upload.should_receive(:ensure_valid_secret).
55
59
  with(:secret => 'secret12',
56
60
  :config => @config_mock)
57
- @upload.should_receive(:ensure_metadata_in_upload_region).
58
- with(:config => @config_mock,
59
- :regions => @regions)
60
61
  @archive_mock.stub :exists? => false
61
62
  @archive_mock.should_receive(:build).
62
63
  with(:base => 'base',
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heirloom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
5
- prerelease:
4
+ version: 0.7.0rc1
5
+ prerelease: 5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brett Weaver
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-23 00:00:00.000000000 Z
12
+ date: 2012-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70191146015360 !ruby/object:Gem::Requirement
16
+ requirement: &70259043841160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70191146015360
24
+ version_requirements: *70259043841160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fog
27
- requirement: &70191146014760 !ruby/object:Gem::Requirement
27
+ requirement: &70259043839120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.5.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70191146014760
35
+ version_requirements: *70259043839120
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: grit
38
- requirement: &70191146014100 !ruby/object:Gem::Requirement
38
+ requirement: &70259043838180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.5.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70191146014100
46
+ version_requirements: *70259043838180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: trollop
49
- requirement: &70191146013520 !ruby/object:Gem::Requirement
49
+ requirement: &70259043837620 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - =
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '2.0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70191146013520
57
+ version_requirements: *70259043837620
58
58
  description: I help build and manage building tar.gz files and deploying them into
59
59
  the cloud
60
60
  email:
@@ -84,6 +84,7 @@ files:
84
84
  - lib/heirloom/archive/lister.rb
85
85
  - lib/heirloom/archive/reader.rb
86
86
  - lib/heirloom/archive/setuper.rb
87
+ - lib/heirloom/archive/teardowner.rb
87
88
  - lib/heirloom/archive/updater.rb
88
89
  - lib/heirloom/archive/uploader.rb
89
90
  - lib/heirloom/archive/verifier.rb
@@ -91,11 +92,19 @@ files:
91
92
  - lib/heirloom/aws.rb
92
93
  - lib/heirloom/aws/s3.rb
93
94
  - lib/heirloom/aws/simpledb.rb
95
+ - lib/heirloom/catalog.rb
96
+ - lib/heirloom/catalog/add.rb
97
+ - lib/heirloom/catalog/delete.rb
98
+ - lib/heirloom/catalog/list.rb
99
+ - lib/heirloom/catalog/setup.rb
100
+ - lib/heirloom/catalog/show.rb
101
+ - lib/heirloom/catalog/verify.rb
94
102
  - lib/heirloom/cipher.rb
95
103
  - lib/heirloom/cipher/data.rb
96
104
  - lib/heirloom/cipher/file.rb
97
105
  - lib/heirloom/cli.rb
98
106
  - lib/heirloom/cli/authorize.rb
107
+ - lib/heirloom/cli/catalog.rb
99
108
  - lib/heirloom/cli/destroy.rb
100
109
  - lib/heirloom/cli/download.rb
101
110
  - lib/heirloom/cli/list.rb
@@ -103,6 +112,7 @@ files:
103
112
  - lib/heirloom/cli/shared.rb
104
113
  - lib/heirloom/cli/show.rb
105
114
  - lib/heirloom/cli/tag.rb
115
+ - lib/heirloom/cli/teardown.rb
106
116
  - lib/heirloom/cli/upload.rb
107
117
  - lib/heirloom/config.rb
108
118
  - lib/heirloom/destroyer.rb
@@ -125,6 +135,7 @@ files:
125
135
  - spec/archive/lister_spec.rb
126
136
  - spec/archive/reader_spec.rb
127
137
  - spec/archive/setup_spec.rb
138
+ - spec/archive/teardowner_spec.rb
128
139
  - spec/archive/updater_spec.rb
129
140
  - spec/archive/uploader_spec.rb
130
141
  - spec/archive/verifier_spec.rb
@@ -132,9 +143,17 @@ files:
132
143
  - spec/archive_spec.rb
133
144
  - spec/aws/s3_spec.rb
134
145
  - spec/aws/simpledb_spec.rb
146
+ - spec/catalog/add_spec.rb
147
+ - spec/catalog/delete_spec.rb
148
+ - spec/catalog/list_spec.rb
149
+ - spec/catalog/setup_spec.rb
150
+ - spec/catalog/show_spec.rb
151
+ - spec/catalog/verify_spec.rb
152
+ - spec/catalog_spec.rb
135
153
  - spec/cipher/data_spec.rb
136
154
  - spec/cipher/file_spec.rb
137
155
  - spec/cli/authorize_spec.rb
156
+ - spec/cli/catalog_spec.rb
138
157
  - spec/cli/destroy_spec.rb
139
158
  - spec/cli/download_spec.rb
140
159
  - spec/cli/list_spec.rb
@@ -142,6 +161,7 @@ files:
142
161
  - spec/cli/shared_spec.rb
143
162
  - spec/cli/show_spec.rb
144
163
  - spec/cli/tag_spec.rb
164
+ - spec/cli/teardown_spec.rb
145
165
  - spec/cli/upload_spec.rb
146
166
  - spec/config_spec.rb
147
167
  - spec/destroyer/s3_spec.rb
@@ -164,16 +184,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
184
  version: '0'
165
185
  segments:
166
186
  - 0
167
- hash: 376571268782401083
187
+ hash: -980215948232096115
168
188
  required_rubygems_version: !ruby/object:Gem::Requirement
169
189
  none: false
170
190
  requirements:
171
- - - ! '>='
191
+ - - ! '>'
172
192
  - !ruby/object:Gem::Version
173
- version: '0'
174
- segments:
175
- - 0
176
- hash: 376571268782401083
193
+ version: 1.3.1
177
194
  requirements: []
178
195
  rubyforge_project: heirloom
179
196
  rubygems_version: 1.8.16
@@ -189,6 +206,7 @@ test_files:
189
206
  - spec/archive/lister_spec.rb
190
207
  - spec/archive/reader_spec.rb
191
208
  - spec/archive/setup_spec.rb
209
+ - spec/archive/teardowner_spec.rb
192
210
  - spec/archive/updater_spec.rb
193
211
  - spec/archive/uploader_spec.rb
194
212
  - spec/archive/verifier_spec.rb
@@ -196,9 +214,17 @@ test_files:
196
214
  - spec/archive_spec.rb
197
215
  - spec/aws/s3_spec.rb
198
216
  - spec/aws/simpledb_spec.rb
217
+ - spec/catalog/add_spec.rb
218
+ - spec/catalog/delete_spec.rb
219
+ - spec/catalog/list_spec.rb
220
+ - spec/catalog/setup_spec.rb
221
+ - spec/catalog/show_spec.rb
222
+ - spec/catalog/verify_spec.rb
223
+ - spec/catalog_spec.rb
199
224
  - spec/cipher/data_spec.rb
200
225
  - spec/cipher/file_spec.rb
201
226
  - spec/cli/authorize_spec.rb
227
+ - spec/cli/catalog_spec.rb
202
228
  - spec/cli/destroy_spec.rb
203
229
  - spec/cli/download_spec.rb
204
230
  - spec/cli/list_spec.rb
@@ -206,6 +232,7 @@ test_files:
206
232
  - spec/cli/shared_spec.rb
207
233
  - spec/cli/show_spec.rb
208
234
  - spec/cli/tag_spec.rb
235
+ - spec/cli/teardown_spec.rb
209
236
  - spec/cli/upload_spec.rb
210
237
  - spec/config_spec.rb
211
238
  - spec/destroyer/s3_spec.rb