berkshelf 3.2.3 → 3.2.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/features/commands/search.feature +1 -1
- data/lib/berkshelf/berksfile.rb +1 -1
- data/lib/berkshelf/community_rest.rb +10 -1
- data/lib/berkshelf/downloader.rb +2 -2
- data/lib/berkshelf/source.rb +1 -1
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/source_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50266e6e9de8493037de29ba7ef6a9322559ea4c
|
4
|
+
data.tar.gz: 5478e43f008f09d92faa9b9fbea8997a5f0f6c46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd54e2d87eda3052068b1832a7e2a4d00b3ed6b14b77272c661d3efb41abd374edba51a842b69a100d231b4a576afc8d55eae3996b9db81eea7f2c4a5e7366e7
|
7
|
+
data.tar.gz: aa4742f2622fb655f44d08428ab2cc6705b61a94f33ab06bc4444710dc0f31a6d51de185c0bbfc8635ca024eaf8c80a321b6eb22966d34d57900bd95d9269aff
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
> This is a high level digest of changes. For the complete CHANGELOG diff two tags in the project's [commit history](https://github.com/berkshelf/berkshelf/commits/master).
|
2
2
|
|
3
|
+
# 3.2.4
|
4
|
+
|
5
|
+
* Bug Fixes
|
6
|
+
* Fix issue where older version of a cookbook would be presented as the latest available version from a remote API server's cache
|
7
|
+
* Exclude git directories when vendoring
|
8
|
+
* Fix a race condition in downloading cookbooks from Github or a URI location
|
9
|
+
|
3
10
|
# 3.2.3
|
4
11
|
|
5
12
|
* Bug Fixes
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Manage a Cookbook or an Application's Cookbook dependencies
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
Berkshelf is now included as part of the [Chef-DK](
|
12
|
+
Berkshelf is now included as part of the [Chef-DK](https://downloads.chef.io/chef-dk/). This is fastest, easiest, and the recommended installation method for getting up and running with Berkshelf.
|
13
13
|
|
14
14
|
> note: You may need to uninstall the Berkshelf gem especially if you are using a Ruby version manager you may need to uninstall all Berkshelf gems from each Ruby installation.
|
15
15
|
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -31,7 +31,7 @@ module Berkshelf
|
|
31
31
|
|
32
32
|
# Don't vendor VCS files.
|
33
33
|
# Reference GNU tar --exclude-vcs: https://www.gnu.org/software/tar/manual/html_section/tar_49.html
|
34
|
-
EXCLUDED_VCS_FILES_WHEN_VENDORING = ['.arch-ids', '{arch}', '.bzr', '.bzrignore', '.bzrtags', 'CVS', '.cvsignore', '_darcs', '.git', '.hg', '.hgignore', '.hgrags', 'RCS', 'SCCS', '.svn'].freeze
|
34
|
+
EXCLUDED_VCS_FILES_WHEN_VENDORING = ['.arch-ids', '{arch}', '.bzr', '.bzrignore', '.bzrtags', 'CVS', '.cvsignore', '_darcs', '.git', '.hg', '.hgignore', '.hgrags', 'RCS', 'SCCS', '.svn', '**/.git'].freeze
|
35
35
|
|
36
36
|
include Mixin::Logging
|
37
37
|
include Cleanroom
|
@@ -69,7 +69,7 @@ module Berkshelf
|
|
69
69
|
# @option options [Float] :retry_interval (0.5)
|
70
70
|
# how often we should pause between retries
|
71
71
|
def initialize(uri = V1_API, options = {})
|
72
|
-
options = options.reverse_merge(retries: 5, retry_interval: 0.5)
|
72
|
+
options = options.reverse_merge(retries: 5, retry_interval: 0.5, ssl: { verify: Berkshelf::Config.instance.ssl.verify })
|
73
73
|
@api_uri = uri
|
74
74
|
@retries = options.delete(:retries)
|
75
75
|
@retry_interval = options.delete(:retry_interval)
|
@@ -199,6 +199,7 @@ module Berkshelf
|
|
199
199
|
options = {}
|
200
200
|
options.merge!(headers)
|
201
201
|
options.merge!(open_uri_proxy_options)
|
202
|
+
options.merge!(ssl_verify_mode: ssl_verify_mode)
|
202
203
|
end
|
203
204
|
|
204
205
|
def open_uri_proxy_options
|
@@ -208,5 +209,13 @@ module Berkshelf
|
|
208
209
|
{}
|
209
210
|
end
|
210
211
|
end
|
212
|
+
|
213
|
+
def ssl_verify_mode
|
214
|
+
if Berkshelf::Config.instance.ssl.verify.nil? || Berkshelf::Config.instance.ssl.verify
|
215
|
+
OpenSSL::SSL::VERIFY_PEER
|
216
|
+
else
|
217
|
+
OpenSSL::SSL::VERIFY_NONE
|
218
|
+
end
|
219
|
+
end
|
211
220
|
end
|
212
221
|
end
|
data/lib/berkshelf/downloader.rb
CHANGED
@@ -75,7 +75,7 @@ module Berkshelf
|
|
75
75
|
Celluloid.logger = nil unless ENV["DEBUG_CELLULOID"]
|
76
76
|
Ridley.open(credentials) { |r| r.cookbook.download(name, version) }
|
77
77
|
when :github
|
78
|
-
require 'octokit' unless defined?(Octokit)
|
78
|
+
Thread.exclusive { require 'octokit' unless defined?(Octokit) }
|
79
79
|
|
80
80
|
tmp_dir = Dir.mktmpdir
|
81
81
|
archive_path = File.join(tmp_dir, "#{name}-#{version}.tar.gz")
|
@@ -119,7 +119,7 @@ module Berkshelf
|
|
119
119
|
|
120
120
|
File.join(unpack_dir, cookbook_directory)
|
121
121
|
when :uri
|
122
|
-
require 'open-uri' unless defined?(OpenURI)
|
122
|
+
Thread.exclusive { require 'open-uri' unless defined?(OpenURI) }
|
123
123
|
|
124
124
|
tmp_dir = Dir.mktmpdir
|
125
125
|
archive_path = Pathname.new(tmp_dir) + "#{name}-#{version}.tar.gz"
|
data/lib/berkshelf/source.rb
CHANGED
@@ -53,7 +53,7 @@ module Berkshelf
|
|
53
53
|
universe
|
54
54
|
.select { |cookbook| cookbook.name =~ Regexp.new(name) }
|
55
55
|
.group_by(&:name)
|
56
|
-
.collect { |name, versions| versions.max_by(
|
56
|
+
.collect { |name, versions| versions.max_by { |v| Semverse::Version.new(v.version) } }
|
57
57
|
end
|
58
58
|
|
59
59
|
# Determine if this source is a "default" source, as defined in the
|
data/lib/berkshelf/version.rb
CHANGED
@@ -38,5 +38,21 @@ module Berkshelf
|
|
38
38
|
expect(instance).to_not be_default
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
describe "#search" do
|
43
|
+
let (:cookbooks) {[
|
44
|
+
APIClient::RemoteCookbook.new("cb1","1.0.8"),
|
45
|
+
APIClient::RemoteCookbook.new("cb1","1.0.22")
|
46
|
+
]}
|
47
|
+
|
48
|
+
before do
|
49
|
+
allow_any_instance_of(APIClient::Connection).to receive(:universe).and_return(cookbooks)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "returns the latest version" do
|
53
|
+
instance = described_class.new(Berksfile::DEFAULT_API_URL)
|
54
|
+
expect(instance.search("cb1")).to eq [cookbooks[1]]
|
55
|
+
end
|
56
|
+
end
|
41
57
|
end
|
42
58
|
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: 3.2.
|
4
|
+
version: 3.2.4
|
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: 2015-
|
15
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|