berkshelf 7.0.4 → 7.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/CHANGELOG.md +15 -0
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +50 -44
  6. data/features/support/env.rb +2 -2
  7. data/lib/berkshelf/api_client/connection.rb +1 -1
  8. data/lib/berkshelf/api_client/version.rb +1 -1
  9. data/lib/berkshelf/berksfile.rb +2 -2
  10. data/lib/berkshelf/config.rb +15 -7
  11. data/lib/berkshelf/core_ext/file_utils.rb +1 -1
  12. data/lib/berkshelf/downloader.rb +1 -1
  13. data/lib/berkshelf/locations/github.rb +1 -1
  14. data/lib/berkshelf/ridley_compat.rb +8 -0
  15. data/lib/berkshelf/version.rb +1 -1
  16. data/spec/config/knife.rb +1 -1
  17. data/spec/unit/berkshelf/berksfile_spec.rb +1 -1
  18. data/spec/unit/berkshelf/berkshelf/api_client/connection_spec.rb +4 -4
  19. data/spec/unit/berkshelf/config_spec.rb +1 -14
  20. data/spec/unit/berkshelf/file_syncer_spec.rb +1 -1
  21. data/spec/unit/berkshelf/ridley_compat_spec.rb +16 -0
  22. metadata +4 -19
  23. data/generator_files/Berksfile.erb +0 -11
  24. data/generator_files/CHANGELOG.md.erb +0 -3
  25. data/generator_files/Gemfile.erb +0 -8
  26. data/generator_files/README.md.erb +0 -42
  27. data/generator_files/Thorfile.erb +0 -11
  28. data/generator_files/Vagrantfile.erb +0 -117
  29. data/generator_files/chefignore +0 -94
  30. data/generator_files/default_recipe.erb +0 -6
  31. data/generator_files/default_test.rb.erb +0 -11
  32. data/generator_files/gitignore.erb +0 -23
  33. data/generator_files/helpers.rb.erb +0 -7
  34. data/generator_files/licenses/apachev2.erb +0 -13
  35. data/generator_files/licenses/gplv2.erb +0 -15
  36. data/generator_files/licenses/gplv3.erb +0 -14
  37. data/generator_files/licenses/mit.erb +0 -20
  38. data/generator_files/licenses/reserved.erb +0 -3
  39. data/generator_files/metadata.rb.erb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a9aad824018ff76341d429a3f3d1a56a3a20baa0a47353b71214103dd0b82db
4
- data.tar.gz: e99375d510d02668eeb7734aad0dacc173aadd0b8751f0bcea2d6f23821da4b0
3
+ metadata.gz: a4fbbe4a556c48c3ed25b98b1cf0dd3088d942f2a7e1d559b55fbadc73ddfa33
4
+ data.tar.gz: 293fc6d34c5802174f8643fa814c65870654cf224f5fe26b3b21ca014d8d3937
5
5
  SHA512:
6
- metadata.gz: 86965767066caf25df3b87b33d17968d7dde55bf34613d5748fecebba7f00ac36bd0b0c1217f02342435f6c3e6106f9bd019bf687823aac9107ffc6c8e420e85
7
- data.tar.gz: 65f4eb23956d447c36eb2fb90b8d96bd89ab39352f1478bed5ff4969479a4b6781a1943009439e5b41c5ea5631dc81fbb44a5ad1c2b10c0fdcd8d18bbc92fb69
6
+ metadata.gz: 6a426d00f6b0dbeff9b8120fe7a857736ffe2381dbc41b8df90572174661786fbb058000935e7355208c00ff7bfad8d962e29e5bbe978f0219154b284579123b
7
+ data.tar.gz: e2e7723963c41c211360ef3dab9b210e0078c6e3fc0ca2480010dc3a818c7454c7d2560ab98d88f5e1f6703d1f4ea09de4e63896a624b744769aa6dd902bd3c4
@@ -8,3 +8,5 @@ Lint/AmbiguousRegexpLiteral:
8
8
  Enabled: false
9
9
  Lint/AmbiguousBlockAssociation:
10
10
  Enabled: false
11
+ Style/HashSyntax:
12
+ Enabled: true
@@ -1,5 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ## [v7.0.4](https://github.com/berkshelf/berkshelf/tree/v7.0.4) (2018-06-08)
4
+ [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v7.0.3...v7.0.4)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Fix infinite loops in resolving cookbooks in the uploader [\#1781](https://github.com/berkshelf/berkshelf/pull/1781) ([lamont-granquist](https://github.com/lamont-granquist))
9
+
10
+ ## [v7.0.3](https://github.com/berkshelf/berkshelf/tree/v7.0.3) (2018-06-06)
11
+ [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v7.0.2...v7.0.3)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - stringify client\_key option before trying to match on it [\#1779](https://github.com/berkshelf/berkshelf/pull/1779) ([dbresson](https://github.com/dbresson))
16
+ - Provide the name during debug [\#1777](https://github.com/berkshelf/berkshelf/pull/1777) ([martinisoft](https://github.com/martinisoft))
17
+
3
18
  ## [v7.0.2](https://github.com/berkshelf/berkshelf/tree/v7.0.2) (2018-05-02)
4
19
  [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v7.0.1...v7.0.2)
5
20
 
data/Gemfile CHANGED
@@ -26,7 +26,7 @@ group :development do
26
26
  gem "webmock", ">= 1.11"
27
27
  gem "yard", ">= 0.8"
28
28
  gem "http", ">= 0.9.8"
29
- gem "chefstyle"
29
+ gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master"
30
30
  end
31
31
 
32
32
  instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
@@ -1,22 +1,22 @@
1
1
  GIT
2
2
  remote: https://github.com/chef/chef
3
- revision: 45084f13cacc8de6c091ec464da0d24ea427019d
3
+ revision: 975395a2812c20d326a9f83d5510b848dabc79ef
4
4
  branch: master
5
5
  specs:
6
- chef (14.0.218)
6
+ chef (14.4.22)
7
7
  addressable
8
8
  bundler (>= 1.10)
9
- chef-config (= 14.0.218)
9
+ chef-config (= 14.4.22)
10
10
  chef-zero (>= 13.0)
11
11
  diff-lcs (~> 1.2, >= 1.2.4)
12
12
  erubis (~> 2.7)
13
- ffi (< 1.9.22)
13
+ ffi (~> 1.9, >= 1.9.25)
14
14
  ffi-yajl (~> 2.2)
15
15
  highline (~> 1.6, >= 1.6.9)
16
16
  iniparse (~> 1.4)
17
- iso8601 (~> 0.9.1)
17
+ iso8601 (~> 0.11.0)
18
18
  mixlib-archive (~> 0.4)
19
- mixlib-authentication (~> 2.0)
19
+ mixlib-authentication (~> 2.1)
20
20
  mixlib-cli (~> 1.7)
21
21
  mixlib-log (~> 2.0, >= 2.0.3)
22
22
  mixlib-shellout (~> 2.0)
@@ -34,17 +34,25 @@ GIT
34
34
  specinfra (~> 2.10)
35
35
  syslog-logger (~> 1.6)
36
36
  uuidtools (~> 2.1.5)
37
- chef-config (14.0.218)
37
+ chef-config (14.4.22)
38
38
  addressable
39
39
  fuzzyurl
40
- mixlib-config (~> 2.0)
40
+ mixlib-config (>= 2.2.12, < 3.0)
41
41
  mixlib-shellout (~> 2.0)
42
42
  tomlrb (~> 1.2)
43
43
 
44
+ GIT
45
+ remote: https://github.com/chef/chefstyle.git
46
+ revision: 121db02686d148ad2c60ac68d2fb7a5ab8e95edb
47
+ branch: master
48
+ specs:
49
+ chefstyle (0.10.0)
50
+ rubocop (= 0.55.0)
51
+
44
52
  PATH
45
53
  remote: .
46
54
  specs:
47
- berkshelf (7.0.4)
55
+ berkshelf (7.0.5)
48
56
  chef (>= 13.6.52)
49
57
  chef-config
50
58
  cleanroom (~> 1.0)
@@ -68,7 +76,7 @@ GEM
68
76
  tzinfo (~> 1.1)
69
77
  addressable (2.5.2)
70
78
  public_suffix (>= 2.0.2, < 4.0)
71
- aruba (0.14.5)
79
+ aruba (0.14.6)
72
80
  childprocess (>= 0.6.3, < 0.10.0)
73
81
  contracts (~> 0.9)
74
82
  cucumber (>= 1.3.19)
@@ -84,8 +92,6 @@ GEM
84
92
  mixlib-log (~> 2.0)
85
93
  rack (~> 2.0)
86
94
  uuidtools (~> 2.1)
87
- chefstyle (0.9.0)
88
- rubocop (= 0.54.0)
89
95
  childprocess (0.9.0)
90
96
  ffi (~> 1.0, >= 1.0.11)
91
97
  cleanroom (1.0.0)
@@ -117,18 +123,18 @@ GEM
117
123
  domain_name (0.5.20180417)
118
124
  unf (>= 0.0.5, < 1.0.0)
119
125
  erubis (2.7.0)
120
- faraday (0.15.0)
126
+ faraday (0.15.2)
121
127
  multipart-post (>= 1.2, < 3)
122
128
  faraday-http-cache (2.0.0)
123
129
  faraday (~> 0.8)
124
- ffi (1.9.21)
130
+ ffi (1.9.25)
125
131
  ffi-yajl (2.3.1)
126
132
  libyajl2 (~> 1.2)
127
133
  fuubar (2.3.1)
128
134
  rspec-core (~> 3.0)
129
135
  ruby-progressbar (~> 1.4)
130
136
  fuzzyurl (0.9.0)
131
- gherkin (5.0.0)
137
+ gherkin (5.1.0)
132
138
  github_changelog_generator (1.14.3)
133
139
  activesupport
134
140
  faraday-http-cache
@@ -147,24 +153,24 @@ GEM
147
153
  http_parser.rb (~> 0.6.0)
148
154
  http-cookie (1.0.3)
149
155
  domain_name (~> 0.5)
150
- http-form_data (2.1.0)
156
+ http-form_data (2.1.1)
151
157
  http_parser.rb (0.6.0)
152
158
  i18n (1.0.1)
153
159
  concurrent-ruby (~> 1.0)
154
160
  iniparse (1.4.4)
155
161
  ipaddress (0.8.3)
156
- iso8601 (0.9.1)
162
+ iso8601 (0.11.0)
157
163
  libyajl2 (1.2.0)
158
164
  minitar (0.6.1)
159
165
  minitest (5.11.3)
160
- mixlib-archive (0.4.4)
166
+ mixlib-archive (0.4.13)
161
167
  mixlib-log
162
- mixlib-authentication (2.0.0)
168
+ mixlib-authentication (2.1.1)
163
169
  mixlib-cli (1.7.0)
164
- mixlib-config (2.2.6)
170
+ mixlib-config (2.2.13)
165
171
  tomlrb
166
172
  mixlib-log (2.0.4)
167
- mixlib-shellout (2.3.2)
173
+ mixlib-shellout (2.4.0)
168
174
  molinillo (0.6.5)
169
175
  multi_json (1.13.1)
170
176
  multi_test (0.1.2)
@@ -179,10 +185,10 @@ GEM
179
185
  net-ssh-multi (1.2.1)
180
186
  net-ssh (>= 2.6.5)
181
187
  net-ssh-gateway (>= 1.2.0)
182
- net-telnet (0.1.1)
183
- octokit (4.8.0)
188
+ net-telnet (0.2.0)
189
+ octokit (4.9.0)
184
190
  sawyer (~> 0.8.0, >= 0.5.3)
185
- ohai (14.0.29)
191
+ ohai (14.3.0)
186
192
  chef-config (>= 12.8, < 15)
187
193
  ffi (~> 1.9)
188
194
  ffi-yajl (~> 2.2)
@@ -198,7 +204,7 @@ GEM
198
204
  parser (2.5.1.0)
199
205
  ast (~> 2.4.0)
200
206
  plist (3.4.0)
201
- powerpack (0.1.1)
207
+ powerpack (0.1.2)
202
208
  proxifier (1.0.3)
203
209
  public_suffix (3.0.2)
204
210
  rack (2.0.5)
@@ -206,26 +212,26 @@ GEM
206
212
  rake (12.3.1)
207
213
  retriable (2.1.0)
208
214
  retryable (2.0.4)
209
- rspec (3.7.0)
210
- rspec-core (~> 3.7.0)
211
- rspec-expectations (~> 3.7.0)
212
- rspec-mocks (~> 3.7.0)
213
- rspec-core (3.7.1)
214
- rspec-support (~> 3.7.0)
215
- rspec-expectations (3.7.0)
215
+ rspec (3.8.0)
216
+ rspec-core (~> 3.8.0)
217
+ rspec-expectations (~> 3.8.0)
218
+ rspec-mocks (~> 3.8.0)
219
+ rspec-core (3.8.0)
220
+ rspec-support (~> 3.8.0)
221
+ rspec-expectations (3.8.0)
216
222
  diff-lcs (>= 1.2.0, < 2.0)
217
- rspec-support (~> 3.7.0)
223
+ rspec-support (~> 3.8.0)
218
224
  rspec-its (1.2.0)
219
225
  rspec-core (>= 3.0.0)
220
226
  rspec-expectations (>= 3.0.0)
221
- rspec-mocks (3.7.0)
227
+ rspec-mocks (3.8.0)
222
228
  diff-lcs (>= 1.2.0, < 2.0)
223
- rspec-support (~> 3.7.0)
224
- rspec-support (3.7.1)
229
+ rspec-support (~> 3.8.0)
230
+ rspec-support (3.8.0)
225
231
  rspec_junit_formatter (0.2.3)
226
232
  builder (< 4)
227
233
  rspec-core (>= 2, < 4, != 2.12.0)
228
- rubocop (0.54.0)
234
+ rubocop (0.55.0)
229
235
  parallel (~> 1.10)
230
236
  parser (>= 2.5)
231
237
  powerpack (~> 0.1)
@@ -247,29 +253,29 @@ GEM
247
253
  solve (4.0.0)
248
254
  molinillo (~> 0.6)
249
255
  semverse (>= 1.1, < 3.0)
250
- specinfra (2.73.3)
256
+ specinfra (2.75.1)
251
257
  net-scp
252
- net-ssh (>= 2.7, < 5.0)
258
+ net-ssh (>= 2.7)
253
259
  net-telnet
254
260
  sfl
255
261
  syslog-logger (1.6.8)
256
262
  systemu (2.6.5)
257
263
  thor (0.20.0)
258
264
  thread_safe (0.3.6)
259
- tomlrb (1.2.6)
265
+ tomlrb (1.2.7)
260
266
  tzinfo (1.2.5)
261
267
  thread_safe (~> 0.1)
262
268
  unf (0.1.4)
263
269
  unf_ext
264
270
  unf_ext (0.0.7.5)
265
- unicode-display_width (1.3.2)
271
+ unicode-display_width (1.4.0)
266
272
  uuidtools (2.1.5)
267
- webmock (3.4.1)
273
+ webmock (3.4.2)
268
274
  addressable (>= 2.3.6)
269
275
  crack (>= 0.3.2)
270
276
  hashdiff
271
277
  wmi-lite (1.0.0)
272
- yard (0.9.12)
278
+ yard (0.9.14)
273
279
 
274
280
  PLATFORMS
275
281
  ruby
@@ -279,7 +285,7 @@ DEPENDENCIES
279
285
  berkshelf!
280
286
  chef!
281
287
  chef-zero (>= 4.0)
282
- chefstyle
288
+ chefstyle!
283
289
  cucumber-expressions (= 5.0.13)
284
290
  dep_selector (>= 1.0)
285
291
  fuubar (>= 2.0)
@@ -43,7 +43,7 @@ Before do
43
43
  Berkshelf::CachedCookbook.instance_variable_set(:@loaded_cookbooks, nil)
44
44
 
45
45
  # This appears to be dead code
46
- #endpoints = [
46
+ # endpoints = [
47
47
  # {
48
48
  # type: "chef_server",
49
49
  # options: {
@@ -52,7 +52,7 @@ Before do
52
52
  # client_key: File.expand_path("spec/config/berkshelf.pem"),
53
53
  # },
54
54
  # },
55
- #]
55
+ # ]
56
56
 
57
57
  Berkshelf::RSpec::ChefServer.start(port: CHEF_SERVER_PORT)
58
58
 
@@ -31,7 +31,7 @@ module Berkshelf
31
31
  # API it stopped doing that. this may or may not be a breaking change (it broke some fairly
32
32
  # brittle berkshelf tests). if it causes too much berkshelf chaos we could revert by uncommenting
33
33
  # the next line. as it is removing this behavior feels more like fixing a bug.
34
- #@url = url.normalize! if url.is_a?(Addressable::URI)
34
+ # @url = url.normalize! if url.is_a?(Addressable::URI)
35
35
  options = { retries: 3, retry_interval: 0.5, open_timeout: 30, timeout: 30 }.merge(options)
36
36
  options[:server_url] = url
37
37
 
@@ -1,5 +1,5 @@
1
1
  module Berkshelf
2
2
  module APIClient
3
- VERSION = "4.0.1"
3
+ VERSION = "4.0.1".freeze
4
4
  end
5
5
  end
@@ -288,9 +288,9 @@ module Berkshelf
288
288
  end
289
289
 
290
290
  # this appears to be dead code
291
- #if options[:path]
291
+ # if options[:path]
292
292
  # metadata_file = File.join(options[:path], "metadata.rb")
293
- #end
293
+ # end
294
294
 
295
295
  options[:constraint] = constraint
296
296
 
@@ -87,6 +87,14 @@ module Berkshelf
87
87
  @path = File.expand_path(path)
88
88
  @klass.from_file(@path) if File.exist?(@path)
89
89
  # yeah, if !File.exist?() you just get back an empty config object
90
+
91
+ Berkshelf.ui.warn "The `cookbook.copyright' config is deprecated and will be removed in a future release." unless cookbook.copyright.nil?
92
+ Berkshelf.ui.warn "The `cookbook.email' config is deprecated and will be removed in a future release." unless cookbook.email.nil?
93
+ Berkshelf.ui.warn "The `cookbook.license' config is deprecated and will be removed in a future release." unless cookbook.license.nil?
94
+ Berkshelf.ui.warn "The `vagrant.vm.box' config is deprecated and will be removed in a future release." unless vagrant.vm.box.nil?
95
+ Berkshelf.ui.warn "The `vagrant.vm.forward_port' config is deprecated and will be removed in a future release." unless vagrant.vm.forward_port.nil?
96
+ Berkshelf.ui.warn "The `vagrant.vm.provision' config is deprecated and will be removed in a future release." unless vagrant.vm.provision.nil?
97
+ Berkshelf.ui.warn "The `vagrant.vm.omnibus.version' config is deprecated and will be removed in a future release." unless vagrant.vm.omnibus.version.nil?
90
98
  end
91
99
 
92
100
  def method_missing(method, *args, &block)
@@ -110,19 +118,19 @@ module Berkshelf
110
118
  default :artifactory_api_key, Berkshelf.chef_config.artifactory_api_key
111
119
  end
112
120
  config_context :cookbook do
113
- default :copyright, Berkshelf.chef_config.cookbook_copyright
114
- default :email, Berkshelf.chef_config.cookbook_email
115
- default :license, Berkshelf.chef_config.cookbook_license
121
+ default :copyright, nil
122
+ default :email, nil
123
+ default :license, nil
116
124
  end
117
125
  default :allowed_licenses, Array.new
118
126
  default :raise_license_exception, false
119
127
  config_context :vagrant do
120
128
  config_context :vm do
121
- default :box, "bento/ubuntu-14.04"
122
- default :forward_port, Hash.new
123
- default :provision, "chef_solo"
129
+ default :box, nil
130
+ default :forward_port, nil
131
+ default :provision, nil
124
132
  config_context :omnibus do
125
- default :version, "latest"
133
+ default :version, nil
126
134
  end
127
135
  end
128
136
  end
@@ -16,7 +16,7 @@ module FileUtils
16
16
  def mv(src, dest, options = {})
17
17
  old_mv(src, dest, options)
18
18
  rescue Errno::EACCES, Errno::ENOENT
19
- options.delete(:force) if options.has_key?(:force)
19
+ options.delete(:force) if options.key?(:force)
20
20
  FileUtils.cp_r(src, dest, options)
21
21
  FileUtils.rm_rf(src)
22
22
  end
@@ -34,7 +34,7 @@ module Berkshelf
34
34
  # @return [String]
35
35
  def download(*args, &block)
36
36
  # options are ignored
37
- #options = args.last.is_a?(Hash) ? args.pop : Hash.new
37
+ # options = args.last.is_a?(Hash) ? args.pop : Hash.new
38
38
  dependency, version = args
39
39
 
40
40
  sources.each do |source|
@@ -1,6 +1,6 @@
1
1
  module Berkshelf
2
2
  class GithubLocation < GitLocation
3
- HOST = "github.com"
3
+ HOST = "github.com".freeze
4
4
  def initialize(dependency, options = {})
5
5
  protocol = Berkshelf::Config.instance.github_protocol || :https
6
6
  case protocol
@@ -3,6 +3,7 @@ require "chef/http/simple_json"
3
3
  require "chef/http/simple"
4
4
  require "berkshelf/api_client/errors"
5
5
  require "chef/config"
6
+ require "chef/cookbook_manifest"
6
7
 
7
8
  module Berkshelf
8
9
  module RidleyCompatAPI
@@ -20,6 +21,7 @@ module Berkshelf
20
21
  chef_opts[:ssl_ca_file] = opts[:ssl][:ca_file] if opts[:ssl][:ca_file]
21
22
  chef_opts[:ssl_client_cert] = opts[:ssl][:client_cert] if opts[:ssl][:client_cert]
22
23
  chef_opts[:ssl_client_key] = opts[:ssl][:client_key] if opts[:ssl][:client_key]
24
+ chef_opts[:version_class] = opts[:version_class] if opts[:version_class]
23
25
  # chef/http/ssl_policies.rb reads only from Chef::Config and not from the opts in the constructor
24
26
  Chef::Config[:verify_api_cert] = chef_opts[:verify_api_cert]
25
27
  Chef::Config[:ssl_verify_mode] = chef_opts[:ssl_verify_mode]
@@ -97,5 +99,11 @@ module Berkshelf
97
99
  use Chef::HTTP::ValidateContentLength
98
100
 
99
101
  include RidleyCompatAPI
102
+
103
+ def initialize(**opts)
104
+ opts[:version_class] = Chef::CookbookManifestVersions
105
+ super(**opts)
106
+ end
107
+
100
108
  end
101
109
  end
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "7.0.4"
2
+ VERSION = "7.0.5".freeze
3
3
  end
@@ -6,5 +6,5 @@ validation_client_name "validator"
6
6
  validation_key File.expand_path("spec/config/validator.pem")
7
7
  chef_server_url "http://localhost:26310"
8
8
  cache_type "BasicFile"
9
- cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
9
+ cache_options( path: "#{ENV['HOME']}/.chef/checksums" )
10
10
  cookbook_path []
@@ -370,7 +370,7 @@ describe Berkshelf::Berksfile do
370
370
  let(:raw_metadata_files) { [File.join(cached_cookbook.cookbook_name, "metadata.rb")] }
371
371
 
372
372
  let(:destination) { "/a/destination/path" }
373
- let(:options) { { :exclude => Berkshelf::Berksfile::EXCLUDED_VCS_FILES_WHEN_VENDORING, delete: nil } }
373
+ let(:options) { { exclude: Berkshelf::Berksfile::EXCLUDED_VCS_FILES_WHEN_VENDORING, delete: nil } }
374
374
 
375
375
  before do
376
376
  allow(Berkshelf::Installer).to receive(:new).and_return(installer)
@@ -122,7 +122,7 @@ describe Berkshelf::APIClient::Connection do
122
122
  subject { instance.universe }
123
123
 
124
124
  it "follows 301 redirects correctly" do
125
- stub_request(:get, "http://supermarket.getchef.com/universe").to_return(:status => 301, :headers => { "Location" => "http://arglebargle.com/universe" })
125
+ stub_request(:get, "http://supermarket.getchef.com/universe").to_return(status: 301, headers: { "Location" => "http://arglebargle.com/universe" })
126
126
  body_response = %q{{"ruby":{"1.2.3":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"},"2.0.0":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}},"elixir":{"1.0.0":{"endpoint_priority":0,"platforms":{"CentOS":"= 6.0.0"},"dependencies":{},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}}}}
127
127
  stub_request(:get, "http://arglebargle.com/universe")
128
128
  .to_return(status: 200, body: body_response, headers: { "Content-Type" => "application/json; charset=utf-8" })
@@ -130,17 +130,17 @@ describe Berkshelf::APIClient::Connection do
130
130
  end
131
131
 
132
132
  it "raises Berkshelf::APIClient::ServiceUnavailable for 500s" do
133
- stub_request(:get, "http://supermarket.getchef.com/universe").to_return(:status => [500, "Internal Server Error"])
133
+ stub_request(:get, "http://supermarket.getchef.com/universe").to_return(status: [500, "Internal Server Error"])
134
134
  expect { subject }.to raise_error(Berkshelf::APIClient::ServiceUnavailable)
135
135
  end
136
136
 
137
137
  it "raises Berkshelf::APIClient::ServiceNotFound for 404s" do
138
- stub_request(:get, "http://supermarket.getchef.com/universe").to_return(:status => [404, "Not Found"])
138
+ stub_request(:get, "http://supermarket.getchef.com/universe").to_return(status: [404, "Not Found"])
139
139
  expect { subject }.to raise_error(Berkshelf::APIClient::ServiceNotFound)
140
140
  end
141
141
 
142
142
  it "raises Net::HTTPBadRequest for 400s" do
143
- stub_request(:get, "http://supermarket.getchef.com/universe").to_return(:status => [400, "Bad Request"])
143
+ stub_request(:get, "http://supermarket.getchef.com/universe").to_return(status: [400, "Bad Request"])
144
144
  expect { subject }.to raise_error(Berkshelf::APIClient::BadResponse)
145
145
  end
146
146
 
@@ -22,10 +22,7 @@ describe Berkshelf::Config do
22
22
  client_key: "client-key",
23
23
  node_name: "fake-client",
24
24
  trusted_certs_dir: "/tmp/fakecerts",
25
- artifactory_api_key: "secret",
26
- cookbook_copyright: "user",
27
- cookbook_email: "user@example.com",
28
- cookbook_license: "apachev2"
25
+ artifactory_api_key: "secret"
29
26
  )
30
27
  end
31
28
 
@@ -46,16 +43,6 @@ describe Berkshelf::Config do
46
43
  expect(Berkshelf::Config.instance.chef.send(attr)).to eq(default)
47
44
  end
48
45
  end
49
-
50
- {
51
- copyright: "user",
52
- email: "user@example.com",
53
- license: "apachev2",
54
- }.each do |attr, default|
55
- it "should have a default cookbook.#{attr}" do
56
- expect(Berkshelf::Config.instance.cookbook.send(attr)).to eq(default)
57
- end
58
- end
59
46
  end
60
47
  end
61
48
 
@@ -267,7 +267,7 @@ module Berkshelf
267
267
  end
268
268
 
269
269
  it "copies relative and absolute symlinks when destination is a relative path" do
270
- described_class.sync(source, "#{destination.gsub(Dir.pwd, '.')}")
270
+ described_class.sync(source, (destination.gsub(Dir.pwd, ".")).to_s)
271
271
 
272
272
  expect("#{destination}/links/index.html").to be_a_symlink_to("./home.html")
273
273
  expect("#{destination}/links/default.html").to be_a_symlink_to("./home.html")
@@ -0,0 +1,16 @@
1
+ require "spec_helper"
2
+ require "chef/cookbook_manifest"
3
+
4
+ describe Berkshelf::RidleyCompat do
5
+ let(:opts) { Hash.new }
6
+
7
+ subject { described_class.new(opts) }
8
+
9
+ context "default" do
10
+ it "has a cookbook version_class" do
11
+ expect(subject.options).to have_key(:version_class)
12
+ expect(subject.options[:version_class])
13
+ .to eq(Chef::CookbookManifestVersions)
14
+ end
15
+ end
16
+ 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: 7.0.4
4
+ version: 7.0.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: 2018-06-08 00:00:00.000000000 Z
15
+ date: 2018-08-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: mixlib-shellout
@@ -248,23 +248,6 @@ files:
248
248
  - features/step_definitions/utility_steps.rb
249
249
  - features/support/aruba.rb
250
250
  - features/support/env.rb
251
- - generator_files/Berksfile.erb
252
- - generator_files/CHANGELOG.md.erb
253
- - generator_files/Gemfile.erb
254
- - generator_files/README.md.erb
255
- - generator_files/Thorfile.erb
256
- - generator_files/Vagrantfile.erb
257
- - generator_files/chefignore
258
- - generator_files/default_recipe.erb
259
- - generator_files/default_test.rb.erb
260
- - generator_files/gitignore.erb
261
- - generator_files/helpers.rb.erb
262
- - generator_files/licenses/apachev2.erb
263
- - generator_files/licenses/gplv2.erb
264
- - generator_files/licenses/gplv3.erb
265
- - generator_files/licenses/mit.erb
266
- - generator_files/licenses/reserved.erb
267
- - generator_files/metadata.rb.erb
268
251
  - lib/berkshelf.rb
269
252
  - lib/berkshelf/api-client.rb
270
253
  - lib/berkshelf/api_client.rb
@@ -396,6 +379,7 @@ files:
396
379
  - spec/unit/berkshelf/packager_spec.rb
397
380
  - spec/unit/berkshelf/resolver/graph_spec.rb
398
381
  - spec/unit/berkshelf/resolver_spec.rb
382
+ - spec/unit/berkshelf/ridley_compat_spec.rb
399
383
  - spec/unit/berkshelf/shell_spec.rb
400
384
  - spec/unit/berkshelf/source_spec.rb
401
385
  - spec/unit/berkshelf/source_uri_spec.rb
@@ -540,6 +524,7 @@ test_files:
540
524
  - spec/unit/berkshelf/packager_spec.rb
541
525
  - spec/unit/berkshelf/resolver/graph_spec.rb
542
526
  - spec/unit/berkshelf/resolver_spec.rb
527
+ - spec/unit/berkshelf/ridley_compat_spec.rb
543
528
  - spec/unit/berkshelf/shell_spec.rb
544
529
  - spec/unit/berkshelf/source_spec.rb
545
530
  - spec/unit/berkshelf/source_uri_spec.rb
@@ -1,11 +0,0 @@
1
- source "https://supermarket.chef.io"
2
- <% if options[:chef_minitest] -%>
3
-
4
- group :integration do
5
- cookbook 'minitest-handler'
6
- end
7
- <% end -%>
8
- <% if options[:metadata_entry] -%>
9
-
10
- metadata
11
- <% end -%>
@@ -1,3 +0,0 @@
1
- # 0.1.0
2
-
3
- Initial release of <%= name %>
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- <% if options[:foodcritic] -%>
4
- gem 'thor-foodcritic'
5
- <% end -%>
6
- <% if options[:scmversion] -%>
7
- gem 'thor-scmversion'
8
- <% end -%>
@@ -1,42 +0,0 @@
1
- # <%= name %>-cookbook
2
-
3
- TODO: Enter the cookbook description here.
4
-
5
- ## Supported Platforms
6
-
7
- TODO: List your supported platforms.
8
-
9
- ## Attributes
10
-
11
- <table>
12
- <tr>
13
- <th>Key</th>
14
- <th>Type</th>
15
- <th>Description</th>
16
- <th>Default</th>
17
- </tr>
18
- <tr>
19
- <td><tt>['<%= name %>']['bacon']</tt></td>
20
- <td>Boolean</td>
21
- <td>whether to include bacon</td>
22
- <td><tt>true</tt></td>
23
- </tr>
24
- </table>
25
-
26
- ## Usage
27
-
28
- ### <%= name %>::default
29
-
30
- Include `<%= name %>` in your node's `run_list`:
31
-
32
- ```json
33
- {
34
- "run_list": [
35
- "recipe[<%= name %>::default]"
36
- ]
37
- }
38
- ```
39
-
40
- ## License and Authors
41
-
42
- Author:: <%= maintainer %> (<<%= maintainer_email %>>)
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'bundler'
4
- require 'bundler/setup'
5
- <% if options[:foodcritic] -%>
6
- require 'thor/foodcritic'
7
- <% end -%>
8
- <% if options[:scmversion] -%>
9
- require 'thor/scmversion'
10
- <% end -%>
11
- require 'berkshelf/thor'
@@ -1,117 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
- VAGRANTFILE_API_VERSION = '2'
6
-
7
- Vagrant.require_version '>= 1.5.0'
8
-
9
- Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
10
- # All Vagrant configuration is done here. The most common configuration
11
- # options are documented and commented below. For a complete reference,
12
- # please see the online documentation at vagrantup.com.
13
-
14
- config.vm.hostname = '<%= "#{cookbook_name.gsub('_','-')}-berkshelf" %>'
15
-
16
- # Set the version of chef to install using the vagrant-omnibus plugin
17
- # NOTE: You will need to install the vagrant-omnibus plugin:
18
- #
19
- # $ vagrant plugin install vagrant-omnibus
20
- #
21
- if Vagrant.has_plugin?("vagrant-omnibus")
22
- config.omnibus.chef_version = '<%= berkshelf_config.vagrant.omnibus.version %>'
23
- end
24
-
25
- # Every Vagrant virtual environment requires a box to build off of.
26
- # If this value is a shorthand to a box in Vagrant Cloud then
27
- # config.vm.box_url doesn't need to be specified.
28
- config.vm.box = '<%= berkshelf_config.vagrant.vm.box %>'
29
-
30
- <% unless berkshelf_config.vagrant.vm.box_url.nil? -%>
31
- # The url from where the 'config.vm.box' box will be fetched if it
32
- # is not a Vagrant Cloud box and if it doesn't already exist on the
33
- # user's system.
34
- config.vm.box_url = '<%= berkshelf_config.vagrant.vm.box_url %>'
35
- <% end -%>
36
-
37
- # Assign this VM to a host-only network IP, allowing you to access it
38
- # via the IP. Host-only networks can talk to the host machine as well as
39
- # any other machines on the same network, but cannot be accessed (through this
40
- # network interface) by any external networks.
41
- config.vm.network :private_network, type: 'dhcp'
42
-
43
- # Create a forwarded port mapping which allows access to a specific port
44
- # within the machine from a port on the host machine. In the example below,
45
- # accessing "localhost:8080" will access port 80 on the guest machine.
46
- <% berkshelf_config.vagrant.vm.forward_port.each do |guest, host| %>
47
- config.vm.network :forwarded_port, guest: <%= guest %>, host: <%= host %>
48
- <% end -%>
49
-
50
- # Share an additional folder to the guest VM. The first argument is
51
- # the path on the host to the actual folder. The second argument is
52
- # the path on the guest to mount the folder. And the optional third
53
- # argument is a set of non-required options.
54
- # config.vm.synced_folder "../data", "/vagrant_data"
55
-
56
- # Provider-specific configuration so you can fine-tune various
57
- # backing providers for Vagrant. These expose provider-specific options.
58
- # Example for VirtualBox:
59
- #
60
- # config.vm.provider :virtualbox do |vb|
61
- # # Don't boot with headless mode
62
- # vb.gui = true
63
- #
64
- # # Use VBoxManage to customize the VM. For example to change memory:
65
- # vb.customize ["modifyvm", :id, "--memory", "1024"]
66
- # end
67
- #
68
- # View the documentation for the provider you're using for more
69
- # information on available options.
70
-
71
- # The path to the Berksfile to use with Vagrant Berkshelf
72
- # config.berkshelf.berksfile_path = "./Berksfile"
73
-
74
- # Enabling the Berkshelf plugin. To enable this globally, add this configuration
75
- # option to your ~/.vagrant.d/Vagrantfile file
76
- config.berkshelf.enabled = true
77
-
78
- # An array of symbols representing groups of cookbook described in the Vagrantfile
79
- # to exclusively install and copy to Vagrant's shelf.
80
- # config.berkshelf.only = []
81
-
82
- # An array of symbols representing groups of cookbook described in the Vagrantfile
83
- # to skip installing and copying to Vagrant's shelf.
84
- # config.berkshelf.except = []
85
-
86
- <% if berkshelf_config.vagrant.vm.provision == 'chef_client' -%>
87
- config.vm.provision :chef_client do |chef|
88
- chef.chef_server_url = '<%= berkshelf_config.chef.chef_server_url %>'
89
- chef.validation_client_name = '<%= berkshelf_config.chef.validation_client_name %>'
90
- chef.validation_key_path = '<%= berkshelf_config.chef.validation_key_path %>'
91
-
92
- chef.run_list = [
93
- <% if options[:chef_minitest] %>
94
- 'recipe[minitest-handler::default]',
95
- <% end -%>
96
- 'recipe[<%= cookbook_name %>::default]'
97
- ]
98
- end
99
- <% elsif berkshelf_config.vagrant.vm.provision == 'chef_solo' -%>
100
- config.vm.provision :chef_solo do |chef|
101
- chef.json = {
102
- mysql: {
103
- server_root_password: 'rootpass',
104
- server_debian_password: 'debpass',
105
- server_repl_password: 'replpass'
106
- }
107
- }
108
-
109
- chef.run_list = [
110
- <% if options[:chef_minitest] %>
111
- 'recipe[minitest-handler::default]',
112
- <% end -%>
113
- 'recipe[<%= cookbook_name %>::default]'
114
- ]
115
- end
116
- <% end -%>
117
- end
@@ -1,94 +0,0 @@
1
- # Put files/directories that should be ignored in this file when uploading
2
- # or sharing to the community site.
3
- # Lines that start with '# ' are comments.
4
-
5
- # OS generated files #
6
- ######################
7
- .DS_Store
8
- Icon?
9
- nohup.out
10
- ehthumbs.db
11
- Thumbs.db
12
-
13
- # SASS #
14
- ########
15
- .sass-cache
16
-
17
- # EDITORS #
18
- ###########
19
- \#*
20
- .#*
21
- *~
22
- *.sw[a-z]
23
- *.bak
24
- REVISION
25
- TAGS*
26
- tmtags
27
- *_flymake.*
28
- *_flymake
29
- *.tmproj
30
- .project
31
- .settings
32
- mkmf.log
33
-
34
- ## COMPILED ##
35
- ##############
36
- a.out
37
- *.o
38
- *.pyc
39
- *.so
40
- *.com
41
- *.class
42
- *.dll
43
- *.exe
44
- */rdoc/
45
-
46
- # Testing #
47
- ###########
48
- .watchr
49
- .rspec
50
- spec/*
51
- spec/fixtures/*
52
- test/*
53
- features/*
54
- Guardfile
55
- Procfile
56
-
57
- # SCM #
58
- #######
59
- .git
60
- */.git
61
- .gitignore
62
- .gitmodules
63
- .gitconfig
64
- .gitattributes
65
- .svn
66
- */.bzr/*
67
- */.hg/*
68
- */.svn/*
69
-
70
- # Berkshelf #
71
- #############
72
- cookbooks/*
73
- tmp
74
-
75
- # Cookbooks #
76
- #############
77
- CONTRIBUTING
78
- CHANGELOG*
79
-
80
- # Strainer #
81
- ############
82
- Colanderfile
83
- Strainerfile
84
- .colander
85
- .strainer
86
-
87
- # Vagrant #
88
- ###########
89
- .vagrant
90
- Vagrantfile
91
-
92
- # Travis #
93
- ##########
94
- .travis.yml
@@ -1,6 +0,0 @@
1
- #
2
- # Cookbook Name:: <%= name %>
3
- # Recipe:: default
4
- #
5
- <%= commented(license) %>
6
- #
@@ -1,11 +0,0 @@
1
- require File.expand_path('../support/helpers', __FILE__)
2
-
3
- describe '<%= cookbook_name %>::default' do
4
-
5
- include Helpers::<%= cookbook_name.capitalize.gsub('-','_') %>
6
-
7
- # Example spec tests can be found at http://git.io/Fahwsw
8
- it 'runs no tests by default' do
9
- end
10
-
11
- end
@@ -1,23 +0,0 @@
1
- *~
2
- *#
3
- .#*
4
- \#*#
5
- .*.sw[a-z]
6
- *.un~
7
- pkg/
8
-
9
- # Berkshelf
10
- .vagrant
11
- /cookbooks
12
- <% unless options[:pattern] == "environment" -%>
13
- Berksfile.lock
14
- <% end -%>
15
-
16
- # Bundler
17
- Gemfile.lock
18
- bin/*
19
- .bundle/*
20
-
21
- <% if options[:scmversion] -%>
22
- VERSION
23
- <% end -%>
@@ -1,7 +0,0 @@
1
- module Helpers
2
- module <%= cookbook_name.capitalize.gsub('-','_') %>
3
- include MiniTest::Chef::Assertions
4
- include MiniTest::Chef::Context
5
- include MiniTest::Chef::Resources
6
- end
7
- end
@@ -1,13 +0,0 @@
1
- Copyright (C) <%= copyright_year %> <%= maintainer %>
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
@@ -1,15 +0,0 @@
1
- Copyright (C) <%= copyright_year %> <%= maintainer %>
2
-
3
- This program is free software; you can redistribute it and/or modify
4
- it under the terms of the GNU General Public License as published by
5
- the Free Software Foundation; either version 2 of the License, or
6
- (at your option) any later version.
7
-
8
- This program is distributed in the hope that it will be useful,
9
- but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- GNU General Public License for more details.
12
-
13
- You should have received a copy of the GNU General Public License along
14
- with this program; if not, write to the Free Software Foundation, Inc.,
15
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -1,14 +0,0 @@
1
- Copyright (C) <%= copyright_year %> <%= maintainer %>
2
-
3
- This program is free software: you can redistribute it and/or modify
4
- it under the terms of the GNU General Public License as published by
5
- the Free Software Foundation, either version 3 of the License, or
6
- (at your option) any later version.
7
-
8
- This program is distributed in the hope that it will be useful,
9
- but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- GNU General Public License for more details.
12
-
13
- You should have received a copy of the GNU General Public License
14
- along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -1,20 +0,0 @@
1
- Copyright (C) <%= copyright_year %> <%= maintainer %>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +0,0 @@
1
- Copyright (C) <%= copyright_year %> <%= maintainer %>
2
-
3
- All rights reserved - Do Not Redistribute
@@ -1,11 +0,0 @@
1
- name '<%= name %>'
2
- maintainer '<%= maintainer %>'
3
- maintainer_email '<%= maintainer_email %>'
4
- license '<%= license_name %>'
5
- description 'Installs/Configures <%= name %>'
6
- long_description 'Installs/Configures <%= name %>'
7
- <% if options[:scmversion] -%>
8
- version IO.read(File.join(File.dirname(__FILE__), 'VERSION'))
9
- <% else -%>
10
- version '0.1.0'
11
- <% end -%>