berkshelf 3.1.4 → 3.1.5

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: 1c2cbd226c97f7eb03ba011273102912c1ab35c3
4
- data.tar.gz: 41a2609f4d1ea587b37be2e78f9a965408f801c2
3
+ metadata.gz: 0b9ee0bbcbb69dc7f55aaf3ca127f9dbd3b2dafc
4
+ data.tar.gz: 71e33ba4b6f966b65c8531cb01dc901e7abceeb6
5
5
  SHA512:
6
- metadata.gz: f1fb76696aa23da536edce710c03a1da9abe896470ccbed29713c97681f713d5213229804841566b5e5e908c3fc7f2f2465ccf871b36c8f2ced7bdaabd71678e
7
- data.tar.gz: 907002c134b4c2294895dc3889fa32e52d71bb762c0c4298df6b4632e352836e645e5ed4746c8740f47ef9efcfa24be9a7a2a09905737ae4c83e47304d880318
6
+ metadata.gz: cd70423af3cc72518f759619d2ed4706299a95626915cb45f312390cfadbdda46629ef0c5c106bbd2c919fd4f3369f5b82ee6a7801460d18765595951e20d287
7
+ data.tar.gz: c88ac3755f5f54469e2af5af73ec09b03d360045990daf7bf99a9badf2be0db3b16b914f3811a7d4fc597aa5cbf40a9aa0af3d24b679a11440315db9139bc7c0
@@ -1,11 +1,17 @@
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.1.5
4
+
5
+ * Bug Fixes
6
+ * Supermarket endpoint is now an alias for Opscode endpoint
7
+ * Set proper default value for supermarket api endpoint
8
+
3
9
  # 3.1.4
4
10
 
5
11
  * Improvements
6
12
  * Update the default vagrant box from the generators to Ubuntu 14.04 (formerly 12.04 EOL)
7
13
 
8
- * Bug fixes
14
+ * Bug Fixes
9
15
  * Handle the case where a remote source had been removed but still existed in the lockfile
10
16
  * Follow redirects (HTTP -> HTTPS) in all requests
11
17
 
@@ -14,7 +20,7 @@
14
20
  * Enhancements
15
21
  * Updated out of date dependencies
16
22
 
17
- * Bug fixes
23
+ * Bug Fixes
18
24
  * Skip loading of cached cookbooks that do not have a value for metadata
19
25
  * SSL Verify option will be respected when communicating to an API server
20
26
  * Fixed issue where some commands were unexpectedly crashing instead of informing the user that Git is not installed
@@ -11,6 +11,6 @@ Feature: berks search
11
11
  * the output should contain:
12
12
  """
13
13
  berkshelf-api (1.0.0)
14
- berkshelf-api-server (1.4.0)
14
+ berkshelf-api-server (2.0.0)
15
15
  berkshelf-cookbook-fixture (1.0.0)
16
16
  """
@@ -1,9 +1,3 @@
1
1
  # 0.1.0
2
2
 
3
3
  Initial release of <%= name %>
4
-
5
- * Enhancements
6
- * an enhancement
7
-
8
- * Bug Fixes
9
- * a bug fix
@@ -6,7 +6,7 @@ gem 'berkshelf'
6
6
  #
7
7
  # group :development do
8
8
  # gem "berkshelf", github: "berkshelf/berkshelf"
9
- # gem "vagrant", github: "mitchellh/vagrant", tag: "v1.5.2"
9
+ # gem "vagrant", github: "mitchellh/vagrant", tag: "v1.6.3"
10
10
  # end
11
11
  #
12
12
  # group :plugins do
@@ -37,15 +37,6 @@ Include `<%= name %>` in your node's `run_list`:
37
37
  }
38
38
  ```
39
39
 
40
- ## Contributing
41
-
42
- 1. Fork the repository on Github
43
- 2. Create a named feature branch (i.e. `add-new-recipe`)
44
- 3. Write your change
45
- 4. Write tests for your change (if applicable)
46
- 5. Run the tests, ensuring they all pass
47
- 6. Submit a Pull Request
48
-
49
40
  ## License and Authors
50
41
 
51
42
  Author:: <%= maintainer %> (<<%= maintainer_email %>>)
@@ -48,7 +48,7 @@ module Berkshelf
48
48
  end
49
49
  end
50
50
 
51
- V1_API = 'https://cookbooks.opscode.com/api/v1'.freeze
51
+ V1_API = 'https://supermarket.getchef.com'.freeze
52
52
 
53
53
  # @return [String]
54
54
  attr_reader :api_uri
@@ -2,6 +2,16 @@ module Berkshelf
2
2
  class CookbookGenerator < BaseGenerator
3
3
  require_relative 'config'
4
4
 
5
+ LICENSE_MAP = {
6
+ "apachev2" => "Apache 2.0",
7
+ "gplv2" => "GNU Public License 2.0",
8
+ "gplv3" => "GNU Public License 3.0",
9
+ "mit" => "MIT",
10
+ "reserved" => "All rights reserved",
11
+ }.freeze
12
+
13
+ (LICENSES = LICENSE_MAP.keys).freeze
14
+
5
15
  argument :name,
6
16
  type: :string,
7
17
  required: true
@@ -83,14 +93,8 @@ module Berkshelf
83
93
  end
84
94
 
85
95
  def license_name
86
- case options[:license]
87
- when 'apachev2'; 'Apache 2.0'
88
- when 'gplv2'; 'GNU Public License 2.0'
89
- when 'gplv3'; 'GNU Public License 3.0'
90
- when 'mit'; 'MIT'
91
- when 'reserved'; 'All rights reserved'
92
- else
93
- raise Berkshelf::LicenseNotFound.new(options[:license])
96
+ LICENSE_MAP.fetch(options[:license]) do |license|
97
+ raise Berkshelf::LicenseNotFound.new(license)
94
98
  end
95
99
  end
96
100
 
@@ -49,7 +49,7 @@ module Berkshelf
49
49
  end
50
50
 
51
51
  case remote_cookbook.location_type
52
- when :opscode
52
+ when :opscode, :supermarket
53
53
  CommunityREST.new(remote_cookbook.location_path).download(name, version)
54
54
  when :chef_server
55
55
  # @todo Dynamically get credentials for remote_cookbook.location_path
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "3.1.4"
2
+ VERSION = "3.1.5"
3
3
  end
@@ -1,11 +1,39 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Berkshelf::Downloader do
4
+ let(:berksfile) { double('berksfile') }
5
+ subject { described_class.new(berksfile) }
6
+
4
7
  describe "#download" do
5
8
  pending
6
9
  end
7
10
 
8
11
  describe "#try_download" do
9
- pending
12
+ let(:remote_cookbook) { double('remote-cookbook') }
13
+ let(:source) do
14
+ source = double('source')
15
+ allow(source).to receive(:cookbook) { remote_cookbook }
16
+ source
17
+ end
18
+ let(:name) { "fake" }
19
+ let(:version) { "1.0.0" }
20
+
21
+ it "supports the 'opscode' location type" do
22
+ allow(remote_cookbook).to receive(:location_type) { :opscode }
23
+ allow(remote_cookbook).to receive(:location_path) { "http://api.opscode.com" }
24
+ rest = double('community-rest')
25
+ expect(Berkshelf::CommunityREST).to receive(:new).with("http://api.opscode.com") { rest }
26
+ expect(rest).to receive(:download).with(name, version)
27
+ subject.try_download(source, name, version)
28
+ end
29
+
30
+ it "supports the 'supermarket' location type" do
31
+ allow(remote_cookbook).to receive(:location_type) { :supermarket }
32
+ allow(remote_cookbook).to receive(:location_path) { "http://api.supermarket.com" }
33
+ rest = double('community-rest')
34
+ expect(Berkshelf::CommunityREST).to receive(:new).with("http://api.supermarket.com") { rest }
35
+ expect(rest).to receive(:download).with(name, version)
36
+ subject.try_download(source, name, version)
37
+ end
10
38
  end
11
39
  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.1.4
4
+ version: 3.1.5
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-07-14 00:00:00.000000000 Z
15
+ date: 2014-08-01 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: addressable