berkshelf 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/berkshelf.gemspec +1 -1
- data/features/install_command.feature +12 -0
- data/features/lockfile.feature +30 -0
- data/lib/berkshelf/berksfile.rb +2 -1
- data/lib/berkshelf/lockfile.rb +11 -1
- data/lib/berkshelf/version.rb +1 -1
- data/spec/fixtures/cookbooks/nginx-0.100.5/templates/default/plugins/nginx.rb.erb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -75,7 +75,7 @@ If you need to disable SSL, you can in `~/.berkshelf/config.json` like so:
|
|
75
75
|
|
76
76
|
Authors
|
77
77
|
-------
|
78
|
-
- Jamie Winsor (<
|
78
|
+
- Jamie Winsor (<jamie@vialstudios.com>)
|
79
79
|
- Josiah Kiehl (<jkiehl@riotgames.com>)
|
80
80
|
- Michael Ivey (<michael.ivey@riotgames.com>)
|
81
81
|
- Justin Campbell (<justin.campbell@riotgames.com>)
|
data/berkshelf.gemspec
CHANGED
@@ -74,6 +74,18 @@ Feature: install cookbooks from a Berksfile
|
|
74
74
|
"""
|
75
75
|
And the exit status should be 0
|
76
76
|
|
77
|
+
Scenario: installing a Berksfile from a remote directory that contains a path location
|
78
|
+
Given I write to "tmp_berks/Berksfile" with:
|
79
|
+
"""
|
80
|
+
cookbook 'example_cookbook', path: '../../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
|
81
|
+
"""
|
82
|
+
When I successfully run `berks install -b ./tmp_berks/Berksfile`
|
83
|
+
Then the output should contain:
|
84
|
+
"""
|
85
|
+
Using example_cookbook (0.5.0) at '
|
86
|
+
"""
|
87
|
+
And the exit status should be 0
|
88
|
+
|
77
89
|
Scenario: installing a Berksfile that contains a Git location
|
78
90
|
Given I write to "Berksfile" with:
|
79
91
|
"""
|
data/features/lockfile.feature
CHANGED
@@ -70,6 +70,36 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
70
70
|
}
|
71
71
|
"""
|
72
72
|
|
73
|
+
Scenario: Reading the Berksfile.lock when it contains an invalid path location
|
74
|
+
Given the cookbook store has the cookbooks:
|
75
|
+
| fake | 1.0.0 |
|
76
|
+
And I write to "Berksfile" with:
|
77
|
+
"""
|
78
|
+
cookbook 'fake'
|
79
|
+
"""
|
80
|
+
And I write to "Berksfile.lock" with:
|
81
|
+
"""
|
82
|
+
{
|
83
|
+
"sources":{
|
84
|
+
"non-existent":{
|
85
|
+
"path":"/this/path/does/not/exist"
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
"""
|
90
|
+
When I successfully run `berks install`
|
91
|
+
Then the file "Berksfile.lock" should contain JSON:
|
92
|
+
"""
|
93
|
+
{
|
94
|
+
"sources":{
|
95
|
+
"fake":{
|
96
|
+
"locked_version":"1.0.0"
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
"""
|
101
|
+
And the exit status should be 0
|
102
|
+
|
73
103
|
Scenario: Installing a cookbook with dependencies
|
74
104
|
Given the cookbook store has the cookbooks:
|
75
105
|
| dep | 1.0.0 |
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -161,6 +161,7 @@ module Berkshelf
|
|
161
161
|
options = args.last.is_a?(Hash) ? args.pop : Hash.new
|
162
162
|
name, constraint = args
|
163
163
|
|
164
|
+
options[:path] &&= File.expand_path(options[:path], File.dirname(filepath))
|
164
165
|
options[:group] = Array(options[:group])
|
165
166
|
|
166
167
|
if @@active_group
|
@@ -258,7 +259,7 @@ module Berkshelf
|
|
258
259
|
end
|
259
260
|
|
260
261
|
if options[:path]
|
261
|
-
metadata_file = File.
|
262
|
+
metadata_file = File.join(options[:path], 'metadata.rb')
|
262
263
|
end
|
263
264
|
|
264
265
|
options[:constraint] = constraint
|
data/lib/berkshelf/lockfile.rb
CHANGED
@@ -33,7 +33,17 @@ module Berkshelf
|
|
33
33
|
hash = parse(contents)
|
34
34
|
|
35
35
|
hash[:sources].each do |name, options|
|
36
|
-
|
36
|
+
# Dynamically calculate paths relative to the Berksfile if a path is given
|
37
|
+
options[:path] &&= File.expand_path(options[:path], File.dirname(filepath))
|
38
|
+
|
39
|
+
begin
|
40
|
+
add(CookbookSource.new(berksfile, name.to_s, options))
|
41
|
+
rescue Berkshelf::CookbookNotFound
|
42
|
+
# It's possible that a source is locked that contains a path location, and
|
43
|
+
# that path location was renamed or no longer exists. When loading the
|
44
|
+
# lockfile, Berkshelf will throw an error if it can't find a cookbook that
|
45
|
+
# previously existed at a path location.
|
46
|
+
end
|
37
47
|
end
|
38
48
|
end
|
39
49
|
|
data/lib/berkshelf/version.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-07-
|
16
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: activesupport
|
@@ -513,7 +513,7 @@ dependencies:
|
|
513
513
|
version: '0'
|
514
514
|
description: Manages a Cookbook's, or an Application's, Cookbook dependencies
|
515
515
|
email:
|
516
|
-
-
|
516
|
+
- jamie@vialstudios.com
|
517
517
|
- jkiehl@riotgames.com
|
518
518
|
- michael.ivey@riotgames.com
|
519
519
|
- justin.campbell@riotgames.com
|