Class: String
- Inherits:
-
Object
- Object
- String
- 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
-
#esc ⇒ Object
adding quotes around the string.
-
#to_osPath ⇒ Object
convert the string to a path notation of the current operating system.
-
#to_rubyPath ⇒ Object
convert the string to a path notation of ruby.
Instance Method Details
#esc ⇒ Object
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_osPath ⇒ Object
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_rubyPath ⇒ Object
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 |