chef-sugar-ng 5.0.3 → 5.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,34 +14,37 @@
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
22
22
  module Shell
23
23
  extend self
24
24
 
25
- #
26
- # Finds a command in $PATH
27
- #
28
- # @param [String] cmd
29
- # the command to find
30
- #
31
- # @return [String, nil]
32
- #
33
- def which(cmd)
34
- if Pathname.new(cmd).absolute?
35
- File.executable?(cmd) ? cmd : nil
36
- else
37
- paths = ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin)
38
-
39
- paths.each do |path|
40
- possible = File.join(path, cmd)
41
- return possible if File.executable?(possible)
25
+ # this helper has been moved to core chef
26
+ if !defined?(Chef::VERSION) || Gem::Requirement.new("< 16.0.257").satisfied_by?(Gem::Version.new(Chef::VERSION))
27
+ #
28
+ # Finds a command in $PATH
29
+ #
30
+ # @param [String] cmd
31
+ # the command to find
32
+ #
33
+ # @return [String, nil]
34
+ #
35
+ def which(cmd)
36
+ if Pathname.new(cmd).absolute?
37
+ File.executable?(cmd) ? cmd : nil
38
+ else
39
+ paths = ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin)
40
+
41
+ paths.each do |path|
42
+ possible = File.join(path, cmd)
43
+ return possible if File.executable?(possible)
44
+ end
45
+
46
+ nil
42
47
  end
43
-
44
- nil
45
48
  end
46
49
  end
47
50
 
@@ -51,7 +54,11 @@ class Chef
51
54
  # @return [String]
52
55
  #
53
56
  def dev_null(node)
54
- Chef::Sugar::PlatformFamily.windows?(node) ? 'NUL' : '/dev/null'
57
+ if defined?(ChefUtils)
58
+ ChefUtils.windows?(node) ? 'NUL' : '/dev/null'
59
+ else
60
+ Chef::Sugar::PlatformFamily.windows?(node) ? 'NUL' : '/dev/null'
61
+ end
55
62
  end
56
63
 
57
64
  #
@@ -124,8 +131,11 @@ class Chef
124
131
  end
125
132
 
126
133
  module DSL
127
- # @see Chef::Sugar::Shell#which
128
- def which(cmd); Chef::Sugar::Shell.which(cmd); end
134
+ # this helper has been moved to core chef
135
+ if !defined?(Chef::VERSION) || Gem::Requirement.new("< 16.0.257").satisfied_by?(Gem::Version.new(Chef::VERSION))
136
+ # @see Chef::Sugar::Shell#which
137
+ def which(cmd); Chef::Sugar::Shell.which(cmd); end
138
+ end
129
139
 
130
140
  # @see Chef::Sugar::Shell#dev_null
131
141
  def dev_null; Chef::Sugar::Shell.dev_null(node); end
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '5.0.3'
19
+ VERSION = "5.1.12"
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,85 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar-ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-19 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: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
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-11-11 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!
@@ -100,6 +30,7 @@ files:
100
30
  - lib/chef/sugar/core_extensions/object.rb
101
31
  - lib/chef/sugar/core_extensions/string.rb
102
32
  - lib/chef/sugar/data_bag.rb
33
+ - lib/chef/sugar/deprecation.rb
103
34
  - lib/chef/sugar/docker.rb
104
35
  - lib/chef/sugar/filters.rb
105
36
  - lib/chef/sugar/init.rb
@@ -115,9 +46,9 @@ files:
115
46
  - lib/chef/sugar/vagrant.rb
116
47
  - lib/chef/sugar/version.rb
117
48
  - lib/chef/sugar/virtualization.rb
118
- homepage: https://github.com/sethvargo/chef-sugar
49
+ homepage: https://github.com/chef/chef-sugar
119
50
  licenses:
120
- - Apache 2.0
51
+ - Apache-2.0
121
52
  metadata: {}
122
53
  post_install_message:
123
54
  rdoc_options: []
@@ -127,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
58
  requirements:
128
59
  - - ">="
129
60
  - !ruby/object:Gem::Version
130
- version: 2.2.2
61
+ version: '2.3'
131
62
  required_rubygems_version: !ruby/object:Gem::Requirement
132
63
  requirements:
133
64
  - - ">="