lib/repertoire/compat.rb in repertoire-0.1.2 vs lib/repertoire/compat.rb in repertoire-0.2.0
- old
+ new
@@ -15,13 +15,14 @@
#
# Returns an array representing the +PATH+ environment variable.
# If the +PATH+ environment variable is not setup, an empty array will
# be returned.
#
- # Compat.PATH #=> ["/bin", "/usr/bin"]
+ # Compat.paths
+ # #=> ["/bin", "/usr/bin"]
#
- def self.PATH
+ def self.paths
# return an empty array in case
# the PATH variable does not exist
return [] unless ENV['PATH']
if self.platform =~ /mswin32/
@@ -36,10 +37,10 @@
# If the program was not found, +nil+ will be returned.
#
# Compat.find_program('as') #=> "/usr/bin/as"
#
def self.find_program(name)
- self.PATH.each do |dir|
+ self.paths.each do |dir|
full_path = File.expand_path(File.join(dir,name))
return full_path if File.file?(full_path)
end