lib/leap_cli/path.rb in leap_cli-1.8.1 vs lib/leap_cli/path.rb in leap_cli-1.9
- old
+ new
@@ -1,11 +1,11 @@
require 'fileutils'
module LeapCli; module Path
def self.platform
- @platform
+ @platform ||= nil
end
def self.provider_base
"#{platform}/provider_base"
end
@@ -38,18 +38,18 @@
#
def self.find_file(arg)
[Path.provider, Path.provider_base].each do |base|
if arg.is_a?(Symbol) || arg.is_a?(Array)
named_path(arg, base).tap {|path|
- return path if File.exists?(path)
+ return path if File.exist?(path)
}
else
File.join(base, arg).tap {|path|
- return path if File.exists?(path)
+ return path if File.exist?(path)
}
File.join(base, 'files', arg).tap {|path|
- return path if File.exists?(path)
+ return path if File.exist?(path)
}
end
end
return nil
end
@@ -81,10 +81,10 @@
return name
end
end
def self.exists?(name, provider_dir=nil)
- File.exists?(named_path(name, provider_dir))
+ File.exist?(named_path(name, provider_dir))
end
def self.defined?(name)
Leap::Platform.paths[name]
end