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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 337dda20878f2853b12de31de35dc8494dd7db0f
4
- data.tar.gz: 64cac8f89b420097552be7c5f85bd1b497b250f5
3
+ metadata.gz: 50266e6e9de8493037de29ba7ef6a9322559ea4c
4
+ data.tar.gz: 5478e43f008f09d92faa9b9fbea8997a5f0f6c46
5
5
  SHA512:
6
- metadata.gz: f63ff185f5d45c161e6e86e82001097d439d53c0eef3c0f8643f9038a5824fa83a90017b52890d66c17e03cea5a5653fc575491b305d65f32339179ed5e8b462
7
- data.tar.gz: 67d89ec5fb953f45ffc7560cf204e3b42a1d7ed1f3d62d97e3b5d767f05a03f1bbd7acbb870c098b016ade7668d284446dfbd65abd6ee5c87e7521d5c631db8e
6
+ metadata.gz: bd54e2d87eda3052068b1832a7e2a4d00b3ed6b14b77272c661d3efb41abd374edba51a842b69a100d231b4a576afc8d55eae3996b9db81eea7f2c4a5e7366e7
7
+ data.tar.gz: aa4742f2622fb655f44d08428ab2cc6705b61a94f33ab06bc4444710dc0f31a6d51de185c0bbfc8635ca024eaf8c80a321b6eb22966d34d57900bd95d9269aff
@@ -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
@@ -31,5 +31,5 @@ group :guard do
31
31
  end
32
32
 
33
33
  group :test do
34
- gem "berkshelf-api", github: "berkshelf/berkshelf-api"
34
+ gem "berkshelf-api", git: "https://github.com/berkshelf/berkshelf-api.git"
35
35
  end
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](http://chef.io/downloads/chef-dk). This is fastest, easiest, and the recommended installation method for getting up and running with Berkshelf.
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
 
@@ -11,6 +11,6 @@ Feature: berks search
11
11
  * the output should contain:
12
12
  """
13
13
  berkshelf-api (1.2.2)
14
- berkshelf-api-server (2.1.0)
14
+ berkshelf-api-server (2.1.1)
15
15
  berkshelf-cookbook-fixture (1.0.0)
16
16
  """
@@ -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
@@ -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"
@@ -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(&:version) }
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
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "3.2.3"
2
+ VERSION = "3.2.4"
3
3
  end
@@ -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.3
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-01-14 00:00:00.000000000 Z
15
+ date: 2015-04-30 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: addressable