class File

Public Class Methods

cygpath(path, flag = nil) click to toggle source
# File lib/rake/helpers/file.rb, line 16
def self.cygpath(path, flag = nil)
        flag ||= '-w'
        # convert to Windows path
        path = `cygpath #{flag} "#{path}"`.chomp
end
cygwin?() click to toggle source
# File lib/rake/helpers/file.rb, line 5
def self.cygwin?
        RUBY_PLATFORM.downcase.include?('cygwin')
end
dirname2(path, flag = nil) click to toggle source
# File lib/rake/helpers/file.rb, line 28
def self.dirname2(path, flag = nil)
        path = dirname(path)
        return path unless cygwin?
        path = cygpath(path, flag)
        path.gsub!('\\', '\\\\') unless flag
        path
end
expand_path2(path, flag = nil) click to toggle source
# File lib/rake/helpers/file.rb, line 22
def self.expand_path2(path, flag = nil)
        path = expand_path(path)
        return path unless cygwin?
        return cygpath(path, flag)
end
separator() click to toggle source
# File lib/rake/helpers/file.rb, line 9
def self.separator
        return @@separator if @@separator
        # Return `backlash` for Cygwin and Windows (ALT_SEPARATOR)
        # otherwise - system separator
        return @@separator = cygwin? ? '\\' : (ALT_SEPARATOR || SEPARATOR)
end