Class: Pione::Location::LocalScheme

Inherits:
Pione::LocationScheme show all
Defined in:
lib/pione/location/local-scheme.rb

Overview

Local represents local file system path.

Examples:

# absolute path form
local:/home/keita/
# relative path form
local:./test.txt

Constant Summary collapse

COMPONENT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[:scheme, :path]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/pione/location/local-scheme.rb', line 15

def self.build(args)
  super(URI::Util::make_components_hash(self, args))
end

Instance Method Details

#absoluteURI

Returns absolute path.

Returns:

  • (URI)

    URI with absolute path



22
23
24
25
# File 'lib/pione/location/local-scheme.rb', line 22

def absolute
  uri = URI.parse("%s:%s" % [scheme, File.expand_path(path, Global.pwd)])
  directory? ? uri.as_directory : uri
end