chef-sugar-ng 5.1.11 → 5.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f3a0d73198f6a95304bffb888e71b8a1cd8624deda4b8d26d72fc8a471d5b0c
4
- data.tar.gz: ab5ec28695feaeabb309a0512b8abc9ba2040373466a24f8bd586baa1afb9cb1
3
+ metadata.gz: 7d73ddc0e538ed51271f55531558fdc8c7748ac7df018b37f9f912fad99b852b
4
+ data.tar.gz: 51ea5a46956cf3b068c7e9218aae7ca04324fae9ebb535cb77634e8e6e8fb047
5
5
  SHA512:
6
- metadata.gz: 0f43ba45941a1656b841bc262593d62a42a8b9171de825b20fc299f2e03d5ecc358b7406ccb021bf00e60904704df264c5c1a9c750d0dc7411135aae1486f2ae
7
- data.tar.gz: 1f5f043631164b7c7b68d30c0fa4b41a39281e8dcb75e44cd668af608245a2d8ad44f51e2401184dfb131f26d9572d34da512c140b02c71f5ceb44970856b52e
6
+ metadata.gz: 61d31094e15498f631a694e2c59f1ab5a0f640ce7906a858ac014291e48dbf3d4570218506b0a4bc160a44806d97eaed9a385bab00a8b1aca12b03ac04760047
7
+ data.tar.gz: e514dae7702488d82585af62f6239cb0c503a4faed0745de156c2bb1fed1df3f5c56fc24bbeee92f4225c22d3f7d8be22bab365a89a96575185ce8fa470761e0
@@ -22,26 +22,29 @@ class Chef
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
 
@@ -128,8 +131,11 @@ class Chef
128
131
  end
129
132
 
130
133
  module DSL
131
- # @see Chef::Sugar::Shell#which
132
- 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
133
139
 
134
140
  # @see Chef::Sugar::Shell#dev_null
135
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.1.11"
19
+ VERSION = "5.1.12"
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar-ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.11
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: 2020-08-14 00:00:00.000000000 Z
11
+ date: 2020-11-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A series of helpful sugar of the Chef core and other resources to make
14
14
  a cleaner, more lean recipe DSL, enforce DRY principles, and make writing Chef recipes