28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/chef-utils/dsl/default_paths.rb', line 28
def default_paths(env = nil)
env_path = env ? env["PATH"] : __env_path
env_path = "" if env_path.nil?
path_separator = ChefUtils.windows? ? ";" : ":"
new_paths = env_path.split(path_separator)
[ __ruby_bindir, __gem_bindir ].compact.each do |path|
new_paths = [ path ] + new_paths unless new_paths.include?(path)
end
__default_paths.each do |path|
new_paths << path unless new_paths.include?(path)
end
new_paths.join(path_separator).encode("utf-8", invalid: :replace, undef: :replace)
end
|