heirloom 0.7.2rc1 → 0.7.2rc2

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/CHANGELOG CHANGED
@@ -1,6 +1,7 @@
1
1
  ## v0.7.2:
2
2
 
3
3
  * Enclose files/dirs to tar in 's.
4
+ * Download the latest id if id not specified in download.
4
5
 
5
6
  ## v0.7.1:
6
7
 
@@ -11,13 +11,15 @@ module Heirloom
11
11
  :opts => @opts
12
12
 
13
13
  ensure_valid_options :provided => @opts,
14
- :required => [:name, :id, :output],
14
+ :required => [:name, :output],
15
15
  :config => @config
16
16
 
17
17
  @catalog = Heirloom::Catalog.new :name => @opts[:name],
18
18
  :config => @config
19
+ id = @opts[:id] ? @opts[:id] : latest_id
20
+
19
21
  @archive = Archive.new :name => @opts[:name],
20
- :id => @opts[:id],
22
+ :id => id,
21
23
  :config => @config
22
24
 
23
25
  # Lookup region & base from simpledb unless specified
@@ -48,9 +50,11 @@ Download Heirloom.
48
50
 
49
51
  Usage:
50
52
 
51
- heirloom download -n NAME -i ID -o OUTPUT_DIRECTORY
53
+ heirloom download -n NAME -o OUTPUT_DIRECTORY
54
+
55
+ It id (-i) is not specified, the latest id will be downloaded.
52
56
 
53
- To download Heirloom without looking up details in SimpleDB, specify region (-r) and base (-b) options.
57
+ To download Heirloom without looking up details in SimpleDB, specify region (-r), ID (-i) and base (-b) options.
54
58
 
55
59
  EOS
56
60
  opt :base, "Base of the Heirloom to download.", :type => :string
@@ -170,6 +170,11 @@ module Heirloom
170
170
  end
171
171
  end
172
172
 
173
+ def latest_id
174
+ @archive = Archive.new :name => @opts[:name],
175
+ :config => @config
176
+ @archive.list(1).first
177
+ end
173
178
  end
174
179
  end
175
180
  end
@@ -30,12 +30,6 @@ module Heirloom
30
30
 
31
31
  private
32
32
 
33
- def latest_id
34
- @archive = Archive.new :name => @opts[:name],
35
- :config => @config
36
- @archive.list(1).first
37
- end
38
-
39
33
  def read_options
40
34
  Trollop::options do
41
35
  version Heirloom::VERSION
@@ -1,3 +1,3 @@
1
1
  module Heirloom
2
- VERSION = "0.7.2rc1"
2
+ VERSION = "0.7.2rc2"
3
3
  end
@@ -21,7 +21,7 @@ describe Heirloom do
21
21
  and_return @archive_mock
22
22
  end
23
23
 
24
- context "with region and base specified" do
24
+ context "with id, region and base specified" do
25
25
  before do
26
26
  options = { :name => 'archive_name',
27
27
  :id => '1.0.0',
@@ -54,12 +54,11 @@ describe Heirloom do
54
54
  end
55
55
  end
56
56
 
57
- context "region and base not specified" do
57
+ context "id, region and base not specified" do
58
58
  before do
59
59
  @catalog_stub = stub 'catalog', :regions => ['us-east-1', 'us-west-1'],
60
60
  :base => 'base'
61
61
  options = { :name => 'archive_name',
62
- :id => '1.0.0',
63
62
  :level => 'info',
64
63
  :output => '/tmp/test123',
65
64
  :extract => false,
@@ -73,10 +72,15 @@ describe Heirloom do
73
72
  with(:name => 'archive_name',
74
73
  :config => @config_mock).
75
74
  and_return @catalog_stub
75
+ archive_stub_to_lookup_latest = stub 'latest', :list => ['1.0.0']
76
+ Heirloom::Archive.should_receive(:new).
77
+ with(:name => 'archive_name',
78
+ :config => @config_mock).
79
+ and_return archive_stub_to_lookup_latest
76
80
  @cli_download = Heirloom::CLI::Download.new
77
81
  end
78
82
 
79
- it "should download the archive from the first region" do
83
+ it "should download the latest archive from the first region" do
80
84
  @archive_mock.should_receive(:download).with(:output => '/tmp/test123',
81
85
  :region => 'us-east-1',
82
86
  :base_prefix => 'base',
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.7.2rc1
4
+ version: 0.7.2rc2
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70181327252060 !ruby/object:Gem::Requirement
16
+ requirement: &70128181257460 !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: *70181327252060
24
+ version_requirements: *70128181257460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fog
27
- requirement: &70181327251260 !ruby/object:Gem::Requirement
27
+ requirement: &70128181256280 !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: *70181327251260
35
+ version_requirements: *70128181256280
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: grit
38
- requirement: &70181327250740 !ruby/object:Gem::Requirement
38
+ requirement: &70128181255700 !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: *70181327250740
46
+ version_requirements: *70128181255700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: trollop
49
- requirement: &70181327247260 !ruby/object:Gem::Requirement
49
+ requirement: &70128181255180 !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: *70181327247260
57
+ version_requirements: *70128181255180
58
58
  description: I help build and manage building tar.gz files and deploying them into
59
59
  the cloud
60
60
  email:
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  segments:
186
186
  - 0
187
- hash: -349334653733231478
187
+ hash: -973563500248560019
188
188
  required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  none: false
190
190
  requirements: