Sha256: 78a88f6b33657924cf32d33d3c9386b9db43545a93375435866297622c11c44d
Contents?: true
Size: 826 Bytes
Versions: 19
Compression:
Stored size: 826 Bytes
Contents
# encoding: utf-8 class File @@separator = nil def self.cygwin? RUBY_PLATFORM.downcase.include?('cygwin') end def self.separator return @@separator if @@separator # Return `backlash` for Cygwin and Windows (ALT_SEPARATOR) # otherwise - system separator return @@separator = cygwin? ? '\\' : (ALT_SEPARATOR ? ALT_SEPARATOR : SEPARATOR) end def self.cygpath(path, flag = nil) flag ||= '-w' # convert to Windows path path = `cygpath #{flag} "#{path}"`.chomp end def self.expand_path2(path, flag = nil) path = expand_path(path) return path unless cygwin? return cygpath(path, flag) end def self.dirname2(path, flag = nil) path = dirname(path) return path unless cygwin? path = cygpath(path, flag) path.gsub!('\\', '\\\\') unless flag path end end
Version data entries
19 entries across 19 versions & 1 rubygems