berkshelf 1.0.0.rc1 → 1.0.0.rc2

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.
Files changed (48) hide show
  1. data/.travis.yml +2 -0
  2. data/Gemfile +11 -11
  3. data/Guardfile +1 -1
  4. data/README.md +1 -1
  5. data/berkshelf.gemspec +10 -11
  6. data/features/config.feature +1 -1
  7. data/features/cookbook_command.feature +1 -1
  8. data/features/default_locations.feature +6 -6
  9. data/features/groups_install.feature +3 -3
  10. data/features/init_command.feature +1 -1
  11. data/features/lockfile.feature +1 -1
  12. data/features/support/env.rb +1 -1
  13. data/features/upload_command.feature +1 -1
  14. data/lib/berkshelf.rb +14 -14
  15. data/lib/berkshelf/base_generator.rb +1 -1
  16. data/lib/berkshelf/berksfile.rb +22 -22
  17. data/lib/berkshelf/cached_cookbook.rb +1 -1
  18. data/lib/berkshelf/cli.rb +1 -1
  19. data/lib/berkshelf/cookbook_generator.rb +1 -1
  20. data/lib/berkshelf/cookbook_source.rb +1 -1
  21. data/lib/berkshelf/cookbook_store.rb +2 -2
  22. data/lib/berkshelf/core_ext/file_utils.rb +1 -1
  23. data/lib/berkshelf/core_ext/pathname.rb +2 -2
  24. data/lib/berkshelf/formatters.rb +1 -1
  25. data/lib/berkshelf/formatters/json.rb +1 -1
  26. data/lib/berkshelf/git.rb +2 -2
  27. data/lib/berkshelf/init_generator.rb +1 -1
  28. data/lib/berkshelf/location.rb +2 -2
  29. data/lib/berkshelf/locations/chef_api_location.rb +15 -8
  30. data/lib/berkshelf/locations/git_location.rb +2 -2
  31. data/lib/berkshelf/locations/site_location.rb +3 -3
  32. data/lib/berkshelf/resolver.rb +2 -2
  33. data/lib/berkshelf/vagrant/action/validate.rb +3 -3
  34. data/lib/berkshelf/vagrant/middleware.rb +1 -1
  35. data/lib/berkshelf/version.rb +1 -1
  36. data/spec/spec_helper.rb +6 -5
  37. data/spec/unit/berkshelf/berksfile_spec.rb +9 -9
  38. data/spec/unit/berkshelf/config_spec.rb +1 -1
  39. data/spec/unit/berkshelf/cookbook_source_spec.rb +3 -3
  40. data/spec/unit/berkshelf/cookbook_store_spec.rb +1 -1
  41. data/spec/unit/berkshelf/downloader_spec.rb +3 -3
  42. data/spec/unit/berkshelf/git_spec.rb +1 -1
  43. data/spec/unit/berkshelf/location_spec.rb +3 -3
  44. data/spec/unit/berkshelf/locations/chef_api_location_spec.rb +10 -12
  45. data/spec/unit/berkshelf/locations/git_location_spec.rb +2 -2
  46. data/spec/unit/berkshelf/lockfile_spec.rb +1 -1
  47. data/spec/unit/berkshelf/resolver_spec.rb +5 -5
  48. metadata +38 -54
@@ -12,7 +12,7 @@ module Berkshelf
12
12
 
13
13
  it "should raise if it can't find git" do
14
14
  ENV.should_receive(:[]).with("PATH").and_return(String.new)
15
-
15
+
16
16
  lambda {
17
17
  subject.find_git
18
18
  }.should raise_error(GitNotFound)
@@ -72,7 +72,7 @@ module Berkshelf
72
72
  describe "::solve_for_constraint" do
73
73
  let(:constraint) { "~> 0.101.2" }
74
74
  let(:versions) do
75
- {
75
+ {
76
76
  "0.101.2" => "http://cookbooks.opscode.com/api/v1/cookbooks/nginx/versions/0_101_2",
77
77
  "0.101.0" => "http://cookbooks.opscode.com/api/v1/cookbooks/nginx/versions/0_101_0",
78
78
  "0.100.2" => "http://cookbooks.opscode.com/api/v1/cookbooks/nginx/versions/0_100_2",
@@ -143,7 +143,7 @@ module Berkshelf
143
143
  end
144
144
  end
145
145
  end
146
- end
146
+ end
147
147
 
148
148
  let(:name) { "nginx" }
149
149
  let(:constraint) { double('constraint') }
@@ -179,7 +179,7 @@ module Berkshelf
179
179
 
180
180
  it "returns true if cached_cookbooks satisfies the version constraint" do
181
181
  constraint.should_receive(:satisfies?).with(cached.version).and_return(true)
182
-
182
+
183
183
  subject.validate_cached(cached).should be_true
184
184
  end
185
185
 
@@ -63,8 +63,8 @@ module Berkshelf
63
63
  end
64
64
  end
65
65
 
66
- context "given the symbol :knife for the value of chef_api:" do
67
- before(:each) { @loc = subject.new("nginx", constraint, chef_api: :knife) }
66
+ context "given the symbol :config for the value of chef_api:" do
67
+ before(:each) { @loc = subject.new("nginx", constraint, chef_api: :config) }
68
68
 
69
69
  it "uses the value of Chef::Config[:chef_server_url] for the uri attribute" do
70
70
  @loc.uri.should eql(Chef::Config[:chef_server_url])
@@ -106,7 +106,7 @@ module Berkshelf
106
106
  subject do
107
107
  loc = ChefAPILocation.new("nginx",
108
108
  double('constraint', satisfies?: true),
109
- chef_api: :knife
109
+ chef_api: :config
110
110
  )
111
111
  end
112
112
 
@@ -143,11 +143,10 @@ module Berkshelf
143
143
 
144
144
  context "given a constraint that matches an available cookbook" do
145
145
  before(:each) do
146
- cookbook_version = double('cookbook-version')
147
- cookbook_version.stub(:manifest).and_return({})
146
+ manifest = Hash.new
148
147
  subject.stub(:version_constraint) { Solve::Constraint.new("= 0.99.0") }
149
- rest.should_receive(:get_rest).with("https://api.opscode.com/organizations/vialstudios/cookbooks/nginx/0.99.0").and_return(cookbook_version)
150
- subject.should_receive(:download_files).with(cookbook_version.manifest).and_return(
148
+ subject.should_receive(:download_manifest).with("https://api.opscode.com/organizations/vialstudios/cookbooks/nginx/0.99.0").and_return(manifest)
149
+ subject.should_receive(:download_files).with(manifest).and_return(
151
150
  generate_cookbook(Dir.mktmpdir, subject.name, "0.99.0")
152
151
  )
153
152
  end
@@ -169,10 +168,9 @@ module Berkshelf
169
168
  end
170
169
 
171
170
  it "downloads the manifest of the latest cookbook version of the cookbook" do
172
- cookbook_version = double('cookbook-version')
173
- cookbook_version.stub(:manifest).and_return({})
174
- rest.should_receive(:get_rest).with("https://api.opscode.com/organizations/vialstudios/cookbooks/nginx/0.101.2").and_return(cookbook_version)
175
- subject.should_receive(:download_files).with(cookbook_version.manifest).and_return(
171
+ manifest = Hash.new
172
+ subject.should_receive(:download_manifest).with("https://api.opscode.com/organizations/vialstudios/cookbooks/nginx/0.101.2").and_return(manifest)
173
+ subject.should_receive(:download_files).with(manifest).and_return(
176
174
  generate_cookbook(Dir.mktmpdir, subject.name, subject.latest_version[0])
177
175
  )
178
176
 
@@ -225,7 +223,7 @@ module Berkshelf
225
223
  subject do
226
224
  ChefAPILocation.new('nginx',
227
225
  double('constraint'),
228
- chef_api: :knife
226
+ chef_api: :config
229
227
  )
230
228
  end
231
229
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module Berkshelf
4
4
  describe GitLocation do
5
5
  let(:complacent_constraint) { double('comp-vconstraint', satisfies?: true) }
6
-
6
+
7
7
  describe "ClassMethods" do
8
8
  subject { GitLocation }
9
9
 
@@ -86,7 +86,7 @@ module Berkshelf
86
86
 
87
87
  context "given a value for ref that is a tag or branch and not a commit hash" do
88
88
  subject do
89
- GitLocation.new("artifact",
89
+ GitLocation.new("artifact",
90
90
  complacent_constraint,
91
91
  git: "git://github.com/RiotGames/artifact-cookbook.git",
92
92
  ref: "0.9.8"
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module Berkshelf
4
4
  describe Lockfile do
5
5
  let(:downloader) { Downloader.new(Berkshelf.cookbook_store) }
6
-
6
+
7
7
  describe "without a lockfile in place already" do
8
8
  before(:all) do
9
9
  @old_dir = Dir.pwd
@@ -7,7 +7,7 @@ module Berkshelf
7
7
  name: 'mysql',
8
8
  version_constraint: Solve::Constraint.new('= 1.2.4'),
9
9
  downloaded?: true,
10
- cached_cookbook: double('mysql-cookbook',
10
+ cached_cookbook: double('mysql-cookbook',
11
11
  name: 'mysql-1.2.4',
12
12
  cookbook_name: 'mysql',
13
13
  version: '1.2.4',
@@ -22,7 +22,7 @@ module Berkshelf
22
22
  name: 'nginx',
23
23
  version_constraint: Solve::Constraint.new('= 0.101.2'),
24
24
  downloaded?: true,
25
- cached_cookbook: double('nginx-cookbook',
25
+ cached_cookbook: double('nginx-cookbook',
26
26
  name: 'nginx-0.101.2',
27
27
  cookbook_name: 'nginx',
28
28
  version: '0.101.2',
@@ -46,7 +46,7 @@ module Berkshelf
46
46
 
47
47
  it "adds the dependencies of the source as sources" do
48
48
  resolver = subject.new(downloader, sources: source)
49
-
49
+
50
50
  resolver.should have_source("nginx")
51
51
  resolver.should have_source("artifact")
52
52
  end
@@ -76,13 +76,13 @@ module Berkshelf
76
76
 
77
77
  it "adds an artifact of the same name of the source to the graph" do
78
78
  subject.graph.should_receive(:artifacts).with(source.name, source.cached_cookbook.version)
79
-
79
+
80
80
  subject.add_source(source, false)
81
81
  end
82
82
 
83
83
  it "adds the dependencies of the source as packages to the graph" do
84
84
  subject.should_receive(:add_source_dependencies).with(source)
85
-
85
+
86
86
  subject.add_source(source)
87
87
  end
88
88
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -12,16 +12,16 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-11-01 00:00:00.000000000 Z
15
+ date: 2012-11-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
- name: chozo
18
+ name: activesupport
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
23
23
  - !ruby/object:Gem::Version
24
- version: 0.2.1
24
+ version: '0'
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,15 +29,15 @@ dependencies:
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.1
32
+ version: '0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: ridley
34
+ name: chef
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  none: false
37
37
  requirements:
38
38
  - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.5
40
+ version: 10.12.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
@@ -45,15 +45,15 @@ dependencies:
45
45
  requirements:
46
46
  - - ! '>='
47
47
  - !ruby/object:Gem::Version
48
- version: 0.0.5
48
+ version: 10.12.0
49
49
  - !ruby/object:Gem::Dependency
50
- name: solve
50
+ name: ridley
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.4.0.rc1
56
+ version: 0.4.1
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -61,25 +61,25 @@ dependencies:
61
61
  requirements:
62
62
  - - ! '>='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.4.0.rc1
64
+ version: 0.4.1
65
65
  - !ruby/object:Gem::Dependency
66
- name: chef
66
+ name: chozo
67
67
  requirement: !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
- - - ~>
70
+ - - ! '>='
71
71
  - !ruby/object:Gem::Version
72
- version: '10.12'
72
+ version: 0.2.2
73
73
  type: :runtime
74
74
  prerelease: false
75
75
  version_requirements: !ruby/object:Gem::Requirement
76
76
  none: false
77
77
  requirements:
78
- - - ~>
78
+ - - ! '>='
79
79
  - !ruby/object:Gem::Version
80
- version: '10.12'
80
+ version: 0.2.2
81
81
  - !ruby/object:Gem::Dependency
82
- name: minitar
82
+ name: hashie
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
@@ -95,45 +95,29 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: thor
99
- requirement: !ruby/object:Gem::Requirement
100
- none: false
101
- requirements:
102
- - - ~>
103
- - !ruby/object:Gem::Version
104
- version: 0.16.0
105
- type: :runtime
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
110
- - - ~>
111
- - !ruby/object:Gem::Version
112
- version: 0.16.0
113
- - !ruby/object:Gem::Dependency
114
- name: vagrant
98
+ name: minitar
115
99
  requirement: !ruby/object:Gem::Requirement
116
100
  none: false
117
101
  requirements:
118
- - - ~>
102
+ - - ! '>='
119
103
  - !ruby/object:Gem::Version
120
- version: 1.0.5
104
+ version: '0'
121
105
  type: :runtime
122
106
  prerelease: false
123
107
  version_requirements: !ruby/object:Gem::Requirement
124
108
  none: false
125
109
  requirements:
126
- - - ~>
110
+ - - ! '>='
127
111
  - !ruby/object:Gem::Version
128
- version: 1.0.5
112
+ version: '0'
129
113
  - !ruby/object:Gem::Dependency
130
- name: activesupport
114
+ name: multi_json
131
115
  requirement: !ruby/object:Gem::Requirement
132
116
  none: false
133
117
  requirements:
134
118
  - - ! '>='
135
119
  - !ruby/object:Gem::Version
136
- version: '0'
120
+ version: 1.3.0
137
121
  type: :runtime
138
122
  prerelease: false
139
123
  version_requirements: !ruby/object:Gem::Requirement
@@ -141,15 +125,15 @@ dependencies:
141
125
  requirements:
142
126
  - - ! '>='
143
127
  - !ruby/object:Gem::Version
144
- version: '0'
128
+ version: 1.3.0
145
129
  - !ruby/object:Gem::Dependency
146
- name: multi_json
130
+ name: solve
147
131
  requirement: !ruby/object:Gem::Requirement
148
132
  none: false
149
133
  requirements:
150
134
  - - ! '>='
151
135
  - !ruby/object:Gem::Version
152
- version: '0'
136
+ version: 0.4.0.rc1
153
137
  type: :runtime
154
138
  prerelease: false
155
139
  version_requirements: !ruby/object:Gem::Requirement
@@ -157,39 +141,39 @@ dependencies:
157
141
  requirements:
158
142
  - - ! '>='
159
143
  - !ruby/object:Gem::Version
160
- version: '0'
144
+ version: 0.4.0.rc1
161
145
  - !ruby/object:Gem::Dependency
162
- name: hashie
146
+ name: thor
163
147
  requirement: !ruby/object:Gem::Requirement
164
148
  none: false
165
149
  requirements:
166
- - - ! '>='
150
+ - - ~>
167
151
  - !ruby/object:Gem::Version
168
- version: '0'
152
+ version: 0.16.0
169
153
  type: :runtime
170
154
  prerelease: false
171
155
  version_requirements: !ruby/object:Gem::Requirement
172
156
  none: false
173
157
  requirements:
174
- - - ! '>='
158
+ - - ~>
175
159
  - !ruby/object:Gem::Version
176
- version: '0'
160
+ version: 0.16.0
177
161
  - !ruby/object:Gem::Dependency
178
- name: activemodel
162
+ name: vagrant
179
163
  requirement: !ruby/object:Gem::Requirement
180
164
  none: false
181
165
  requirements:
182
- - - ! '>='
166
+ - - ~>
183
167
  - !ruby/object:Gem::Version
184
- version: '0'
168
+ version: 1.0.5
185
169
  type: :runtime
186
170
  prerelease: false
187
171
  version_requirements: !ruby/object:Gem::Requirement
188
172
  none: false
189
173
  requirements:
190
- - - ! '>='
174
+ - - ~>
191
175
  - !ruby/object:Gem::Version
192
- version: '0'
176
+ version: 1.0.5
193
177
  description: Manages a Cookbook's, or an Application's, Cookbook dependencies
194
178
  email:
195
179
  - jamie@vialstudios.com