berkshelf 4.2.3 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile +4 -0
- data/Gemfile.lock +27 -20
- data/berkshelf.gemspec +2 -3
- data/features/commands/install.feature +1 -5
- data/features/json_formatter.feature +2 -2
- data/lib/berkshelf/source.rb +33 -10
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/berksfile_spec.rb +1 -1
- metadata +11 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60e6cdaa1d8b9ad27930fe18d63bd29b31f00900
|
4
|
+
data.tar.gz: fea441fd4958e380dbbe3f5cef0bddee5c9a181e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdc0cfe2fd46f560cebc048502191d61344450577f7e8cd64bb424138e15850bee7cd7b63e94fccc6645f994bd0b01732446311df42fc1b0e44e14a7a095a21d
|
7
|
+
data.tar.gz: 9a6fd4209812da35aa820a2e2a7ef14c8486cc19b4f8bb343bdac5323040787e46d07565b5560c61260e56caa4bd3d42ed88dc3e244f98d4410527631e2b86dc
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -19,9 +19,9 @@ GIT
|
|
19
19
|
PATH
|
20
20
|
remote: .
|
21
21
|
specs:
|
22
|
-
berkshelf (4.
|
22
|
+
berkshelf (4.3.0)
|
23
23
|
addressable (~> 2.3, >= 2.3.4)
|
24
|
-
berkshelf-api-client (~> 2.0)
|
24
|
+
berkshelf-api-client (~> 2.0, >= 2.0.2)
|
25
25
|
buff-config (~> 1.0)
|
26
26
|
buff-extensions (~> 1.0)
|
27
27
|
buff-shell_out (~> 0.1)
|
@@ -33,20 +33,20 @@ PATH
|
|
33
33
|
minitar (~> 0.5, >= 0.5.4)
|
34
34
|
octokit (~> 4.0)
|
35
35
|
retryable (~> 2.0)
|
36
|
-
ridley (~> 4.
|
36
|
+
ridley (~> 4.5)
|
37
37
|
solve (~> 2.0)
|
38
38
|
thor (~> 0.19)
|
39
39
|
|
40
40
|
GEM
|
41
41
|
remote: https://rubygems.org/
|
42
42
|
specs:
|
43
|
-
activesupport (4.2.
|
43
|
+
activesupport (4.2.6)
|
44
44
|
i18n (~> 0.7)
|
45
45
|
json (~> 1.7, >= 1.7.7)
|
46
46
|
minitest (~> 5.1)
|
47
47
|
thread_safe (~> 0.3, >= 0.3.4)
|
48
48
|
tzinfo (~> 1.1)
|
49
|
-
addressable (2.
|
49
|
+
addressable (2.4.0)
|
50
50
|
archive (0.0.6)
|
51
51
|
ffi (~> 1.9.3)
|
52
52
|
aruba (0.10.2)
|
@@ -61,9 +61,10 @@ GEM
|
|
61
61
|
descendants_tracker (~> 0.0.4)
|
62
62
|
ice_nine (~> 0.11.0)
|
63
63
|
thread_safe (~> 0.3, >= 0.3.1)
|
64
|
-
berkshelf-api-client (2.0.
|
64
|
+
berkshelf-api-client (2.0.2)
|
65
65
|
faraday (~> 0.9.1)
|
66
66
|
httpclient (~> 2.7.0)
|
67
|
+
ridley (~> 4.5)
|
67
68
|
buff-config (1.0.1)
|
68
69
|
buff-extensions (~> 1.0)
|
69
70
|
varia_model (~> 0.4)
|
@@ -123,6 +124,7 @@ GEM
|
|
123
124
|
faraday (0.9.2)
|
124
125
|
multipart-post (>= 1.2, < 3)
|
125
126
|
ffi (1.9.10)
|
127
|
+
ffi (1.9.10-x86-mingw32)
|
126
128
|
ffi-yajl (2.2.3)
|
127
129
|
libyajl2 (~> 1.2)
|
128
130
|
formatador (0.2.5)
|
@@ -130,13 +132,12 @@ GEM
|
|
130
132
|
rspec (~> 3.0)
|
131
133
|
ruby-progressbar (~> 1.4)
|
132
134
|
gherkin (3.2.0)
|
133
|
-
github_api (0.13.
|
134
|
-
addressable (~> 2.
|
135
|
+
github_api (0.13.1)
|
136
|
+
addressable (~> 2.4.0)
|
135
137
|
descendants_tracker (~> 0.0.4)
|
136
138
|
faraday (~> 0.8, < 0.10)
|
137
139
|
hashie (>= 3.4)
|
138
140
|
multi_json (>= 1.7.5, < 2.0)
|
139
|
-
nokogiri (~> 1.6.6)
|
140
141
|
oauth2
|
141
142
|
github_changelog_generator (1.11.3)
|
142
143
|
bundler (>= 1.7)
|
@@ -180,6 +181,7 @@ GEM
|
|
180
181
|
hashdiff (0.3.0)
|
181
182
|
hashie (3.4.3)
|
182
183
|
hitimes (1.2.3)
|
184
|
+
hitimes (1.2.3-x86-mingw32)
|
183
185
|
http (0.9.8)
|
184
186
|
addressable (~> 2.3)
|
185
187
|
http-cookie (~> 1.0)
|
@@ -202,7 +204,6 @@ GEM
|
|
202
204
|
rb-kqueue (>= 0.2)
|
203
205
|
lumberjack (1.0.10)
|
204
206
|
method_source (0.8.2)
|
205
|
-
mini_portile2 (2.0.0)
|
206
207
|
minitar (0.5.4)
|
207
208
|
minitest (5.8.4)
|
208
209
|
mixlib-authentication (1.4.0)
|
@@ -214,8 +215,12 @@ GEM
|
|
214
215
|
mixlib-install (0.7.1)
|
215
216
|
mixlib-log (1.6.0)
|
216
217
|
mixlib-shellout (2.2.6)
|
218
|
+
mixlib-shellout (2.2.6-universal-mingw32)
|
219
|
+
win32-process (~> 0.8.2)
|
220
|
+
wmi-lite (~> 1.0)
|
217
221
|
molinillo (0.2.3)
|
218
222
|
msgpack (0.5.12)
|
223
|
+
msgpack (0.5.12-x86-mingw32)
|
219
224
|
multi_json (1.11.2)
|
220
225
|
multi_test (0.1.2)
|
221
226
|
multi_xml (0.5.5)
|
@@ -225,16 +230,14 @@ GEM
|
|
225
230
|
net-ssh (>= 2.6.5)
|
226
231
|
net-ssh (3.0.2)
|
227
232
|
nio4r (1.2.1)
|
228
|
-
nokogiri (1.6.7.2)
|
229
|
-
mini_portile2 (~> 2.0.0.rc2)
|
230
233
|
oauth2 (1.1.0)
|
231
234
|
faraday (>= 0.8, < 0.10)
|
232
235
|
jwt (~> 1.0, < 1.5.2)
|
233
236
|
multi_json (~> 1.3)
|
234
237
|
multi_xml (~> 0.5)
|
235
238
|
rack (>= 1.2, < 3)
|
236
|
-
octokit (4.
|
237
|
-
sawyer (~> 0.
|
239
|
+
octokit (4.3.0)
|
240
|
+
sawyer (~> 0.7.0, >= 0.5.3)
|
238
241
|
overcommit (0.32.0)
|
239
242
|
childprocess (~> 0.5.8)
|
240
243
|
iniparse (~> 1.4)
|
@@ -265,7 +268,7 @@ GEM
|
|
265
268
|
rack
|
266
269
|
websocket-driver (>= 0.5.1)
|
267
270
|
retryable (2.0.3)
|
268
|
-
ridley (4.
|
271
|
+
ridley (4.5.0)
|
269
272
|
addressable
|
270
273
|
buff-config (~> 1.0)
|
271
274
|
buff-extensions (~> 1.0)
|
@@ -304,8 +307,8 @@ GEM
|
|
304
307
|
unicode-display_width (~> 0.3)
|
305
308
|
ruby-progressbar (1.7.5)
|
306
309
|
safe_yaml (1.0.4)
|
307
|
-
sawyer (0.
|
308
|
-
addressable (
|
310
|
+
sawyer (0.7.0)
|
311
|
+
addressable (>= 2.3.5, < 2.5)
|
309
312
|
faraday (~> 0.8, < 0.10)
|
310
313
|
semverse (1.2.1)
|
311
314
|
slop (3.6.0)
|
@@ -313,8 +316,7 @@ GEM
|
|
313
316
|
molinillo (~> 0.2.3)
|
314
317
|
semverse (~> 1.1)
|
315
318
|
spork (0.9.2)
|
316
|
-
test-kitchen (1.
|
317
|
-
chef-config (>= 12.5.1)
|
319
|
+
test-kitchen (1.6.0)
|
318
320
|
mixlib-install (~> 0.7)
|
319
321
|
mixlib-shellout (>= 1.2, < 3.0)
|
320
322
|
net-scp (~> 1.1)
|
@@ -330,6 +332,7 @@ GEM
|
|
330
332
|
unf (0.1.4)
|
331
333
|
unf_ext
|
332
334
|
unf_ext (0.0.7.2)
|
335
|
+
unf_ext (0.0.7.2-x86-mingw32)
|
333
336
|
unicode-display_width (0.3.1)
|
334
337
|
uuidtools (2.1.5)
|
335
338
|
varia_model (0.4.1)
|
@@ -340,17 +343,21 @@ GEM
|
|
340
343
|
coercible (~> 1.0)
|
341
344
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
342
345
|
equalizer (~> 0.0, >= 0.0.9)
|
343
|
-
webmock (1.24.
|
346
|
+
webmock (1.24.2)
|
344
347
|
addressable (>= 2.3.6)
|
345
348
|
crack (>= 0.3.2)
|
346
349
|
hashdiff
|
347
350
|
websocket-driver (0.6.3)
|
348
351
|
websocket-extensions (>= 0.1.0)
|
349
352
|
websocket-extensions (0.1.2)
|
353
|
+
win32-process (0.8.3)
|
354
|
+
ffi (>= 1.0.0)
|
355
|
+
wmi-lite (1.0.0)
|
350
356
|
yard (0.8.7.6)
|
351
357
|
|
352
358
|
PLATFORMS
|
353
359
|
ruby
|
360
|
+
x86-mingw32
|
354
361
|
|
355
362
|
DEPENDENCIES
|
356
363
|
aruba (~> 0.10.0)
|
data/berkshelf.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.required_rubygems_version = '>= 1.8.0'
|
32
32
|
|
33
33
|
s.add_dependency 'addressable', '~> 2.3', '>= 2.3.4'
|
34
|
-
s.add_dependency 'berkshelf-api-client', '~> 2.0'
|
34
|
+
s.add_dependency 'berkshelf-api-client', '~> 2.0', '>= 2.0.2'
|
35
35
|
s.add_dependency 'buff-config', '~> 1.0'
|
36
36
|
s.add_dependency 'buff-extensions', '~> 1.0'
|
37
37
|
s.add_dependency 'buff-shell_out', '~> 0.1'
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.add_dependency 'httpclient', '~> 2.7'
|
41
41
|
s.add_dependency 'minitar', '~> 0.5', '>= 0.5.4'
|
42
42
|
s.add_dependency 'retryable', '~> 2.0'
|
43
|
-
s.add_dependency 'ridley', '~> 4.
|
43
|
+
s.add_dependency 'ridley', '~> 4.5'
|
44
44
|
s.add_dependency 'solve', '~> 2.0'
|
45
45
|
s.add_dependency 'thor', '~> 0.19'
|
46
46
|
s.add_dependency 'octokit', '~> 4.0'
|
@@ -58,5 +58,4 @@ Gem::Specification.new do |s|
|
|
58
58
|
s.add_development_dependency 'webmock', '~> 1.11'
|
59
59
|
s.add_development_dependency 'yard', '~> 0.8'
|
60
60
|
s.add_development_dependency 'http', '~> 0.9', '>= 0.9.8'
|
61
|
-
s.add_development_dependency 'github_changelog_generator', '1.11.3'
|
62
61
|
end
|
@@ -487,11 +487,7 @@ Feature: berks install
|
|
487
487
|
cookbook "doesntexist", git: "git://github.com/asdjhfkljashflkjashfakljsf"
|
488
488
|
"""
|
489
489
|
When I run `berks install`
|
490
|
-
Then the
|
491
|
-
"""
|
492
|
-
Repository not found.
|
493
|
-
"""
|
494
|
-
And the exit status should be "GitError"
|
490
|
+
Then the exit status should be "GitError"
|
495
491
|
|
496
492
|
Scenario: transitive dependencies in metadata
|
497
493
|
Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
@@ -18,7 +18,7 @@ Feature: --format json
|
|
18
18
|
{
|
19
19
|
"cookbooks": [
|
20
20
|
{
|
21
|
-
"api_source": "http://0.0.0.0:26210",
|
21
|
+
"api_source": "http://0.0.0.0:26210/",
|
22
22
|
"location_path": "http://localhost:26310/",
|
23
23
|
"version": "1.0.0",
|
24
24
|
"name": "berkshelf"
|
@@ -149,7 +149,7 @@ Feature: --format json
|
|
149
149
|
{
|
150
150
|
"local": "0.1.0",
|
151
151
|
"remote": {
|
152
|
-
"http://0.0.0.0:26210": "0.2.9"
|
152
|
+
"http://0.0.0.0:26210/": "0.2.9"
|
153
153
|
},
|
154
154
|
"name": "seth"
|
155
155
|
}
|
data/lib/berkshelf/source.rb
CHANGED
@@ -5,15 +5,42 @@ module Berkshelf
|
|
5
5
|
include Comparable
|
6
6
|
|
7
7
|
# @return [Berkshelf::SourceURI]
|
8
|
-
|
8
|
+
attr_accessor :uri
|
9
|
+
|
10
|
+
# @return [Berkshelf::APIClient]
|
11
|
+
attr_accessor :api_client
|
12
|
+
|
13
|
+
attr_accessor :source
|
9
14
|
|
10
15
|
# @param [String, Berkshelf::SourceURI] uri
|
11
|
-
def initialize(
|
12
|
-
@
|
13
|
-
@api_client = APIClient.new(uri, ssl: {verify: Berkshelf::Config.instance.ssl.verify})
|
16
|
+
def initialize(source)
|
17
|
+
@source = source
|
14
18
|
@universe = nil
|
15
19
|
end
|
16
20
|
|
21
|
+
def api_client
|
22
|
+
@api_client ||= begin
|
23
|
+
if source == :chef_server
|
24
|
+
APIClient.chef_server(
|
25
|
+
ssl: {verify: Berkshelf::Config.instance.ssl.verify},
|
26
|
+
client_name: Berkshelf::Config.instance.chef.node_name,
|
27
|
+
server_url: Berkshelf::Config.instance.chef.chef_server_url,
|
28
|
+
client_key: Berkshelf::Config.instance.chef.client_key,
|
29
|
+
)
|
30
|
+
else
|
31
|
+
APIClient.new(uri, ssl: {verify: Berkshelf::Config.instance.ssl.verify})
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def uri
|
37
|
+
@uri ||= if source == :chef_server
|
38
|
+
SourceURI.parse(Berkshelf::Config.instance.chef.chef_server_url)
|
39
|
+
else
|
40
|
+
SourceURI.parse(source)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
17
44
|
# Forcefully obtain the universe from the API endpoint and assign it to {#universe}. This
|
18
45
|
# will reload the value of {#universe} even if it has been loaded before.
|
19
46
|
#
|
@@ -53,7 +80,7 @@ module Berkshelf
|
|
53
80
|
universe
|
54
81
|
.select { |cookbook| cookbook.name =~ Regexp.new(name) }
|
55
82
|
.group_by(&:name)
|
56
|
-
.collect { |
|
83
|
+
.collect { |_, versions| versions.max_by { |v| Semverse::Version.new(v.version) } }
|
57
84
|
end
|
58
85
|
|
59
86
|
# Determine if this source is a "default" source, as defined in the
|
@@ -62,7 +89,7 @@ module Berkshelf
|
|
62
89
|
# @return [true, false]
|
63
90
|
# true if this a default source, false otherwise
|
64
91
|
def default?
|
65
|
-
@default_ ||=
|
92
|
+
@default_ ||= uri.host == URI.parse(Berksfile::DEFAULT_API_URL).host
|
66
93
|
end
|
67
94
|
|
68
95
|
# @param [String] name
|
@@ -96,9 +123,5 @@ module Berkshelf
|
|
96
123
|
uri == other.uri
|
97
124
|
end
|
98
125
|
|
99
|
-
private
|
100
|
-
|
101
|
-
# @return [Berkshelf::APIClient]
|
102
|
-
attr_reader :api_client
|
103
126
|
end
|
104
127
|
end
|
data/lib/berkshelf/version.rb
CHANGED
@@ -163,7 +163,7 @@ describe Berkshelf::Berksfile do
|
|
163
163
|
let(:invalid_uri) { ".....$1233...." }
|
164
164
|
|
165
165
|
it "raises an InvalidSourceURI" do
|
166
|
-
expect { subject.source(invalid_uri) }.to raise_error(Berkshelf::InvalidSourceURI)
|
166
|
+
expect { subject.source(invalid_uri).uri }.to raise_error(Berkshelf::InvalidSourceURI)
|
167
167
|
end
|
168
168
|
end
|
169
169
|
end
|
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: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-
|
15
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|
@@ -41,6 +41,9 @@ dependencies:
|
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '2.0'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.0.2
|
44
47
|
type: :runtime
|
45
48
|
prerelease: false
|
46
49
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -48,6 +51,9 @@ dependencies:
|
|
48
51
|
- - "~>"
|
49
52
|
- !ruby/object:Gem::Version
|
50
53
|
version: '2.0'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.0.2
|
51
57
|
- !ruby/object:Gem::Dependency
|
52
58
|
name: buff-config
|
53
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,20 +178,14 @@ dependencies:
|
|
172
178
|
requirements:
|
173
179
|
- - "~>"
|
174
180
|
- !ruby/object:Gem::Version
|
175
|
-
version: '4.
|
176
|
-
- - ">="
|
177
|
-
- !ruby/object:Gem::Version
|
178
|
-
version: 4.4.3
|
181
|
+
version: '4.5'
|
179
182
|
type: :runtime
|
180
183
|
prerelease: false
|
181
184
|
version_requirements: !ruby/object:Gem::Requirement
|
182
185
|
requirements:
|
183
186
|
- - "~>"
|
184
187
|
- !ruby/object:Gem::Version
|
185
|
-
version: '4.
|
186
|
-
- - ">="
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
version: 4.4.3
|
188
|
+
version: '4.5'
|
189
189
|
- !ruby/object:Gem::Dependency
|
190
190
|
name: solve
|
191
191
|
requirement: !ruby/object:Gem::Requirement
|
@@ -416,20 +416,6 @@ dependencies:
|
|
416
416
|
- - ">="
|
417
417
|
- !ruby/object:Gem::Version
|
418
418
|
version: 0.9.8
|
419
|
-
- !ruby/object:Gem::Dependency
|
420
|
-
name: github_changelog_generator
|
421
|
-
requirement: !ruby/object:Gem::Requirement
|
422
|
-
requirements:
|
423
|
-
- - '='
|
424
|
-
- !ruby/object:Gem::Version
|
425
|
-
version: 1.11.3
|
426
|
-
type: :development
|
427
|
-
prerelease: false
|
428
|
-
version_requirements: !ruby/object:Gem::Requirement
|
429
|
-
requirements:
|
430
|
-
- - '='
|
431
|
-
- !ruby/object:Gem::Version
|
432
|
-
version: 1.11.3
|
433
419
|
description: Manages a Cookbook's, or an Application's, Cookbook dependencies
|
434
420
|
email:
|
435
421
|
- jamie@vialstudios.com
|
@@ -649,7 +635,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
649
635
|
version: 1.8.0
|
650
636
|
requirements: []
|
651
637
|
rubyforge_project:
|
652
|
-
rubygems_version: 2.5.
|
638
|
+
rubygems_version: 2.4.5.1
|
653
639
|
signing_key:
|
654
640
|
specification_version: 4
|
655
641
|
summary: Manages a Cookbook's, or an Application's, Cookbook dependencies
|