berkshelf 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/berkshelf.gemspec +1 -1
- data/features/commands/outdated.feature +2 -2
- data/features/json_formatter.feature +4 -9
- data/lib/berkshelf/berksfile.rb +17 -13
- data/lib/berkshelf/cli.rb +0 -7
- data/lib/berkshelf/formatters/human.rb +14 -6
- data/lib/berkshelf/formatters/json.rb +7 -5
- data/lib/berkshelf/source.rb +8 -0
- data/lib/berkshelf/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4cf647b41dbb16847bda378125caeca33f742be
|
4
|
+
data.tar.gz: 09fde5aa92aa7142ed6654d67c707877e136efd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dedd78fd2dc5890ceb8cb7319e84d91a1203f00fd698c8a77712dba2bf044026649ab814909a7f684f0defaf60054f70f5577322e866d918694f6971e232cdc
|
7
|
+
data.tar.gz: 82e54f6a02f0c0e6d5b7f5f63c84e09864b8d9ea2e9d12f08460cb2ccfcd5c769d1807bf6f91f377d9f7ce4bee1c7baf6f314d253fe0e002901131ae0923f231
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 3.1.1
|
2
|
+
|
3
|
+
* Bug Fixes
|
4
|
+
* Fix issue reading metadata which was compiled using an older (bugged) version of Knife
|
5
|
+
* Fix issue with incorrectly reporting outdated cookbooks with the outdated command
|
6
|
+
* Fix issue uploading some cookbooks which were generated with older metadata
|
7
|
+
|
1
8
|
# 3.1.0
|
2
9
|
|
3
10
|
* Enhancements
|
data/berkshelf.gemspec
CHANGED
@@ -38,7 +38,7 @@ 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.
|
41
|
+
s.add_dependency 'ridley', '~> 3.1'
|
42
42
|
s.add_dependency 'solve', '~> 1.1'
|
43
43
|
s.add_dependency 'thor', '~> 0.18'
|
44
44
|
s.add_dependency 'octokit', '~> 3.0'
|
@@ -48,7 +48,7 @@ Feature: berks outdated
|
|
48
48
|
Then the output should contain:
|
49
49
|
"""
|
50
50
|
The following cookbooks have newer versions:
|
51
|
-
* bacon (1.1.0)
|
51
|
+
* bacon (1.0.0 => 1.1.0)
|
52
52
|
"""
|
53
53
|
|
54
54
|
Scenario: the dependency has a version constraint and there are new items that satisfy it
|
@@ -75,7 +75,7 @@ Feature: berks outdated
|
|
75
75
|
Then the output should contain:
|
76
76
|
"""
|
77
77
|
The following cookbooks have newer versions:
|
78
|
-
* bacon (1.5.8)
|
78
|
+
* bacon (1.0.0 => 1.5.8)
|
79
79
|
"""
|
80
80
|
|
81
81
|
Scenario: When the lockfile is not present
|
@@ -147,20 +147,15 @@ Feature: --format json
|
|
147
147
|
{
|
148
148
|
"cookbooks": [
|
149
149
|
{
|
150
|
-
"
|
151
|
-
"
|
152
|
-
"http://0.0.0.0:26210":
|
153
|
-
"name": "seth",
|
154
|
-
"version": "0.2.9"
|
155
|
-
}
|
150
|
+
"local": "0.1.0",
|
151
|
+
"remote": {
|
152
|
+
"http://0.0.0.0:26210": "0.2.9"
|
156
153
|
},
|
157
154
|
"name": "seth"
|
158
155
|
}
|
159
156
|
],
|
160
157
|
"errors": [],
|
161
|
-
"messages": [
|
162
|
-
"The following cookbooks have newer versions:"
|
163
|
-
],
|
158
|
+
"messages": [],
|
164
159
|
"warnings": []
|
165
160
|
}
|
166
161
|
"""
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -435,12 +435,19 @@ module Berkshelf
|
|
435
435
|
# that satisfies the constraints of your dependencies.
|
436
436
|
#
|
437
437
|
# @return [Hash]
|
438
|
-
# a hash of cached cookbooks and their latest version
|
439
|
-
#
|
438
|
+
# a hash of cached cookbooks and their latest version grouped by their
|
439
|
+
# remote API source. The hash will be empty if there are no newer
|
440
|
+
# cookbooks for any of your dependencies (that still satisfy the given)
|
441
|
+
# constraints in the +Berksfile+.
|
440
442
|
#
|
441
443
|
# @example
|
442
444
|
# berksfile.outdated #=> {
|
443
|
-
#
|
445
|
+
# "nginx" => {
|
446
|
+
# "local" => #<Version 1.8.0>,
|
447
|
+
# "remote" => {
|
448
|
+
# #<Source uri: "https://api.berkshelf.com"> #=> #<Version 2.6.2>
|
449
|
+
# }
|
450
|
+
# }
|
444
451
|
# }
|
445
452
|
def outdated(*names)
|
446
453
|
validate_lockfile_present!
|
@@ -448,25 +455,22 @@ module Berkshelf
|
|
448
455
|
validate_dependencies_installed!
|
449
456
|
validate_cookbook_names!(names)
|
450
457
|
|
451
|
-
# Calculate the list of cookbooks to unlock
|
452
|
-
if names.empty?
|
453
|
-
list = dependencies
|
454
|
-
else
|
455
|
-
list = dependencies.select { |dependency| names.include?(dependency.name) }
|
456
|
-
end
|
457
|
-
|
458
458
|
lockfile.graph.locks.inject({}) do |hash, (name, dependency)|
|
459
459
|
sources.each do |source|
|
460
460
|
cookbooks = source.versions(name)
|
461
461
|
|
462
462
|
latest = cookbooks.select do |cookbook|
|
463
463
|
dependency.version_constraint.satisfies?(cookbook.version) &&
|
464
|
-
cookbook.version
|
464
|
+
Semverse::Version.coerce(cookbook.version) > dependency.locked_version
|
465
465
|
end.sort_by { |cookbook| cookbook.version }.last
|
466
466
|
|
467
467
|
unless latest.nil?
|
468
|
-
hash[name] ||= {
|
469
|
-
|
468
|
+
hash[name] ||= {
|
469
|
+
'local' => dependency.locked_version,
|
470
|
+
'remote' => {
|
471
|
+
source => Semverse::Version.coerce(latest.version)
|
472
|
+
}
|
473
|
+
}
|
470
474
|
end
|
471
475
|
end
|
472
476
|
|
data/lib/berkshelf/cli.rb
CHANGED
@@ -248,13 +248,6 @@ module Berkshelf
|
|
248
248
|
def outdated(*names)
|
249
249
|
berksfile = Berksfile.from_options(options)
|
250
250
|
outdated = berksfile.outdated(*names)
|
251
|
-
|
252
|
-
if outdated.empty?
|
253
|
-
Berkshelf.formatter.msg "All cookbooks up to date!"
|
254
|
-
else
|
255
|
-
Berkshelf.formatter.msg "The following cookbooks have newer versions:"
|
256
|
-
end
|
257
|
-
|
258
251
|
Berkshelf.formatter.outdated(outdated)
|
259
252
|
end
|
260
253
|
|
@@ -59,13 +59,21 @@ module Berkshelf
|
|
59
59
|
# the list of outdated cookbooks in the format
|
60
60
|
# { 'cookbook' => { 'api.berkshelf.com' => #<Cookbook> } }
|
61
61
|
def outdated(hash)
|
62
|
-
hash.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
if hash.empty?
|
63
|
+
Berkshelf.ui.info('All cookbooks up to date!')
|
64
|
+
else
|
65
|
+
Berkshelf.ui.info('The following cookbooks have newer versions:')
|
66
|
+
|
67
|
+
hash.each do |name, info|
|
68
|
+
info['remote'].each do |remote_source, remote_version|
|
69
|
+
out = " * #{name} (#{info['local']} => #{remote_version})"
|
70
|
+
|
71
|
+
unless remote_source.default?
|
72
|
+
out << " [#{remote_source.uri}]"
|
73
|
+
end
|
74
|
+
|
75
|
+
Berkshelf.ui.info(out)
|
67
76
|
end
|
68
|
-
Berkshelf.ui.info string
|
69
77
|
end
|
70
78
|
end
|
71
79
|
end
|
@@ -91,12 +91,14 @@ module Berkshelf
|
|
91
91
|
# the list of outdated cookbooks in the format
|
92
92
|
# { 'cookbook' => { 'api.berkshelf.com' => #<Cookbook> } }
|
93
93
|
def outdated(hash)
|
94
|
-
hash.
|
95
|
-
|
94
|
+
hash.each do |name, info|
|
95
|
+
info['remote'].each do |remote_source, remote_version|
|
96
|
+
source = remote_source.uri.to_s
|
97
|
+
|
96
98
|
cookbooks[name] ||= {}
|
97
|
-
cookbooks[name][:
|
98
|
-
cookbooks[name][:
|
99
|
-
cookbooks[name][:
|
99
|
+
cookbooks[name][:local] = info['local'].to_s
|
100
|
+
cookbooks[name][:remote] ||= {}
|
101
|
+
cookbooks[name][:remote][source] = remote_version.to_s
|
100
102
|
end
|
101
103
|
end
|
102
104
|
end
|
data/lib/berkshelf/source.rb
CHANGED
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: 3.1.
|
4
|
+
version: 3.1.1
|
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: 2014-04-
|
15
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|
@@ -132,14 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: '3.
|
135
|
+
version: '3.1'
|
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.
|
142
|
+
version: '3.1'
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: solve
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|