chef-sugar 5.1.11 → 5.1.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 690f59ffaeb7464fa9481cb0c30dee73950e32c86012ecf5c6a44c944cb695c2
4
- data.tar.gz: b76c63eeb5479c9af859397c1b0bc10d2f7f7082586013462b8d63ecccb9fb33
3
+ metadata.gz: 94b5873d50542962ae3acca1cec3b6048571e37006eac04fc67c293bb1ee6124
4
+ data.tar.gz: cf7ed6690f5c776cbcd74cd9c24d7835648f969249639b95aceb4abf92e14393
5
5
  SHA512:
6
- metadata.gz: 2d2d0f8894504caeacff01c363300b300ffd776bb71ba0005ff316cc312c4c5726bee7fd2c0afa81cac6b30c2c62eb666a1acd14bb681ae30f736fcb777796c5
7
- data.tar.gz: 5962221ffaacb4ec6fcb56234aad9d850b324db2d94c1ddffc012e64cf44ede469942ccdce336ac7844a7510f1a26ffd9e76052e7d0e385f0566067162b262a0
6
+ metadata.gz: cdd5ae08d1a99bbc636ccf8a4a9883fb88517c07c1a0b16331769ce336ec62a86ab3238bfe6d44ef1afc7276bca331086ba9d9ee332878cdfdc5e293fffabe71
7
+ data.tar.gz: 0a2e1e8b50db3258aec7b4cd482345059da8bb66c912eaf5bb9a7ac12ec0705c10ddf35f48082a58dbfebc4497c2ed7e79f09b5d140b4105d10b66e32eb8f061
@@ -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
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