Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/ktcommon/ktpath.rb

Overview

Add path conversion functionality to File class

Class Method Summary collapse

Class Method Details

.rubypath(path) ⇒ Object

Convert windows file path seperators to forward slashes.

path

path to convert



19
20
21
# File 'lib/ktcommon/ktpath.rb', line 19

def rubypath path
  return path.gsub(/\\/, "/")
end

.winpath(path) ⇒ Object

Convert forward slashes to windows file path seperators (back slashes).

path

path to convert



25
26
27
# File 'lib/ktcommon/ktpath.rb', line 25

def winpath path
  return path.gsub(/\//, "\\")
end