Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/wortsammler/class.proolib.rb

Overview

This mixin convertes a file path to the os Path representation todo maybe replace this by a builtin ruby stuff such as “pathname”

Instance Method Summary collapse

Instance Method Details

#escObject

adding quotes around the string. Main purpose is to escape blanks in file paths.



72
73
74
# File 'lib/wortsammler/class.proolib.rb', line 72

def esc
  "\"#{self}\""
end

#to_osPathObject

convert the string to a path notation of the current operating system



61
62
63
# File 'lib/wortsammler/class.proolib.rb', line 61

def to_osPath
  gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
end

#to_rubyPathObject

convert the string to a path notation of ruby.



66
67
68
# File 'lib/wortsammler/class.proolib.rb', line 66

def to_rubyPath
  gsub(File::ALT_SEPARATOR || File::SEPARATOR, File::SEPARATOR)
end