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 +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: 7d73ddc0e538ed51271f55531558fdc8c7748ac7df018b37f9f912fad99b852b
|
4
|
+
data.tar.gz: 51ea5a46956cf3b068c7e9218aae7ca04324fae9ebb535cb77634e8e6e8fb047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d31094e15498f631a694e2c59f1ab5a0f640ce7906a858ac014291e48dbf3d4570218506b0a4bc160a44806d97eaed9a385bab00a8b1aca12b03ac04760047
|
7
|
+
data.tar.gz: e514dae7702488d82585af62f6239cb0c503a4faed0745de156c2bb1fed1df3f5c56fc24bbeee92f4225c22d3f7d8be22bab365a89a96575185ce8fa470761e0
|
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-ng
|
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
|