chef-utils 18.5.0 → 18.7.3
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 +4 -4
- data/lib/chef-utils/dsl/which.rb +6 -4
- data/lib/chef-utils/version.rb +1 -1
- data/lib/chef-utils.rb +0 -1
- metadata +2 -3
- data/lib/chef-utils/dsl/backend.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7048f4889215274d56a53660fc5ec48891bb0649b499c822aafbb52690ec5d1
|
4
|
+
data.tar.gz: 37eb1d8aece793bec2ceb64374db96ee778643034400a79ad8ea6c38a59549db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9941eaeb9278bdfdf463782aa301e96d916ccd53dc70486cbd40228372153786695100aaa327fe7b5fedf53b9270cd0571ef599547355f98155089470b1f1af
|
7
|
+
data.tar.gz: 6fccc5388154d596ddfadeb992c3816234b7cae217242a5e06244ab2f2d222780530622a84fa62089cd57a560ec29c6603cf6dc5963cc7c2bd815a2ff1b0d46d
|
data/lib/chef-utils/dsl/which.rb
CHANGED
@@ -46,11 +46,12 @@ module ChefUtils
|
|
46
46
|
# end
|
47
47
|
#
|
48
48
|
# @param [Array<String>] list of commands to search for
|
49
|
+
# @param [String,Array<String>] array of paths to look in first
|
49
50
|
# @param [String,Array<String>] array of extra paths to search through
|
50
51
|
# @return [String] the first match
|
51
52
|
#
|
52
|
-
def which(*cmds, extra_path: nil, &block)
|
53
|
-
where(*cmds, extra_path: extra_path, &block).first || false
|
53
|
+
def which(*cmds, prepend_path: nil, extra_path: nil, &block)
|
54
|
+
where(*cmds, prepend_path: prepend_path, extra_path: extra_path, &block).first || false
|
54
55
|
end
|
55
56
|
|
56
57
|
# Lookup all the instances of an an executable that can be found through the systems search PATH.
|
@@ -73,12 +74,13 @@ module ChefUtils
|
|
73
74
|
# end
|
74
75
|
#
|
75
76
|
# @param [Array<String>] list of commands to search for
|
77
|
+
# @param [String,Array<String>] array of paths to look in first
|
76
78
|
# @param [String,Array<String>] array of extra paths to search through
|
77
79
|
# @return [String] the first match
|
78
80
|
#
|
79
|
-
def where(*cmds, extra_path: nil, &block)
|
81
|
+
def where(*cmds, prepend_path: nil, extra_path: nil, &block)
|
80
82
|
extra_path ||= __extra_path
|
81
|
-
paths = __env_path.split(File::PATH_SEPARATOR) + Array(extra_path)
|
83
|
+
paths = Array(prepend_path) + __env_path.split(File::PATH_SEPARATOR) + Array(extra_path)
|
82
84
|
paths.uniq!
|
83
85
|
exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : []
|
84
86
|
exts.unshift("")
|
data/lib/chef-utils/version.rb
CHANGED
data/lib/chef-utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 18.
|
4
|
+
version: 18.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -37,7 +37,6 @@ files:
|
|
37
37
|
- lib/chef-utils.rb
|
38
38
|
- lib/chef-utils/dist.rb
|
39
39
|
- lib/chef-utils/dsl/architecture.rb
|
40
|
-
- lib/chef-utils/dsl/backend.rb
|
41
40
|
- lib/chef-utils/dsl/cloud.rb
|
42
41
|
- lib/chef-utils/dsl/default_paths.rb
|
43
42
|
- lib/chef-utils/dsl/introspection.rb
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module ChefUtils
|
2
|
-
module DSL
|
3
|
-
module Backend
|
4
|
-
include Internal
|
5
|
-
|
6
|
-
# Determine if the backend is local
|
7
|
-
#
|
8
|
-
# @param [Chef::Node] node the node to check
|
9
|
-
#
|
10
|
-
# @return [Boolean]
|
11
|
-
#
|
12
|
-
def local_mode?
|
13
|
-
node["platform_backend"] == "local"
|
14
|
-
end
|
15
|
-
|
16
|
-
# Determine if the backend is remote
|
17
|
-
#
|
18
|
-
# @param [Chef::Node] node the node to check
|
19
|
-
#
|
20
|
-
# @return [Boolean]
|
21
|
-
#
|
22
|
-
def target_mode?
|
23
|
-
node["platform_backend"] != "local"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|