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

Version Path
rake-delphi-0.0.26 lib/rake/helpers/file.rb
rake-delphi-0.0.25 lib/rake/helpers/file.rb
rake-delphi-0.0.24 lib/rake/helpers/file.rb
rake-delphi-0.0.23 lib/rake/helpers/file.rb
rake-delphi-0.0.22 lib/rake/helpers/file.rb
rake-delphi-0.0.21 lib/rake/helpers/file.rb
rake-delphi-0.0.20 lib/rake/helpers/file.rb
rake-delphi-0.0.19 lib/rake/helpers/file.rb
rake-delphi-0.0.18 lib/rake/helpers/file.rb
rake-delphi-0.0.17 lib/rake/helpers/file.rb
rake-delphi-0.0.16 lib/rake/helpers/file.rb
rake-delphi-0.0.15 lib/rake/helpers/file.rb
rake-delphi-0.0.14 lib/rake/helpers/file.rb
rake-delphi-0.0.13 lib/rake/helpers/file.rb
rake-delphi-0.0.12 lib/rake/helpers/file.rb
rake-delphi-0.0.11 lib/rake/helpers/file.rb
rake-delphi-0.0.9 lib/rake/helpers/file.rb
rake-delphi-0.0.8 lib/rake/helpers/file.rb
rake-delphi-0.0.7 lib/rake/helpers/file.rb