fedux_org-stdlib 0.0.24 → 0.0.25
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.
- data/lib/fedux_org/stdlib/command.rb +19 -19
- data/lib/fedux_org/stdlib/version.rb +1 -1
- metadata +1 -1
@@ -47,25 +47,25 @@ module FeduxOrg
|
|
47
47
|
|
48
48
|
result
|
49
49
|
end
|
50
|
-
|
51
|
-
# Search for command
|
52
|
-
# @param [String] cmd
|
53
|
-
# name of command
|
54
|
-
#
|
55
|
-
# @return [String]
|
56
|
-
# path to command
|
57
|
-
def which(cmd)
|
58
|
-
return nil if cmd.blank?
|
59
|
-
|
60
|
-
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
61
|
-
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
62
|
-
exts.each do |ext|
|
63
|
-
exe = File.join(path, "#{cmd}#{ext}")
|
64
|
-
return exe if File.executable? exe
|
65
|
-
end
|
66
|
-
end
|
67
|
-
nil
|
68
|
-
end
|
69
50
|
|
51
|
+
# Search for command
|
52
|
+
# @param [String] cmd
|
53
|
+
# name of command
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
# path to command
|
57
|
+
def which(cmd)
|
58
|
+
return nil if cmd.blank?
|
59
|
+
|
60
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
61
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
62
|
+
exts.each do |ext|
|
63
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
64
|
+
return exe if File.executable? exe
|
65
|
+
end
|
66
|
+
end
|
67
|
+
nil
|
68
|
+
end
|
69
|
+
end
|
70
70
|
end
|
71
71
|
end
|