berkshelf 3.0.0.beta8 → 3.0.0.beta9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +5 -2
- data/berkshelf.gemspec +2 -2
- data/features/config.feature +3 -18
- data/generator_files/Gemfile.erb +10 -6
- data/generator_files/Vagrantfile.erb +6 -20
- data/lib/berkshelf.rb +1 -0
- data/lib/berkshelf/berksfile.rb +1 -1
- data/lib/berkshelf/community_rest.rb +3 -3
- data/lib/berkshelf/config.rb +0 -6
- data/lib/berkshelf/cookbook_store.rb +4 -4
- data/lib/berkshelf/dependency.rb +13 -9
- data/lib/berkshelf/locations/git.rb +1 -1
- data/lib/berkshelf/lockfile.rb +1 -1
- data/lib/berkshelf/resolver/graph.rb +9 -6
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/cookbook_store_spec.rb +5 -5
- data/spec/unit/berkshelf/dependency_spec.rb +1 -1
- data/spec/unit/berkshelf/lockfile_spec.rb +5 -5
- data/spec/unit/berkshelf/resolver/graph_spec.rb +1 -1
- metadata +53 -55
- data/features/resolver.feature +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a93a58092d85d92072229df17a0ac18f86be4c61
|
4
|
+
data.tar.gz: 2d5f1a561cc471759fff50cdd1e1838ac3ad6728
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a9db9d98a43f866c73d75cb3a74418f96dd4feadfb4d20d57ef47e8f0dd0a50d787a5446e0c66050383918c4acd9781e948c6e5c84c1a5d5cfd79e1219301d
|
7
|
+
data.tar.gz: 78395f776b664f4184f6d9fd91ca564833db46d684571a93734c34516c4d894774ba1320774ad3054757177e9ddc861b7ceba96b244f281c25c8f689bd8b13a4
|
data/.travis.yml
CHANGED
@@ -2,6 +2,7 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 1.9.3
|
4
4
|
- 2.0.0
|
5
|
+
- 2.1.0
|
5
6
|
notifications:
|
6
7
|
irc:
|
7
8
|
channels:
|
@@ -13,7 +14,7 @@ branches:
|
|
13
14
|
- master
|
14
15
|
bundler_args: --without guard --jobs 7
|
15
16
|
before_install:
|
16
|
-
- sudo apt-get install -qq libarchive12 libarchive-dev
|
17
|
+
- sudo apt-get install -qq libarchive12 libarchive-dev libgecode-dev
|
17
18
|
before_script:
|
18
19
|
- echo "StrictHostKeyChecking no" > ~/.ssh/config
|
19
20
|
- git config --global user.email "ci@berkshelf.com"
|
data/README.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
Berkshelf
|
2
2
|
=========
|
3
|
-
[![Gem Version](https://
|
4
|
-
[![Build Status](https://
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/berkshelf.svg)][gem]
|
4
|
+
[![Build Status](https://img.shields.io/travis/berkshelf/berkshelf.svg)][travis]
|
5
|
+
|
6
|
+
[gem]: https://rubygems.org/gems/berkshelf
|
7
|
+
[travis]: https://travis-ci.org/berkshelf/berkshelf
|
5
8
|
|
6
9
|
Manage a Cookbook or an Application's Cookbook dependencies
|
7
10
|
|
data/berkshelf.gemspec
CHANGED
@@ -38,8 +38,8 @@ Gem::Specification.new do |s|
|
|
38
38
|
s.add_dependency 'faraday', '~> 0.9.0'
|
39
39
|
s.add_dependency 'minitar', '~> 0.5.4'
|
40
40
|
s.add_dependency 'retryable', '~> 1.3.3'
|
41
|
-
s.add_dependency 'ridley', '~> 3.0
|
42
|
-
s.add_dependency 'solve', '
|
41
|
+
s.add_dependency 'ridley', '~> 3.0'
|
42
|
+
s.add_dependency 'solve', '~> 1.0.0.rc1'
|
43
43
|
s.add_dependency 'thor', '~> 0.18.0'
|
44
44
|
s.add_dependency 'octokit', '~> 2.6'
|
45
45
|
|
data/features/config.feature
CHANGED
@@ -20,10 +20,6 @@ Feature: Reading a Berkshelf configuration file
|
|
20
20
|
"box_url": "http://files.vagrantup.com/lucid64.box",
|
21
21
|
"forward_port": {
|
22
22
|
"12345": "54321"
|
23
|
-
},
|
24
|
-
"network": {
|
25
|
-
"bridged": true,
|
26
|
-
"hostonly": "12.34.56.78"
|
27
23
|
}
|
28
24
|
}
|
29
25
|
}
|
@@ -35,8 +31,7 @@ Feature: Reading a Berkshelf configuration file
|
|
35
31
|
| config.vm.box = "my_box" |
|
36
32
|
| config.vm.box_url = "http://files.vagrantup.com/lucid64.box" |
|
37
33
|
| config.vm.network :forwarded_port, guest: 12345, host: 54321 |
|
38
|
-
| config.vm.network :private_network,
|
39
|
-
| config.vm.network :public_network |
|
34
|
+
| config.vm.network :private_network, type: "dhcp" |
|
40
35
|
And the exit status should be 0
|
41
36
|
|
42
37
|
Scenario: Using a Berkshelf configuration file that sets the vagrant-omnibus plugin chef version
|
@@ -53,10 +48,6 @@ Feature: Reading a Berkshelf configuration file
|
|
53
48
|
"box_url": "http://files.vagrantup.com/lucid64.box",
|
54
49
|
"forward_port": {
|
55
50
|
"12345": "54321"
|
56
|
-
},
|
57
|
-
"network": {
|
58
|
-
"bridged": true,
|
59
|
-
"hostonly": "12.34.56.78"
|
60
51
|
}
|
61
52
|
}
|
62
53
|
}
|
@@ -68,8 +59,7 @@ Feature: Reading a Berkshelf configuration file
|
|
68
59
|
| config.vm.box = "my_box" |
|
69
60
|
| config.vm.box_url = "http://files.vagrantup.com/lucid64.box" |
|
70
61
|
| config.vm.network :forwarded_port, guest: 12345, host: 54321 |
|
71
|
-
| config.vm.network :private_network,
|
72
|
-
| config.vm.network :public_network |
|
62
|
+
| config.vm.network :private_network, type: "dhcp" |
|
73
63
|
And the exit status should be 0
|
74
64
|
|
75
65
|
Scenario: Using a Berkshelf configuration file that sets the vagrant-omnibus plugin chef version to latest
|
@@ -86,10 +76,6 @@ Feature: Reading a Berkshelf configuration file
|
|
86
76
|
"box_url": "http://files.vagrantup.com/lucid64.box",
|
87
77
|
"forward_port": {
|
88
78
|
"12345": "54321"
|
89
|
-
},
|
90
|
-
"network": {
|
91
|
-
"bridged": true,
|
92
|
-
"hostonly": "12.34.56.78"
|
93
79
|
}
|
94
80
|
}
|
95
81
|
}
|
@@ -101,8 +87,7 @@ Feature: Reading a Berkshelf configuration file
|
|
101
87
|
| config.vm.box = "my_box" |
|
102
88
|
| config.vm.box_url = "http://files.vagrantup.com/lucid64.box" |
|
103
89
|
| config.vm.network :forwarded_port, guest: 12345, host: 54321 |
|
104
|
-
| config.vm.network :private_network,
|
105
|
-
| config.vm.network :public_network |
|
90
|
+
| config.vm.network :private_network, type: "dhcp" |
|
106
91
|
|
107
92
|
Scenario: Using a partial Berkshelf configuration file
|
108
93
|
Given I have a Berkshelf config file containing:
|
data/generator_files/Gemfile.erb
CHANGED
@@ -2,13 +2,17 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'berkshelf'
|
4
4
|
|
5
|
-
# Uncomment these lines
|
6
|
-
# to live on the Edge:
|
5
|
+
# Uncomment these lines if you want to live on the Edge:
|
7
6
|
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
7
|
+
# group :development do
|
8
|
+
# gem "berkshelf", github: "berkshelf/berkshelf"
|
9
|
+
# gem "vagrant", github: "mitchellh/vagrant", tag: "v1.5.2"
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# group :plugins do
|
13
|
+
# gem "vagrant-berkshelf", github: "berkshelf/vagrant-berkshelf"
|
14
|
+
# gem "vagrant-omnibus", github: "schisamo/vagrant-omnibus"
|
15
|
+
# end
|
12
16
|
|
13
17
|
<% if options[:foodcritic] -%>
|
14
18
|
gem 'thor-foodcritic'
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# -*- mode: ruby -*-
|
2
2
|
# vi: set ft=ruby :
|
3
3
|
|
4
|
-
#
|
5
|
-
|
6
|
-
#
|
7
|
-
# Vagrant.require_plugin "vagrant-berkshelf"
|
8
|
-
# Vagrant.require_plugin "vagrant-omnibus"
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = "2"
|
9
6
|
|
10
|
-
Vagrant.
|
7
|
+
Vagrant.require_version ">= 1.5.0"
|
8
|
+
|
9
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
11
10
|
# All Vagrant configuration is done here. The most common configuration
|
12
11
|
# options are documented and commented below. For a complete reference,
|
13
12
|
# please see the online documentation at vagrantup.com.
|
@@ -36,20 +35,7 @@ Vagrant.configure("2") do |config|
|
|
36
35
|
# via the IP. Host-only networks can talk to the host machine as well as
|
37
36
|
# any other machines on the same network, but cannot be accessed (through this
|
38
37
|
# network interface) by any external networks.
|
39
|
-
|
40
|
-
config.vm.network :private_network, ip: "<%= berkshelf_config.vagrant.vm.network.hostonly %>"
|
41
|
-
<% else %>
|
42
|
-
config.vm.network :private_network, ip: "192.168.33.10"
|
43
|
-
<% end -%>
|
44
|
-
|
45
|
-
# Create a public network, which generally matched to bridged network.
|
46
|
-
# Bridged networks make the machine appear as another physical device on
|
47
|
-
# your network.
|
48
|
-
<% if berkshelf_config.vagrant.vm.network.bridged -%>
|
49
|
-
config.vm.network :public_network
|
50
|
-
<% else %>
|
51
|
-
# config.vm.network :public_network
|
52
|
-
<% end -%>
|
38
|
+
config.vm.network :private_network, type: "dhcp"
|
53
39
|
|
54
40
|
# Create a forwarded port mapping which allows access to a specific port
|
55
41
|
# within the machine from a port on the host machine. In the example below,
|
data/lib/berkshelf.rb
CHANGED
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -233,7 +233,7 @@ module Berkshelf
|
|
233
233
|
#
|
234
234
|
# @param [String] name
|
235
235
|
# the name of the dependency to add
|
236
|
-
# @param [String,
|
236
|
+
# @param [String, Semverse::Constraint] constraint
|
237
237
|
# the constraint to lock the dependency to
|
238
238
|
#
|
239
239
|
# @option options [Symbol, Array] :group
|
@@ -146,12 +146,12 @@ module Berkshelf
|
|
146
146
|
end
|
147
147
|
|
148
148
|
# @param [String] name
|
149
|
-
# @param [String,
|
149
|
+
# @param [String, Semverse::Constraint] constraint
|
150
150
|
#
|
151
151
|
# @return [String]
|
152
152
|
def satisfy(name, constraint)
|
153
|
-
|
154
|
-
rescue
|
153
|
+
Semverse::Constraint.satisfy_best(constraint, versions(name)).to_s
|
154
|
+
rescue Semverse::NoSolutionError
|
155
155
|
nil
|
156
156
|
end
|
157
157
|
|
data/lib/berkshelf/config.rb
CHANGED
@@ -104,12 +104,6 @@ module Berkshelf
|
|
104
104
|
attribute 'vagrant.vm.forward_port',
|
105
105
|
type: Hash,
|
106
106
|
default: Hash.new
|
107
|
-
attribute 'vagrant.vm.network.bridged',
|
108
|
-
type: Boolean,
|
109
|
-
default: false
|
110
|
-
attribute 'vagrant.vm.network.hostonly',
|
111
|
-
type: String,
|
112
|
-
default: '33.33.33.10'
|
113
107
|
attribute 'vagrant.vm.provision',
|
114
108
|
type: String,
|
115
109
|
default: 'chef_solo'
|
@@ -96,8 +96,8 @@ module Berkshelf
|
|
96
96
|
def cookbooks(filter = nil)
|
97
97
|
cookbooks = storage_path.children.collect do |path|
|
98
98
|
begin
|
99
|
-
|
100
|
-
rescue
|
99
|
+
Semverse::Version.split(File.basename(path).slice(CachedCookbook::DIRNAME_REGEXP, 2))
|
100
|
+
rescue Semverse::InvalidVersionFormat
|
101
101
|
# Skip cookbooks that were downloaded by an SCM location. These can not be considered
|
102
102
|
# complete cookbooks.
|
103
103
|
next
|
@@ -136,12 +136,12 @@ module Berkshelf
|
|
136
136
|
# constraint. Nil is returned if no matching CachedCookbook is found.
|
137
137
|
#
|
138
138
|
# @param [#to_s] name
|
139
|
-
# @param [
|
139
|
+
# @param [Semverse::Constraint] constraint
|
140
140
|
#
|
141
141
|
# @return [Berkshelf::CachedCookbook, nil]
|
142
142
|
def satisfy(name, constraint)
|
143
143
|
graph = Solve::Graph.new
|
144
|
-
cookbooks(name).each { |cookbook| graph.
|
144
|
+
cookbooks(name).each { |cookbook| graph.artifact(name, cookbook.version) }
|
145
145
|
|
146
146
|
name, version = Solve.it!(graph, [[name, constraint]], ENV['DEBUG_RESOLVER'] ? { ui: Berkshelf.ui } : {}).first
|
147
147
|
|
data/lib/berkshelf/dependency.rb
CHANGED
@@ -17,8 +17,6 @@ module Berkshelf
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
DEFAULT_CONSTRAINT = '>= 0.0.0'.freeze
|
21
|
-
|
22
20
|
# @return [Berkshelf::Berksfile]
|
23
21
|
attr_reader :berksfile
|
24
22
|
# @return [String]
|
@@ -27,9 +25,9 @@ module Berkshelf
|
|
27
25
|
attr_reader :groups
|
28
26
|
# @return [Berkshelf::Location]
|
29
27
|
attr_reader :location
|
30
|
-
# @return [
|
28
|
+
# @return [Semverse::Version]
|
31
29
|
attr_reader :locked_version
|
32
|
-
# @return [
|
30
|
+
# @return [Semverse::Constraint]
|
33
31
|
attr_reader :version_constraint
|
34
32
|
# @return [Source]
|
35
33
|
attr_accessor :source
|
@@ -39,7 +37,7 @@ module Berkshelf
|
|
39
37
|
# @param [String] name
|
40
38
|
# the name of dependency
|
41
39
|
#
|
42
|
-
# @option options [String,
|
40
|
+
# @option options [String, Semverse::Constraint] :constraint
|
43
41
|
# version constraint for this dependency
|
44
42
|
# @option options [String] :git
|
45
43
|
# the Git URL to clone
|
@@ -62,8 +60,14 @@ module Berkshelf
|
|
62
60
|
@name = name
|
63
61
|
@metadata = options[:metadata]
|
64
62
|
@location = Location.init(self, options)
|
65
|
-
|
66
|
-
|
63
|
+
|
64
|
+
if options[:locked_version]
|
65
|
+
@locked_version = Semverse::Version.coerce(options[:locked_version])
|
66
|
+
end
|
67
|
+
|
68
|
+
# The coerce method automatically gives us a default constraint of
|
69
|
+
# >= 0.0.0 if the constraint is not set.
|
70
|
+
@version_constraint = Semverse::Constraint.coerce(options[:constraint])
|
67
71
|
|
68
72
|
add_group(options[:group]) if options[:group]
|
69
73
|
add_group(:default) if groups.empty?
|
@@ -81,7 +85,7 @@ module Berkshelf
|
|
81
85
|
# @param [#to_s] version
|
82
86
|
# the version to set
|
83
87
|
def locked_version=(version)
|
84
|
-
@locked_version =
|
88
|
+
@locked_version = Semverse::Version.coerce(version)
|
85
89
|
end
|
86
90
|
|
87
91
|
# Set this dependency's constraint(s).
|
@@ -89,7 +93,7 @@ module Berkshelf
|
|
89
93
|
# @param [#to_s] constraint
|
90
94
|
# the constraint to set
|
91
95
|
def version_constraint=(constraint)
|
92
|
-
@version_constraint =
|
96
|
+
@version_constraint = Semverse::Constraint.coerce(constraint)
|
93
97
|
end
|
94
98
|
|
95
99
|
def add_group(*local_groups)
|
@@ -56,7 +56,7 @@ module Berkshelf
|
|
56
56
|
# a cached git copy and a scratch directory to prevent bad cookbooks from
|
57
57
|
# making their way into the cookbook store.
|
58
58
|
#
|
59
|
-
# @see
|
59
|
+
# @see BaseLocation#install
|
60
60
|
def install
|
61
61
|
scratch_path = Pathname.new(Dir.mktmpdir)
|
62
62
|
|
data/lib/berkshelf/lockfile.rb
CHANGED
@@ -161,7 +161,7 @@ module Berkshelf
|
|
161
161
|
graphed = graph.find(name)
|
162
162
|
return false if graphed.nil?
|
163
163
|
|
164
|
-
|
164
|
+
Semverse::Constraint.new(constraint).satisfies?(graphed.version) &&
|
165
165
|
satisfies_transitive?(graphed, checked)
|
166
166
|
end
|
167
167
|
end
|
@@ -6,10 +6,11 @@ module Berkshelf
|
|
6
6
|
store ||= Berkshelf::CookbookStore.instance
|
7
7
|
|
8
8
|
store.cookbooks.each do |cookbook|
|
9
|
-
|
9
|
+
artifact(cookbook.cookbook_name, cookbook.version)
|
10
10
|
|
11
11
|
cookbook.dependencies.each do |dependency, constraint|
|
12
|
-
|
12
|
+
constraint = nil if constraint.empty?
|
13
|
+
artifact(cookbook.cookbook_name, cookbook.version).depends(dependency, constraint)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -23,9 +24,10 @@ module Berkshelf
|
|
23
24
|
name = cookbook.cookbook_name
|
24
25
|
version = cookbook.version
|
25
26
|
|
26
|
-
|
27
|
+
artifact(name, version)
|
27
28
|
cookbook.dependencies.each do |dependency, constraint|
|
28
|
-
|
29
|
+
constraint = nil if constraint.empty?
|
30
|
+
artifact(name, version).depends(dependency, constraint)
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
@@ -34,10 +36,11 @@ module Berkshelf
|
|
34
36
|
universe(sources).each do |cookbook|
|
35
37
|
next if has_artifact?(cookbook.name, cookbook.version)
|
36
38
|
|
37
|
-
|
39
|
+
artifact(cookbook.name, cookbook.version)
|
38
40
|
|
39
41
|
cookbook.dependencies.each do |dependency, constraint|
|
40
|
-
|
42
|
+
constraint = nil if constraint.empty?
|
43
|
+
artifact(cookbook.name, cookbook.version).depends(dependency, constraint)
|
41
44
|
end
|
42
45
|
end
|
43
46
|
end
|
data/lib/berkshelf/version.rb
CHANGED
@@ -38,9 +38,9 @@ describe Berkshelf::CookbookStore do
|
|
38
38
|
describe '#satisfy' do
|
39
39
|
let(:name) { 'nginx' }
|
40
40
|
let(:version) { '0.101.4' }
|
41
|
-
let(:constraint) {
|
42
|
-
let(:cached_one) { double('cached-one', name: name, version:
|
43
|
-
let(:cached_two) { double('cached-two', name: 'mysql', version:
|
41
|
+
let(:constraint) { Semverse::Constraint.new('~> 0.101.2') }
|
42
|
+
let(:cached_one) { double('cached-one', name: name, version: Semverse::Version.new(version)) }
|
43
|
+
let(:cached_two) { double('cached-two', name: 'mysql', version: Semverse::Version.new('1.2.6')) }
|
44
44
|
|
45
45
|
before { subject.stub(:cookbooks).and_return([cached_one, cached_two]) }
|
46
46
|
|
@@ -61,8 +61,8 @@ describe Berkshelf::CookbookStore do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
context 'when there is no matching cookbook for the given name and constraint' do
|
64
|
-
let(:version) {
|
65
|
-
let(:constraint) {
|
64
|
+
let(:version) { Semverse::Version.new('1.0.0') }
|
65
|
+
let(:constraint) { Semverse::Constraint.new('= 0.1.0') }
|
66
66
|
|
67
67
|
before { subject.stub(:cookbooks).and_return([ double('badcache', name: 'none', version: version) ]) }
|
68
68
|
|
@@ -29,7 +29,7 @@ describe Berkshelf::Dependency do
|
|
29
29
|
context 'given a value for :constraint' do
|
30
30
|
let(:source) { described_class.new(berksfile, cookbook_name, constraint: '~> 1.0.84') }
|
31
31
|
|
32
|
-
it 'returns a
|
32
|
+
it 'returns a Semverse::Constraint for the given version for version_constraint' do
|
33
33
|
expect(source.version_constraint.to_s).to eq('~> 1.0.84')
|
34
34
|
end
|
35
35
|
end
|
@@ -58,7 +58,7 @@ describe Berkshelf::Lockfile do
|
|
58
58
|
cookbook = double('apt-1.0.0', dependencies: {})
|
59
59
|
apt = double('apt',
|
60
60
|
name: 'apt',
|
61
|
-
version_constraint:
|
61
|
+
version_constraint: Semverse::Constraint.new('>= 0.0.0'),
|
62
62
|
version: '1.0.0',
|
63
63
|
location: 'api',
|
64
64
|
dependencies: {},
|
@@ -76,7 +76,7 @@ describe Berkshelf::Lockfile do
|
|
76
76
|
cookbook = double('apt-1.0.0', dependencies: { 'bacon' => '1.0.0' })
|
77
77
|
apt = double('apt',
|
78
78
|
name: 'apt',
|
79
|
-
version_constraint:
|
79
|
+
version_constraint: Semverse::Constraint.new('>= 0.0.0'),
|
80
80
|
version: '1.0.0',
|
81
81
|
location: 'api',
|
82
82
|
dependencies: { 'bacon' => '1.0.0' },
|
@@ -96,7 +96,7 @@ describe Berkshelf::Lockfile do
|
|
96
96
|
cookbook = double('apt-1.0.0', dependencies: { 'bacon' => '1.0.0', 'flip' => '2.0.0' })
|
97
97
|
apt = double('apt',
|
98
98
|
name: 'apt',
|
99
|
-
version_constraint:
|
99
|
+
version_constraint: Semverse::Constraint.new('>= 0.0.0'),
|
100
100
|
version: '1.0.0',
|
101
101
|
location: 'api',
|
102
102
|
dependencies: { 'bacon' => '1.0.0' },
|
@@ -132,7 +132,7 @@ describe Berkshelf::Lockfile do
|
|
132
132
|
cookbook = double('apt-1.0.0', dependencies: {})
|
133
133
|
apt = double('apt',
|
134
134
|
name: 'apt',
|
135
|
-
version_constraint:
|
135
|
+
version_constraint: Semverse::Constraint.new('< 1.0.0'),
|
136
136
|
version: '1.0.0',
|
137
137
|
location: 'api',
|
138
138
|
dependencies: {},
|
@@ -150,7 +150,7 @@ describe Berkshelf::Lockfile do
|
|
150
150
|
cookbook = double('apt-1.0.0', dependencies: {})
|
151
151
|
apt = double('apt',
|
152
152
|
name: 'apt',
|
153
|
-
version_constraint:
|
153
|
+
version_constraint: Semverse::Constraint.new('< 1.0.0'),
|
154
154
|
version: '1.0.0',
|
155
155
|
location: 'api',
|
156
156
|
dependencies: {},
|
@@ -19,7 +19,7 @@ describe Berkshelf::Resolver::Graph, :not_supported_on_windows do
|
|
19
19
|
|
20
20
|
it "adds the dependencies of each dependency to the graph" do
|
21
21
|
subject.populate(sources)
|
22
|
-
expect(subject.
|
22
|
+
expect(subject.artifact("ruby", "1.0.0").dependencies).to have(1).item
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
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: 3.0.0.
|
4
|
+
version: 3.0.0.beta9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -12,300 +12,300 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-04-
|
15
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - ~>
|
21
|
+
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 2.3.4
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - ~>
|
28
|
+
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 2.3.4
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: berkshelf-api-client
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - ~>
|
35
|
+
- - "~>"
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: 1.2.0.rc2
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- - ~>
|
42
|
+
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 1.2.0.rc2
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: buff-config
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- - ~>
|
49
|
+
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: '0.2'
|
52
52
|
type: :runtime
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
|
-
- - ~>
|
56
|
+
- - "~>"
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0.2'
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: buff-extensions
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - ~>
|
63
|
+
- - "~>"
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0.4'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - ~>
|
70
|
+
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0.4'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: buff-shell_out
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- - ~>
|
77
|
+
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0.1'
|
80
80
|
type: :runtime
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- - ~>
|
84
|
+
- - "~>"
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0.1'
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: faraday
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- - ~>
|
91
|
+
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: 0.9.0
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- - ~>
|
98
|
+
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: 0.9.0
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: minitar
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
|
-
- - ~>
|
105
|
+
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: 0.5.4
|
108
108
|
type: :runtime
|
109
109
|
prerelease: false
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
|
-
- - ~>
|
112
|
+
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: 0.5.4
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: retryable
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- - ~>
|
119
|
+
- - "~>"
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: 1.3.3
|
122
122
|
type: :runtime
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
|
-
- - ~>
|
126
|
+
- - "~>"
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: 1.3.3
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: ridley
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- - ~>
|
133
|
+
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: 3.0
|
135
|
+
version: '3.0'
|
136
136
|
type: :runtime
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
|
-
- - ~>
|
140
|
+
- - "~>"
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: 3.0
|
142
|
+
version: '3.0'
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: solve
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - "~>"
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: 0.
|
149
|
+
version: 1.0.0.rc1
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- -
|
154
|
+
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: 0.
|
156
|
+
version: 1.0.0.rc1
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: thor
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- - ~>
|
161
|
+
- - "~>"
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: 0.18.0
|
164
164
|
type: :runtime
|
165
165
|
prerelease: false
|
166
166
|
version_requirements: !ruby/object:Gem::Requirement
|
167
167
|
requirements:
|
168
|
-
- - ~>
|
168
|
+
- - "~>"
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: 0.18.0
|
171
171
|
- !ruby/object:Gem::Dependency
|
172
172
|
name: octokit
|
173
173
|
requirement: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
|
-
- - ~>
|
175
|
+
- - "~>"
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '2.6'
|
178
178
|
type: :runtime
|
179
179
|
prerelease: false
|
180
180
|
version_requirements: !ruby/object:Gem::Requirement
|
181
181
|
requirements:
|
182
|
-
- - ~>
|
182
|
+
- - "~>"
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '2.6'
|
185
185
|
- !ruby/object:Gem::Dependency
|
186
186
|
name: aruba
|
187
187
|
requirement: !ruby/object:Gem::Requirement
|
188
188
|
requirements:
|
189
|
-
- - ~>
|
189
|
+
- - "~>"
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0.5'
|
192
192
|
type: :development
|
193
193
|
prerelease: false
|
194
194
|
version_requirements: !ruby/object:Gem::Requirement
|
195
195
|
requirements:
|
196
|
-
- - ~>
|
196
|
+
- - "~>"
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: '0.5'
|
199
199
|
- !ruby/object:Gem::Dependency
|
200
200
|
name: chef-zero
|
201
201
|
requirement: !ruby/object:Gem::Requirement
|
202
202
|
requirements:
|
203
|
-
- - ~>
|
203
|
+
- - "~>"
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: 1.5.0
|
206
206
|
type: :development
|
207
207
|
prerelease: false
|
208
208
|
version_requirements: !ruby/object:Gem::Requirement
|
209
209
|
requirements:
|
210
|
-
- - ~>
|
210
|
+
- - "~>"
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: 1.5.0
|
213
213
|
- !ruby/object:Gem::Dependency
|
214
214
|
name: fuubar
|
215
215
|
requirement: !ruby/object:Gem::Requirement
|
216
216
|
requirements:
|
217
|
-
- - ~>
|
217
|
+
- - "~>"
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '1.1'
|
220
220
|
type: :development
|
221
221
|
prerelease: false
|
222
222
|
version_requirements: !ruby/object:Gem::Requirement
|
223
223
|
requirements:
|
224
|
-
- - ~>
|
224
|
+
- - "~>"
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '1.1'
|
227
227
|
- !ruby/object:Gem::Dependency
|
228
228
|
name: rake
|
229
229
|
requirement: !ruby/object:Gem::Requirement
|
230
230
|
requirements:
|
231
|
-
- - ~>
|
231
|
+
- - "~>"
|
232
232
|
- !ruby/object:Gem::Version
|
233
233
|
version: '0.9'
|
234
234
|
type: :development
|
235
235
|
prerelease: false
|
236
236
|
version_requirements: !ruby/object:Gem::Requirement
|
237
237
|
requirements:
|
238
|
-
- - ~>
|
238
|
+
- - "~>"
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: '0.9'
|
241
241
|
- !ruby/object:Gem::Dependency
|
242
242
|
name: rspec
|
243
243
|
requirement: !ruby/object:Gem::Requirement
|
244
244
|
requirements:
|
245
|
-
- - ~>
|
245
|
+
- - "~>"
|
246
246
|
- !ruby/object:Gem::Version
|
247
247
|
version: '2.13'
|
248
248
|
type: :development
|
249
249
|
prerelease: false
|
250
250
|
version_requirements: !ruby/object:Gem::Requirement
|
251
251
|
requirements:
|
252
|
-
- - ~>
|
252
|
+
- - "~>"
|
253
253
|
- !ruby/object:Gem::Version
|
254
254
|
version: '2.13'
|
255
255
|
- !ruby/object:Gem::Dependency
|
256
256
|
name: spork
|
257
257
|
requirement: !ruby/object:Gem::Requirement
|
258
258
|
requirements:
|
259
|
-
- - ~>
|
259
|
+
- - "~>"
|
260
260
|
- !ruby/object:Gem::Version
|
261
261
|
version: '0.9'
|
262
262
|
type: :development
|
263
263
|
prerelease: false
|
264
264
|
version_requirements: !ruby/object:Gem::Requirement
|
265
265
|
requirements:
|
266
|
-
- - ~>
|
266
|
+
- - "~>"
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0.9'
|
269
269
|
- !ruby/object:Gem::Dependency
|
270
270
|
name: test-kitchen
|
271
271
|
requirement: !ruby/object:Gem::Requirement
|
272
272
|
requirements:
|
273
|
-
- -
|
273
|
+
- - ">="
|
274
274
|
- !ruby/object:Gem::Version
|
275
275
|
version: 1.0.0.alpha7
|
276
276
|
type: :development
|
277
277
|
prerelease: false
|
278
278
|
version_requirements: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
|
-
- -
|
280
|
+
- - ">="
|
281
281
|
- !ruby/object:Gem::Version
|
282
282
|
version: 1.0.0.alpha7
|
283
283
|
- !ruby/object:Gem::Dependency
|
284
284
|
name: webmock
|
285
285
|
requirement: !ruby/object:Gem::Requirement
|
286
286
|
requirements:
|
287
|
-
- - ~>
|
287
|
+
- - "~>"
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '1.11'
|
290
290
|
type: :development
|
291
291
|
prerelease: false
|
292
292
|
version_requirements: !ruby/object:Gem::Requirement
|
293
293
|
requirements:
|
294
|
-
- - ~>
|
294
|
+
- - "~>"
|
295
295
|
- !ruby/object:Gem::Version
|
296
296
|
version: '1.11'
|
297
297
|
- !ruby/object:Gem::Dependency
|
298
298
|
name: yard
|
299
299
|
requirement: !ruby/object:Gem::Requirement
|
300
300
|
requirements:
|
301
|
-
- - ~>
|
301
|
+
- - "~>"
|
302
302
|
- !ruby/object:Gem::Version
|
303
303
|
version: '0.8'
|
304
304
|
type: :development
|
305
305
|
prerelease: false
|
306
306
|
version_requirements: !ruby/object:Gem::Requirement
|
307
307
|
requirements:
|
308
|
-
- - ~>
|
308
|
+
- - "~>"
|
309
309
|
- !ruby/object:Gem::Version
|
310
310
|
version: '0.8'
|
311
311
|
description: Manages a Cookbook's, or an Application's, Cookbook dependencies
|
@@ -320,8 +320,8 @@ executables:
|
|
320
320
|
extensions: []
|
321
321
|
extra_rdoc_files: []
|
322
322
|
files:
|
323
|
-
- .gitignore
|
324
|
-
- .travis.yml
|
323
|
+
- ".gitignore"
|
324
|
+
- ".travis.yml"
|
325
325
|
- CHANGELOG.md
|
326
326
|
- CONTRIBUTING.md
|
327
327
|
- Gemfile
|
@@ -355,7 +355,6 @@ files:
|
|
355
355
|
- features/json_formatter.feature
|
356
356
|
- features/lifecycle.feature
|
357
357
|
- features/lockfile.feature
|
358
|
-
- features/resolver.feature
|
359
358
|
- features/step_definitions/berksfile_steps.rb
|
360
359
|
- features/step_definitions/chef/config_steps.rb
|
361
360
|
- features/step_definitions/chef_server_steps.rb
|
@@ -502,17 +501,17 @@ require_paths:
|
|
502
501
|
- lib
|
503
502
|
required_ruby_version: !ruby/object:Gem::Requirement
|
504
503
|
requirements:
|
505
|
-
- -
|
504
|
+
- - ">="
|
506
505
|
- !ruby/object:Gem::Version
|
507
506
|
version: 1.9.2
|
508
507
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
509
508
|
requirements:
|
510
|
-
- -
|
509
|
+
- - ">="
|
511
510
|
- !ruby/object:Gem::Version
|
512
511
|
version: 1.8.0
|
513
512
|
requirements: []
|
514
513
|
rubyforge_project:
|
515
|
-
rubygems_version: 2.
|
514
|
+
rubygems_version: 2.2.2
|
516
515
|
signing_key:
|
517
516
|
specification_version: 4
|
518
517
|
summary: Manages a Cookbook's, or an Application's, Cookbook dependencies
|
@@ -540,7 +539,6 @@ test_files:
|
|
540
539
|
- features/json_formatter.feature
|
541
540
|
- features/lifecycle.feature
|
542
541
|
- features/lockfile.feature
|
543
|
-
- features/resolver.feature
|
544
542
|
- features/step_definitions/berksfile_steps.rb
|
545
543
|
- features/step_definitions/chef/config_steps.rb
|
546
544
|
- features/step_definitions/chef_server_steps.rb
|
data/features/resolver.feature
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
Feature: Berkshelf resolver
|
2
|
-
Background:
|
3
|
-
* the Berkshelf API server's cache is empty
|
4
|
-
* the Chef Server has cookbooks:
|
5
|
-
| berkshelf | 1.0.0 |
|
6
|
-
| berkshelf | 2.0.0 |
|
7
|
-
* the Berkshelf API server's cache is up to date
|
8
|
-
* I have a Berksfile pointing at the local Berkshelf API with:
|
9
|
-
"""
|
10
|
-
cookbook 'berkshelf'
|
11
|
-
"""
|
12
|
-
|
13
|
-
Scenario: with DEBUG_RESOLVER=1
|
14
|
-
Given the environment variable DEBUG_RESOLVER is "1"
|
15
|
-
When I successfully run `berks install`
|
16
|
-
Then the output should contain:
|
17
|
-
"""
|
18
|
-
Attempting to find a solution
|
19
|
-
Adding constraint berkshelf >= 0.0.0 from root
|
20
|
-
"""
|
21
|
-
|
22
|
-
Scenario: without DEBUG_RESOLVER
|
23
|
-
Given the environment variable DEBUG_RESOLVER is nil
|
24
|
-
When I successfully run `berks install`
|
25
|
-
Then the output should not contain:
|
26
|
-
"""
|
27
|
-
Attempting to find a solution
|
28
|
-
"""
|