berkshelf 0.3.1 → 0.3.2
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.
@@ -35,7 +35,7 @@ module Berkshelf
|
|
35
35
|
# 0.100.0 => "http://cookbooks.opscode.com/api/v1/cookbooks/nginx/versions/0_100_0"
|
36
36
|
# }
|
37
37
|
#
|
38
|
-
# @return [Array]
|
38
|
+
# @return [Array, nil]
|
39
39
|
# an array where the first element is a DepSelector::Version representing the best version
|
40
40
|
# for the given constraint and the second element is the URI to where the corrosponding
|
41
41
|
# version of the Cookbook can be downloaded from
|
@@ -48,6 +48,8 @@ module Berkshelf
|
|
48
48
|
return [ version, uri ]
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
nil
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -193,7 +195,7 @@ module Berkshelf
|
|
193
195
|
solution = self.class.solve_for_constraint(version_constraint, versions)
|
194
196
|
|
195
197
|
unless solution
|
196
|
-
raise NoSolution, "
|
198
|
+
raise NoSolution, "No cookbook version of '#{name}' found at '#{api_uri}' that would satisfy constraint (#{version_constraint})."
|
197
199
|
end
|
198
200
|
|
199
201
|
solution
|
data/lib/berkshelf/version.rb
CHANGED
@@ -30,6 +30,12 @@ module Berkshelf
|
|
30
30
|
it "should return the best match for the constraint and versions given" do
|
31
31
|
subject.solve_for_constraint(constraint, versions)[0].to_s.should eql("0.101.2")
|
32
32
|
end
|
33
|
+
|
34
|
+
context "given a solution can not be found for constraint" do
|
35
|
+
it "returns nil" do
|
36
|
+
subject.solve_for_constraint(DepSelector::VersionConstraint.new(">= 1.0"), versions).should be_nil
|
37
|
+
end
|
38
|
+
end
|
33
39
|
end
|
34
40
|
end
|
35
41
|
|
@@ -8,7 +8,7 @@ module Berkshelf
|
|
8
8
|
|
9
9
|
context "with default options" do
|
10
10
|
before do
|
11
|
-
generator = subject.new([]
|
11
|
+
generator = subject.new([target_root])
|
12
12
|
capture(:stdout) { generator.invoke_all }
|
13
13
|
end
|
14
14
|
|
@@ -22,21 +22,21 @@ module Berkshelf
|
|
22
22
|
|
23
23
|
context "with a .chefignore" do
|
24
24
|
before do
|
25
|
-
generator = subject.new([], :
|
25
|
+
generator = subject.new([target_root], chefignore: true)
|
26
26
|
capture(:stdout) { generator.invoke_all }
|
27
27
|
end
|
28
28
|
|
29
29
|
specify do
|
30
30
|
target_root.should have_structure {
|
31
31
|
file "Berksfile"
|
32
|
-
file "
|
32
|
+
file "chefignore"
|
33
33
|
}
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
context "with a metadata entry in the Berksfile" do
|
38
38
|
before do
|
39
|
-
generator = subject.new([], :
|
39
|
+
generator = subject.new([target_root], metadata_entry: true)
|
40
40
|
capture(:stdout) { generator.invoke_all }
|
41
41
|
end
|
42
42
|
|
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: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -458,7 +458,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
458
458
|
version: '0'
|
459
459
|
segments:
|
460
460
|
- 0
|
461
|
-
hash:
|
461
|
+
hash: -2415493654956634358
|
462
462
|
requirements: []
|
463
463
|
rubyforge_project:
|
464
464
|
rubygems_version: 1.8.23
|