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 +4 -4
- data/CHANGELOG.md +8 -2
- data/features/commands/search.feature +1 -1
- data/generator_files/CHANGELOG.md.erb +0 -6
- data/generator_files/Gemfile.erb +1 -1
- data/generator_files/README.md.erb +0 -9
- data/lib/berkshelf/community_rest.rb +1 -1
- data/lib/berkshelf/cookbook_generator.rb +12 -8
- data/lib/berkshelf/downloader.rb +1 -1
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/downloader_spec.rb +29 -1
- 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: 0b9ee0bbcbb69dc7f55aaf3ca127f9dbd3b2dafc
|
4
|
+
data.tar.gz: 71e33ba4b6f966b65c8531cb01dc901e7abceeb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd70423af3cc72518f759619d2ed4706299a95626915cb45f312390cfadbdda46629ef0c5c106bbd2c919fd4f3369f5b82ee6a7801460d18765595951e20d287
|
7
|
+
data.tar.gz: c88ac3755f5f54469e2af5af73ec09b03d360045990daf7bf99a9badf2be0db3b16b914f3811a7d4fc597aa5cbf40a9aa0af3d24b679a11440315db9139bc7c0
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
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
|
data/generator_files/Gemfile.erb
CHANGED
@@ -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 %>>)
|
@@ -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
|
-
|
87
|
-
|
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
|
|
data/lib/berkshelf/downloader.rb
CHANGED
@@ -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
|
data/lib/berkshelf/version.rb
CHANGED
@@ -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
|
-
|
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
|
+
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-
|
15
|
+
date: 2014-08-01 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|