class Origami::Filename

Class used to convert system-dependent pathes into PDF pathes. PDF path specification offers a single form for representing file pathes over operating systems.

Public Class Methods

DOS(file) click to toggle source

Converts Windows file path into PDF file path.

# File lib/origami/filespec.rb, line 104
def DOS(file)
    path = ""
    # Absolute vs relative path
    if file.include? ":"
        path << "/"
        file.sub!(":","")
    end

    file.tr!("\\", "/")
    LiteralString.new(path + file)
end
Mac(file) click to toggle source

Converts MacOS file path into PDF file path.

# File lib/origami/filespec.rb, line 97
def Mac(file)
    LiteralString.new("/" + file.tr(":", "/"))
end
Unix(file) click to toggle source

Converts UNIX file path into PDF file path.

# File lib/origami/filespec.rb, line 90
def Unix(file)
    LiteralString.new(file)
end