chef-sugar 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 +4 -4
- data/lib/chef/sugar/shell.rb +27 -21
- data/lib/chef/sugar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94b5873d50542962ae3acca1cec3b6048571e37006eac04fc67c293bb1ee6124
|
4
|
+
data.tar.gz: cf7ed6690f5c776cbcd74cd9c24d7835648f969249639b95aceb4abf92e14393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd5ae08d1a99bbc636ccf8a4a9883fb88517c07c1a0b16331769ce336ec62a86ab3238bfe6d44ef1afc7276bca331086ba9d9ee332878cdfdc5e293fffabe71
|
7
|
+
data.tar.gz: 0a2e1e8b50db3258aec7b4cd482345059da8bb66c912eaf5bb9a7ac12ec0705c10ddf35f48082a58dbfebc4497c2ed7e79f09b5d140b4105d10b66e32eb8f061
|
data/lib/chef/sugar/shell.rb
CHANGED
@@ -22,26 +22,29 @@ class Chef
|
|
22
22
|
module Shell
|
23
23
|
extend self
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
#
|
132
|
-
|
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
|
data/lib/chef/sugar/version.rb
CHANGED
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.
|
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-
|
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
|