Module: RIO::RL

Defined in:
lib/rio/rl/fs2url.rb,
lib/rio/rl/ioi.rb,
lib/rio/rl/ioi.rb,
lib/rio/rl/uri.rb,
lib/rio/rl/base.rb,
lib/rio/rl/path.rb,
lib/rio/rl/chmap.rb,
lib/rio/rl/builder.rb,
lib/rio/rl/withpath.rb,
lib/rio/rl/withpath.rb,
lib/rio/rl/withpath.rb,
lib/rio/rl/pathmethods.rb

Overview

:nodoc: all

Defined Under Namespace

Modules: PathMethods, PathUtil Classes: Base, Builder, IOIBase, PathBase, SysIOBase, URIBase, WithPath

Constant Summary collapse

SCHEME =
'rio'
SCHC =
SCHEME+':'
SPLIT_RIORL_RE =
%r{\A([a-z][a-z]+)(?:(:)(.*))?\Z}.freeze
SUBSEPAR =
':'
CHMAP =
{ 
  ?_    => 'sysio',
  ?-    => 'stdio',
  ?=    => 'stderr',
  ?"    => 'strio',
  ??    => 'temp',
  ?[    => 'aryio',
  ?`    => 'cmdio',
  ?|    => 'cmdpipe',
  ?#    => 'fd',
  ?z    => 'zipfile',
}.freeze
PESCAPE =
Regexp.new("[^-_.!~*'()a-zA-Z0-9;?:@&=+$,]",false).freeze
ESCAPE =
Regexp.new("[^-_.!~*'()a-zA-Z0-9;\/?:@&=+$,]",false).freeze

Class Method Summary collapse

Class Method Details

.escape(pth, esc = ESCAPE) ⇒ Object



35
36
37
# File 'lib/rio/rl/fs2url.rb', line 35

def escape(pth,esc=ESCAPE)
  ::URI.escape(pth,esc)
end

.fs2url(pth, esc = ESCAPE) ⇒ Object



44
45
46
47
48
# File 'lib/rio/rl/fs2url.rb', line 44

def fs2url(pth, esc=ESCAPE)
  pth = URI.escape(pth,esc)
  pth = '/' + pth if pth =~ /^[a-zA-Z]:/
  pth
end

.fs2urls(*args) ⇒ Object



41
42
43
# File 'lib/rio/rl/fs2url.rb', line 41

def fs2urls(*args)
  args.map{ |pth| fs2url(pth) }
end

.getwdObject



58
59
60
# File 'lib/rio/rl/fs2url.rb', line 58

def getwd()
  ::URI::FILE.build({:path => fs2url(::Dir.getwd)})
end

.unescape(pth) ⇒ Object



38
39
40
# File 'lib/rio/rl/fs2url.rb', line 38

def unescape(pth)
  ::URI.unescape(pth)
end

.url2fs(pth) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/rio/rl/fs2url.rb', line 50

def url2fs(pth)
  pth = ::URI.unescape(pth)
  if pth =~ %r#^/[a-zA-Z]:#
    pth = pth[1..-1] 
  end
  pth
end