heirloom 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ruby-1.9.3-p125@heirloom --create
1
+ rvm use ruby-1.9.3-p194@heirloom --create
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ script: "rake spec"
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.8.1:
2
+
3
+ * Moving verification on entry exists into catalog class
4
+
1
5
  ## v0.8.0:
2
6
 
3
7
  * Change base to bucket prefix through out code base
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://secure.travis-ci.org/intuit/heirloom.png)](http://travis-ci.org/intuit/heirloom)
2
+
1
3
  Heirloom
2
4
  ========
3
5
 
@@ -8,7 +10,7 @@ Heirloom creates archives from directories. Their archives are versioned and hos
8
10
  Installation
9
11
  ------------
10
12
 
11
- First things first, install heirloom:
13
+ Install the gem
12
14
 
13
15
  ```
14
16
  gem install heirloom
@@ -22,8 +24,6 @@ aws:
22
24
  secret_key: UPDATE_ME
23
25
  ```
24
26
 
25
- * **access_key / secret_key**: AWS account credentials where you would like the archives stored.
26
-
27
27
  Proxy Support
28
28
  -------------
29
29
 
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # specify any dependencies here; for example:
22
- s.add_development_dependency "rspec"
22
+ s.add_development_dependency "rspec", '~> 2.11.0'
23
+ s.add_development_dependency "rake"
23
24
 
24
25
  s.add_runtime_dependency 'fog', '~> 1.5.0'
25
26
  s.add_runtime_dependency 'grit', '~> 2.5.0'
@@ -12,12 +12,14 @@ module Heirloom
12
12
  regions = args[:regions]
13
13
  bucket_prefix = args[:bucket_prefix]
14
14
 
15
- @logger.info "Adding #{@name} to catalog."
15
+ unless verify.entry_exists_in_catalog? @name
16
+ @logger.info "Adding #{@name} to catalog."
16
17
 
17
- sdb.put_attributes 'heirloom',
18
- "heirloom_#{@name}",
19
- { "regions" => regions,
20
- "bucket_prefix" => bucket_prefix }
18
+ sdb.put_attributes 'heirloom',
19
+ "heirloom_#{@name}",
20
+ "regions" => regions,
21
+ "bucket_prefix" => bucket_prefix
22
+ end
21
23
 
22
24
  end
23
25
 
@@ -27,6 +29,10 @@ module Heirloom
27
29
  @sdb ||= AWS::SimpleDB.new :config => @config
28
30
  end
29
31
 
32
+ def verify
33
+ @verify ||= Catalog::Verify.new :config => @config
34
+ end
35
+
30
36
  end
31
37
  end
32
38
  end
@@ -32,10 +32,6 @@ module Heirloom
32
32
 
33
33
  @catalog.create_catalog_domain
34
34
 
35
- ensure_entry_does_not_exist_in_catalog :config => @config,
36
- :catalog => @catalog,
37
- :entry => @opts[:name]
38
-
39
35
  @catalog.add_to_catalog :regions => @opts[:region],
40
36
  :bucket_prefix => @opts[:bucket_prefix]
41
37
 
@@ -118,7 +118,7 @@ module Heirloom
118
118
  :config => config
119
119
 
120
120
  unless archive.domain_exists?
121
- logger.error "'#{name}' does not exist in '#{config.metadata_region}' catalog."
121
+ logger.error "'#{name}' metadata domain does not exist in '#{config.metadata_region}'."
122
122
  exit 1
123
123
  end
124
124
  end
@@ -170,19 +170,6 @@ module Heirloom
170
170
  end
171
171
  end
172
172
 
173
- def ensure_entry_does_not_exist_in_catalog(args)
174
- config = args[:config]
175
- catalog = args[:catalog]
176
- entry = args[:entry]
177
- logger = config.logger
178
- region = config.metadata_region
179
-
180
- if catalog.entry_exists_in_catalog? entry
181
- logger.error "Entry for #{entry} exists in #{region} catalog."
182
- exit 1
183
- end
184
- end
185
-
186
173
  def latest_id(args)
187
174
  archive = Archive.new :name => args[:name],
188
175
  :config => args[:config]
@@ -1,3 +1,3 @@
1
1
  module Heirloom
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -7,13 +7,18 @@ describe Heirloom::Catalog::Add do
7
7
  @bucket_prefix = 'bucket_prefix'
8
8
  @logger_stub = stub 'logger', :info => true
9
9
  @config_stub = stub 'config', :logger => @logger_stub
10
+ @verify_stub = stub 'verify'
10
11
 
11
12
  @add = Heirloom::Catalog::Add.new :config => @config_stub,
12
13
  :name => 'new_archive'
14
+ Heirloom::Catalog::Verify.should_receive(:new).
15
+ with(:config => @config_stub).
16
+ and_return @verify_stub
13
17
  end
14
18
 
15
19
  it "should call sdb to add the entry to the catalog" do
16
20
  @sdb_mock = mock 'sdb'
21
+ @verify_stub.stub :entry_exists_in_catalog? => false
17
22
  Heirloom::AWS::SimpleDB.should_receive(:new).
18
23
  with(:config => @config_stub).
19
24
  and_return @sdb_mock
@@ -25,4 +30,11 @@ describe Heirloom::Catalog::Add do
25
30
  :bucket_prefix => @bucket_prefix
26
31
  end
27
32
 
33
+ it "should not add the entry to the catalog if it's already there" do
34
+ @verify_stub.stub :entry_exists_in_catalog? => true
35
+ Heirloom::AWS::SimpleDB.should_receive(:new).never
36
+ @add.add_to_catalog :regions => @regions,
37
+ :bucket_prefix => @bucket_prefix
38
+ end
39
+
28
40
  end
@@ -258,13 +258,6 @@ describe Heirloom do
258
258
  should raise_error SystemExit
259
259
  end
260
260
 
261
- it "should exit if the entry exists in catalog" do
262
- @catalog_mock.should_receive(:entry_exists_in_catalog?).
263
- with('entry').
264
- and_return true
265
- lambda { @object.ensure_entry_does_not_exist_in_catalog @options }.
266
- should raise_error SystemExit
267
- end
268
261
  end
269
262
 
270
263
  context "testing latest id" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heirloom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-26 00:00:00.000000000 Z
12
+ date: 2012-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70260713581820 !ruby/object:Gem::Requirement
16
+ requirement: &70142193190000 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 2.11.0
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70142193190000
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &70142193189180 !ruby/object:Gem::Requirement
17
28
  none: false
18
29
  requirements:
19
30
  - - ! '>='
@@ -21,10 +32,10 @@ dependencies:
21
32
  version: '0'
22
33
  type: :development
23
34
  prerelease: false
24
- version_requirements: *70260713581820
35
+ version_requirements: *70142193189180
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: fog
27
- requirement: &70260713581300 !ruby/object:Gem::Requirement
38
+ requirement: &70142193188060 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ~>
@@ -32,10 +43,10 @@ dependencies:
32
43
  version: 1.5.0
33
44
  type: :runtime
34
45
  prerelease: false
35
- version_requirements: *70260713581300
46
+ version_requirements: *70142193188060
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: grit
38
- requirement: &70260713580800 !ruby/object:Gem::Requirement
49
+ requirement: &70142193187120 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ~>
@@ -43,10 +54,10 @@ dependencies:
43
54
  version: 2.5.0
44
55
  type: :runtime
45
56
  prerelease: false
46
- version_requirements: *70260713580800
57
+ version_requirements: *70142193187120
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: trollop
49
- requirement: &70260713580320 !ruby/object:Gem::Requirement
60
+ requirement: &70142193185780 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - =
@@ -54,7 +65,7 @@ dependencies:
54
65
  version: '2.0'
55
66
  type: :runtime
56
67
  prerelease: false
57
- version_requirements: *70260713580320
68
+ version_requirements: *70142193185780
58
69
  description: I help build and manage building tar.gz files and deploying them into
59
70
  the cloud
60
71
  email:
@@ -66,6 +77,7 @@ extra_rdoc_files: []
66
77
  files:
67
78
  - .gitignore
68
79
  - .rvmrc
80
+ - .travis.yml
69
81
  - CHANGELOG
70
82
  - Gemfile
71
83
  - LICENSE
@@ -129,7 +141,6 @@ files:
129
141
  - lib/heirloom/uploader.rb
130
142
  - lib/heirloom/uploader/s3.rb
131
143
  - lib/heirloom/version.rb
132
- - script/ci_setup
133
144
  - spec/acl/s3_spec.rb
134
145
  - spec/archive/authorizer_spec.rb
135
146
  - spec/archive/builder_spec.rb
@@ -189,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
200
  version: '0'
190
201
  segments:
191
202
  - 0
192
- hash: -176871004567933972
203
+ hash: -107270664148118049
193
204
  required_rubygems_version: !ruby/object:Gem::Requirement
194
205
  none: false
195
206
  requirements:
@@ -198,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
209
  version: '0'
199
210
  segments:
200
211
  - 0
201
- hash: -176871004567933972
212
+ hash: -107270664148118049
202
213
  requirements: []
203
214
  rubyforge_project: heirloom
204
215
  rubygems_version: 1.8.16
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Source RVM profile and set ruby / gemset
4
- . /etc/profile
5
-
6
- # Exit with error if any command returns non zero
7
- set -e
8
-
9
- # Bundle gems
10
- rvm use "1.9.3-p125@heirloom" --create
11
- bundle
12
-
13
- # Run spec tests
14
- rake spec