chef-sugar 4.2.1 → 5.1.11

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chef/sugar/architecture.rb +137 -132
  3. data/{recipes/default.rb → lib/chef/sugar/deprecation.rb} +31 -6
  4. data/lib/chef/sugar/docker.rb +17 -12
  5. data/lib/chef/sugar/init.rb +1 -2
  6. data/lib/chef/sugar/kitchen.rb +17 -12
  7. data/lib/chef/sugar/node.rb +6 -0
  8. data/lib/chef/sugar/platform.rb +169 -165
  9. data/lib/chef/sugar/platform_family.rb +142 -137
  10. data/lib/chef/sugar/shell.rb +7 -3
  11. data/lib/chef/sugar/version.rb +1 -1
  12. data/lib/chef/sugar/virtualization.rb +1 -1
  13. metadata +9 -139
  14. data/.github/lock.yml +0 -3
  15. data/.github/reaction.yml +0 -1
  16. data/.gitignore +0 -26
  17. data/.kitchen.yml +0 -16
  18. data/.travis.yml +0 -17
  19. data/CHANGELOG.md +0 -261
  20. data/CONTRIBUTING.md +0 -20
  21. data/Gemfile +0 -2
  22. data/README.md +0 -540
  23. data/Rakefile +0 -11
  24. data/chef-sugar.gemspec +0 -33
  25. data/libraries/chef-sugar.rb +0 -1
  26. data/metadata.rb +0 -24
  27. data/spec/spec_helper.rb +0 -25
  28. data/spec/support/shared_examples.rb +0 -20
  29. data/spec/unit/chef/sugar/architecture_spec.rb +0 -129
  30. data/spec/unit/chef/sugar/cloud_spec.rb +0 -149
  31. data/spec/unit/chef/sugar/constraints_spec.rb +0 -45
  32. data/spec/unit/chef/sugar/core_extensions/array_spec.rb +0 -10
  33. data/spec/unit/chef/sugar/core_extensions/object_spec.rb +0 -62
  34. data/spec/unit/chef/sugar/core_extensions/string_spec.rb +0 -48
  35. data/spec/unit/chef/sugar/data_bag_spec.rb +0 -118
  36. data/spec/unit/chef/sugar/docker_spec.rb +0 -39
  37. data/spec/unit/chef/sugar/init_spec.rb +0 -74
  38. data/spec/unit/chef/sugar/ip_spec.rb +0 -53
  39. data/spec/unit/chef/sugar/kernel_spec.rb +0 -16
  40. data/spec/unit/chef/sugar/kitchen_spec.rb +0 -18
  41. data/spec/unit/chef/sugar/node_spec.rb +0 -172
  42. data/spec/unit/chef/sugar/platform_family_spec.rb +0 -166
  43. data/spec/unit/chef/sugar/platform_spec.rb +0 -342
  44. data/spec/unit/chef/sugar/ruby_spec.rb +0 -39
  45. data/spec/unit/chef/sugar/run_context_spec.rb +0 -19
  46. data/spec/unit/chef/sugar/shell_spec.rb +0 -104
  47. data/spec/unit/chef/sugar/vagrant_spec.rb +0 -37
  48. data/spec/unit/chef/sugar/virtualization_spec.rb +0 -135
  49. data/spec/unit/recipes/default_spec.rb +0 -9
@@ -14,8 +14,8 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require 'mixlib/shellout'
18
- require 'pathname'
17
+ require 'mixlib/shellout' unless defined?(Mixlib::ShellOut)
18
+ require 'pathname' unless defined?(Pathname)
19
19
 
20
20
  class Chef
21
21
  module Sugar
@@ -51,7 +51,11 @@ class Chef
51
51
  # @return [String]
52
52
  #
53
53
  def dev_null(node)
54
- Chef::Sugar::PlatformFamily.windows?(node) ? 'NUL' : '/dev/null'
54
+ if defined?(ChefUtils)
55
+ ChefUtils.windows?(node) ? 'NUL' : '/dev/null'
56
+ else
57
+ Chef::Sugar::PlatformFamily.windows?(node) ? 'NUL' : '/dev/null'
58
+ end
55
59
  end
56
60
 
57
61
  #
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '4.2.1'
19
+ VERSION = "5.1.11"
20
20
  end
21
21
  end
@@ -55,7 +55,7 @@ class Chef
55
55
  # otherwise
56
56
  #
57
57
  def parallels?(node)
58
- node.key?('virtualization') && node['virtualization']['system'] == 'Parallels'
58
+ node.key?('virtualization') && node['virtualization']['system'] == 'parallels'
59
59
  end
60
60
 
61
61
  #
metadata CHANGED
@@ -1,85 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 5.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-06 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: chefspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: test-kitchen
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: kitchen-vagrant
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
11
+ date: 2020-08-14 00:00:00.000000000 Z
12
+ dependencies: []
83
13
  description: A series of helpful sugar of the Chef core and other resources to make
84
14
  a cleaner, more lean recipe DSL, enforce DRY principles, and make writing Chef recipes
85
15
  an awesome experience!
@@ -89,18 +19,7 @@ executables: []
89
19
  extensions: []
90
20
  extra_rdoc_files: []
91
21
  files:
92
- - ".github/lock.yml"
93
- - ".github/reaction.yml"
94
- - ".gitignore"
95
- - ".kitchen.yml"
96
- - ".travis.yml"
97
- - CHANGELOG.md
98
- - CONTRIBUTING.md
99
- - Gemfile
100
22
  - LICENSE
101
- - README.md
102
- - Rakefile
103
- - chef-sugar.gemspec
104
23
  - lib/chef/sugar.rb
105
24
  - lib/chef/sugar/architecture.rb
106
25
  - lib/chef/sugar/cloud.rb
@@ -111,6 +30,7 @@ files:
111
30
  - lib/chef/sugar/core_extensions/object.rb
112
31
  - lib/chef/sugar/core_extensions/string.rb
113
32
  - lib/chef/sugar/data_bag.rb
33
+ - lib/chef/sugar/deprecation.rb
114
34
  - lib/chef/sugar/docker.rb
115
35
  - lib/chef/sugar/filters.rb
116
36
  - lib/chef/sugar/init.rb
@@ -126,35 +46,9 @@ files:
126
46
  - lib/chef/sugar/vagrant.rb
127
47
  - lib/chef/sugar/version.rb
128
48
  - lib/chef/sugar/virtualization.rb
129
- - libraries/chef-sugar.rb
130
- - metadata.rb
131
- - recipes/default.rb
132
- - spec/spec_helper.rb
133
- - spec/support/shared_examples.rb
134
- - spec/unit/chef/sugar/architecture_spec.rb
135
- - spec/unit/chef/sugar/cloud_spec.rb
136
- - spec/unit/chef/sugar/constraints_spec.rb
137
- - spec/unit/chef/sugar/core_extensions/array_spec.rb
138
- - spec/unit/chef/sugar/core_extensions/object_spec.rb
139
- - spec/unit/chef/sugar/core_extensions/string_spec.rb
140
- - spec/unit/chef/sugar/data_bag_spec.rb
141
- - spec/unit/chef/sugar/docker_spec.rb
142
- - spec/unit/chef/sugar/init_spec.rb
143
- - spec/unit/chef/sugar/ip_spec.rb
144
- - spec/unit/chef/sugar/kernel_spec.rb
145
- - spec/unit/chef/sugar/kitchen_spec.rb
146
- - spec/unit/chef/sugar/node_spec.rb
147
- - spec/unit/chef/sugar/platform_family_spec.rb
148
- - spec/unit/chef/sugar/platform_spec.rb
149
- - spec/unit/chef/sugar/ruby_spec.rb
150
- - spec/unit/chef/sugar/run_context_spec.rb
151
- - spec/unit/chef/sugar/shell_spec.rb
152
- - spec/unit/chef/sugar/vagrant_spec.rb
153
- - spec/unit/chef/sugar/virtualization_spec.rb
154
- - spec/unit/recipes/default_spec.rb
155
- homepage: https://github.com/sethvargo/chef-sugar
49
+ homepage: https://github.com/chef/chef-sugar
156
50
  licenses:
157
- - Apache 2.0
51
+ - Apache-2.0
158
52
  metadata: {}
159
53
  post_install_message:
160
54
  rdoc_options: []
@@ -164,40 +58,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
58
  requirements:
165
59
  - - ">="
166
60
  - !ruby/object:Gem::Version
167
- version: 2.2.2
61
+ version: '2.3'
168
62
  required_rubygems_version: !ruby/object:Gem::Requirement
169
63
  requirements:
170
64
  - - ">="
171
65
  - !ruby/object:Gem::Version
172
66
  version: '0'
173
67
  requirements: []
174
- rubyforge_project:
175
- rubygems_version: 2.7.7
68
+ rubygems_version: 3.0.3
176
69
  signing_key:
177
70
  specification_version: 4
178
71
  summary: A collection of helper methods and modules that make working with Chef recipes
179
72
  awesome.
180
- test_files:
181
- - spec/spec_helper.rb
182
- - spec/support/shared_examples.rb
183
- - spec/unit/chef/sugar/architecture_spec.rb
184
- - spec/unit/chef/sugar/cloud_spec.rb
185
- - spec/unit/chef/sugar/constraints_spec.rb
186
- - spec/unit/chef/sugar/core_extensions/array_spec.rb
187
- - spec/unit/chef/sugar/core_extensions/object_spec.rb
188
- - spec/unit/chef/sugar/core_extensions/string_spec.rb
189
- - spec/unit/chef/sugar/data_bag_spec.rb
190
- - spec/unit/chef/sugar/docker_spec.rb
191
- - spec/unit/chef/sugar/init_spec.rb
192
- - spec/unit/chef/sugar/ip_spec.rb
193
- - spec/unit/chef/sugar/kernel_spec.rb
194
- - spec/unit/chef/sugar/kitchen_spec.rb
195
- - spec/unit/chef/sugar/node_spec.rb
196
- - spec/unit/chef/sugar/platform_family_spec.rb
197
- - spec/unit/chef/sugar/platform_spec.rb
198
- - spec/unit/chef/sugar/ruby_spec.rb
199
- - spec/unit/chef/sugar/run_context_spec.rb
200
- - spec/unit/chef/sugar/shell_spec.rb
201
- - spec/unit/chef/sugar/vagrant_spec.rb
202
- - spec/unit/chef/sugar/virtualization_spec.rb
203
- - spec/unit/recipes/default_spec.rb
73
+ test_files: []
@@ -1,3 +0,0 @@
1
- daysUntilLock: 90
2
- lockLabel: false
3
- lockComment: false
@@ -1 +0,0 @@
1
- reactionComment: false
data/.gitignore DELETED
@@ -1,26 +0,0 @@
1
- *~
2
- *#
3
- .#*
4
- \#*#
5
- .*.sw[a-z]
6
- *.un~
7
- *.tmp
8
- *.bk
9
- *.bkup
10
- .kitchen.local.yml
11
- Berksfile.lock
12
- Gemfile.lock
13
-
14
- .bundle/
15
- .cache/
16
- .kitchen/
17
- .vagrant/
18
- .vagrant.d/
19
- .yardoc/
20
- bin/
21
- coverage/
22
- doc/
23
- pkg/
24
- tmp/
25
- vendor/
26
- .rspec
@@ -1,16 +0,0 @@
1
- driver:
2
- name: vagrant
3
-
4
- provisioner:
5
- name: chef_zero
6
- deprecations_as_errors: true
7
-
8
- platforms:
9
- - name: centos-6
10
- - name: centos-7
11
- - name: ubuntu-14.04
12
- - name: ubuntu-16.04
13
-
14
- suites:
15
- - name: default
16
- run_list: chef-sugar::default
@@ -1,17 +0,0 @@
1
- sudo: false
2
-
3
- rvm:
4
- - 2.2.9
5
- - 2.3.6
6
- - 2.4.3
7
- - 2.5.0
8
-
9
- branches:
10
- only:
11
- - master
12
-
13
- cache: bundler
14
-
15
- bundler_args: --jobs 7
16
-
17
- script: bundle exec rake
@@ -1,261 +0,0 @@
1
- # Chef Sugar Changelog
2
-
3
- This file is used to list changes made in each version of the chef-sugar cookbook and gem.
4
-
5
- ## v4.2.1 (2018-12-06)
6
-
7
- - Repackaged with an older stove to remove the metadata.rb on the Supermarket for older chef-client releases
8
-
9
- ## v4.2.0 (2018-12-05)
10
-
11
- - Added a new parallels? helper
12
- - Added support for the Raspberry Pi 1 and Zero to armhf? helper
13
- - Added a centos_final? helper
14
-
15
- ## v4.1.0 (2018-08-16)
16
-
17
- - Improve the detection of linux hosts with the linux? helper. Amazon Linux and obscure distros will now be properly detected.
18
-
19
- ## v4.0.1 (2018-08-09)
20
-
21
- - Add new Debian, Mint, macOS codenames
22
- - Add new Ubuntu codenames: artful, bionic, cosmic
23
-
24
- ## v4.0.0 (2018-01-26)
25
-
26
- - Require Ruby 2.2 or later and Chef 12.10 or later
27
- - Cookbook now installs the chef-sugar gem via a metadata installation so chef-sugar::default on your runlist is no longer needed
28
- - Added additional metadata to the cookbook: supports, issue_url, source_url, chef_version.
29
- - Requirements improved in the readme
30
-
31
- ## v3.6.0 (2017-10-26)
32
-
33
- - Add Ubuntu zesty and debian stretch detection
34
- - Add softlayer? helper
35
- - Add aarch64? helper
36
-
37
- ## v3.5.0 (2016-07-12)
38
-
39
- - Improve the systemd check to not fail on older kernels or Windows hosts
40
- - Add detection of macOS 10.11 and 10.12
41
-
42
- ## v3.4.0 (2016-07-18)
43
-
44
- ### Improvements
45
-
46
- - Add `virtual?` and `physical?` methods
47
- - Add Scaleway C1 server (arm arch) support
48
- - Add IMB s390x support
49
- - Add missing Ubuntu release names
50
-
51
- ### Bug Fixes
52
-
53
- - Drop Ruby 2.0.0 support from Travis test matrix
54
- - Pin to Rack 1.6 (dev dep)
55
-
56
- ## v3.3.0 (2016-01-11)
57
-
58
- ### Improvements
59
-
60
- - Break up `Chef::Sugar::Constraints` into a class and a dsl file
61
- - Add `platform_version` method with full constraints comparison support
62
-
63
- ## v3.2.0 (2015-12-10)
64
-
65
- ### Improvements
66
-
67
- - Add platform matchers for `debian` and `fedora`
68
- - Add `openvz` support under virtualization
69
- - Add init system detection support
70
- - Add support for `nexus`, `ios_xr` platforms and `wrlinux` platform_family
71
- - Add additional `aix` helpers
72
-
73
- ### Bug Fixes
74
-
75
- - Properly expose `Architecture#i386?` in the DSL
76
-
77
- ## v3.1.1 (2015-06-23)
78
-
79
- ### Improvements
80
-
81
- - Update Intel CPU types based on existing Fauxhai data
82
- - Update SPARC logic and 32/64-bit logic for x86 and i386
83
-
84
- ### Bug Fixes
85
-
86
- - Fix 32-bit logic
87
- - Fix default behavior to include chef-sugar at compile time
88
- - Fix Chef 12.1.0 warnings for chef_gem compile time install
89
- - Fix `redhat_enterprise_linux?` matcher
90
-
91
- ## v3.0.2 (2015-03-26)
92
-
93
- ### Improvements
94
-
95
- - Add helpers for `ppc64` and `ppc64le` architecture
96
-
97
- ### Bug Fixes
98
-
99
- - Adjustments to error message
100
-
101
- ## v3.0.1 (2015-03-20)
102
-
103
- ### Breaking Changes
104
-
105
- - Rename `compile_time` `to at_compile_time` - if your recipes are affected by this breaking change, your Chef Client run will produce a verbose error message with details on how to fix the error.
106
-
107
- ## v3.0.0 (2015-03-17)
108
-
109
- ### Breaking Changes
110
-
111
- - Drop support for Ruby 1.9 (it might still work, but it is no longer officially supported)
112
-
113
- ### Improvements
114
-
115
- - Remove accidentially committed gem source
116
- - Bump development dependencies
117
- - Add `digitalocean?` matcher
118
- - Expose the `rhel` platform as `el`
119
- - Add `ppc64le` platform
120
- - Add helper for determining if architecture is SPARC
121
- - Add helper for determining if architecture is Intel
122
- - Add dynamic platform/version matchers for Solaris
123
-
124
- ### Bug Fixes
125
-
126
- - Reset namespace_options when reaching top-level resources
127
-
128
- ## v2.5.0 (2015-01-05)
129
-
130
- ### Improvements
131
-
132
- - Add `data_bag_item_for_environment` function
133
- - Add `kvm?` matcher
134
- - Add `virtualbox?` matcher
135
-
136
- ### Bug Fixes
137
-
138
- - Use `.key?` to check for hash key presence, raising an `AttributeDoesNotExist` error sooner
139
-
140
- ## v2.4.1 (2014-10-12)
141
-
142
- - No changes from v2.4.0 - forced a new version upload to the Chef Supermarket
143
-
144
- ## v2.4.0 (2014-10-12)
145
-
146
- ### Improvements
147
-
148
- - Add `docker?` matcher
149
-
150
- ## v2.3.2 (2014-10-07)
151
-
152
- ### Big Fixues
153
-
154
- - Include `amd64` in `_64_bit?` check
155
-
156
- ## v2.3.1 (2014-10-07)
157
-
158
- ### Improvements
159
-
160
- - Check all 64-bit architectures that may be reported by Ohai
161
-
162
- ### Bug Fixes
163
-
164
- - Be more tolerant of `nil` values return from sub functions
165
- - Check to make sure `node['domain']` is not `nil` before calling `#include?`
166
-
167
- ## v2.3.0 (2014-09-24)
168
-
169
- ### Improvements
170
-
171
- - Add `vmware?` matcher
172
- - Allow the attribute DSL to access parent attributes
173
-
174
- ### Bug Fixes
175
-
176
- - Return `true` or `false` from all Boolean methods (instead of `nil` or truthy values)
177
-
178
- ## v2.2.0 (2014-08-20)
179
-
180
- ### Improvements
181
-
182
- - Add `smartos?` matcher
183
- - Add `omnios?` matcher
184
-
185
- ## v2.1.0 (2014-06-26)
186
-
187
- ### Improvements
188
-
189
- - Add `solaris2?` matcher
190
- - Add `aix?` matcher
191
- - Add 'lxc?' matcher
192
-
193
- ### Bug Fixes
194
-
195
- - Fix a bug in namespace memoization during attribute initialization
196
-
197
- ## v2.0.0 (2014-06-16)
198
-
199
- ### Breaking
200
-
201
- - Remove `not_linux?` method
202
- - Remove `not_windows?` method
203
-
204
- ### Improvements
205
-
206
- - Miscellaneous spelling fixes
207
- - Update a failing unit test for `installed?`
208
- - Add Mac OS X to the list of platforms (Yosemite)
209
- - Upgrade to RSpec 3
210
- - Fix `which` (and `installed?` and `installed_at_version?`) when given an absolute path
211
- - Fix `linux?` check to only return true on real linuxes
212
-
213
- ## v1.3.0 (2014-05-05)
214
-
215
- - Check both `$stdout` and `$stderr` in `version_for`
216
- - Add additional platform versions
217
- - Make `includes_recipe?` a top-level API (instead of just Node)
218
- - Match on the highest version number instead of direct equality checking on platform versions
219
- - Define `Object#blank?` as a core extension
220
- - Define `String#flush` as a core extension
221
- - Remove Stove
222
-
223
- ## v1.2.6 (2014-03-16)
224
-
225
- - Fix a bug in `vagrant?` returning false on newer Vagrant versions
226
- - Remove Coveralls
227
-
228
- ## v1.2.4 (2014-03-13)
229
-
230
- - See (1.2.2), but I botched the release
231
-
232
- ## v1.2.2 (2014-03-13)
233
-
234
- - Fix a critical bug with `encrypted_data_bag_item` using the wrong key
235
-
236
- ## v1.2.0 (2014-03-09)
237
-
238
- - Add `namespace` functionality for specifying attributes in a DSL
239
- - Add constraints helpers for comparing version strings
240
- - Add `require_chef_gem` to safely require and degrade if a gem is not installed
241
- - Add `deep_fetch` and `deep_fetch!` to fetch deeply nested keys
242
- - Accept an optional secret key in `encrypted_data_bag_item` helper and raise a helpful error if one is not set (NOTE: this changes the airity of the method, but it's backward-compatible because Ruby is magic)
243
- - Add Stove for releasing
244
- - Updated copyrights for 2014
245
-
246
- ## v1.1.0 (2013-12-10)
247
-
248
- - Add `cloudstack?` helper
249
- - Add data bag helpers
250
- - Remove foodcritic checks
251
- - Upgrade development gem versions
252
- - Randomize spec order
253
-
254
- ## v1.0.1 (2013-10-15)
255
-
256
- - Add development recipe
257
- - Add `compile_time`, `before`, and `after` filters
258
-
259
- ## v1.0.0 (2013-10-15)
260
-
261
- - First public release