berkshelf 2.0.6 → 2.0.7

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.
@@ -1,3 +1,7 @@
1
+ # 2.0.7
2
+
3
+ * Fix crash when parsing a lockfile that contains path locations which no longer exist
4
+
1
5
  # 2.0.6
2
6
 
3
7
  * Fix installation failures due to latest release of ActiveSupport
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  Copyright 2012-2013 Riot Games
2
2
 
3
- Jamie Winsor (<reset@riotgames.com>)
3
+ Jamie Winsor (<jamie@vialstudios.com>)
4
4
  Josiah Kiehl (<jkiehl@riotgames.com>)
5
5
  Michael Ivey (<michael.ivey@riotgames.com>)
6
6
  Justin Campbell (<justin.campbell@riotgames.com>)
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 (<reset@riotgames.com>)
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>)
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  'Seth Vargo'
11
11
  ]
12
12
  s.email = [
13
- 'reset@riotgames.com',
13
+ 'jamie@vialstudios.com',
14
14
  'jkiehl@riotgames.com',
15
15
  'michael.ivey@riotgames.com',
16
16
  'justin.campbell@riotgames.com',
@@ -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
  """
@@ -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 |
@@ -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.expand_path(File.join(options[:path], 'metadata.rb'))
262
+ metadata_file = File.join(options[:path], 'metadata.rb')
262
263
  end
263
264
 
264
265
  options[:constraint] = constraint
@@ -33,7 +33,17 @@ module Berkshelf
33
33
  hash = parse(contents)
34
34
 
35
35
  hash[:sources].each do |name, options|
36
- add(CookbookSource.new(berksfile, name.to_s, options))
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
 
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "2.0.6"
2
+ VERSION = "2.0.7"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Author:: Jamie Winsor (<reset@riotgames.com>)
2
+ # Author:: Jamie Winsor (<jamie@vialstudios.com>)
3
3
  #
4
4
  # Copyright 2012, Riot Games
5
5
  #
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.6
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-03 00:00:00.000000000 Z
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
- - reset@riotgames.com
516
+ - jamie@vialstudios.com
517
517
  - jkiehl@riotgames.com
518
518
  - michael.ivey@riotgames.com
519
519
  - justin.campbell@riotgames.com