Class: RIO::RL::PathBase
Constant Summary
collapse
- RESET_STATE =
'Path::Reset'
Instance Attribute Summary
Attributes inherited from URIBase
#uri
Attributes inherited from Base
#fs
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from URIBase
#_get_base_from_arg, #_get_opts_from_args, #absolute?, #base, #base=, #host, #host=, #init_from_args_, #initialize, #initialize_copy, #opaque, #openfs_, parse, #path, #path=, #pathroot, #urlpath, #urlpath=, #urlroot
Methods inherited from WithPath
#_build, #_parts, #_uri, #abs, #base, #basename, #dirname, #filename, #fspath, #fspath=, #fspath_no_slash, #host, #host=, #is_root?, #merge, #opaque, #openfs_, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #route_from, #route_to, #split, #uri, #uri_from_string_, #urlpath, #urlpath=
#nodef
Methods inherited from Base
#==, #===, #=~, #callstr, #close, #fspath, #initialize, #initialize_copy, is_riorl?, #length, #openfs_, parse, #path, #rl, split_riorl, subscheme, #to_rl
Class Method Details
.splitrl(s) ⇒ Object
70
71
72
73
74
75
76
|
# File 'lib/rio/rl/path.rb', line 70
def self.splitrl(s)
sch,opq,whole = split_riorl(s)
case sch
when 'file' then [whole]
else [opq]
end
end
|
Instance Method Details
#arg0_info_(arg0, *args) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/rio/rl/path.rb', line 35
def arg0_info_(arg0,*args)
vuri,vbase,vfs = nil,nil,nil
case arg0
when RIO::Rio, URIBase, ::Alt::URI::Base, ::Alt::URI::File
return super
when ::String
vuri = uri_from_string_(arg0) || ::Alt::URI.parse(arg0)
else
raise(ArgumentError,"'#{arg0}'[#{arg0.class}] can not be used to create a Rio")
end
[vuri,vbase,vfs]
end
|
#build_arg0_(path_str) ⇒ Object
47
48
49
|
# File 'lib/rio/rl/path.rb', line 47
def build_arg0_(path_str)
RL.url2fs(path_str)
end
|
#join(*args) ⇒ Object
63
64
65
66
|
# File 'lib/rio/rl/path.rb', line 63
def join(*args)
return self if args.empty?
join_(args.map{ |arg| arg.to_s})
end
|
50
51
52
|
# File 'lib/rio/rl/path.rb', line 50
def scheme()
uri.scheme || 'path'
end
|
67
68
69
|
# File 'lib/rio/rl/path.rb', line 67
def to_s()
self.fspath
end
|
53
54
55
56
57
|
# File 'lib/rio/rl/path.rb', line 53
def url
str = uri.to_s
str = scheme + ':' +str unless uri.scheme
str
end
|
#use_host? ⇒ Boolean
58
59
60
61
|
# File 'lib/rio/rl/path.rb', line 58
def use_host?
hst = uri.host
!(hst.nil? || hst.empty? || hst == 'localhost')
end
|