Class: RIO::Temp::Dir::RRL
- Inherits:
-
RRL::PathBase
- Object
- RRL::Base
- RRL::WithPath
- RRL::URIBase
- RRL::PathBase
- RIO::Temp::Dir::RRL
- Extended by:
- Fwd
- Defined in:
- lib/rio/scheme/temp.rb
Constant Summary collapse
- RIOSCHEME =
'tempdir'
- DFLT_PREFIX =
Temp::RRL::DFLT_PREFIX
- DFLT_TMPDIR =
Temp::RRL::DFLT_TMPDIR
Constants inherited from RRL::PathBase
Instance Attribute Summary
Attributes inherited from RRL::Base
Instance Method Summary collapse
- #dir_rl ⇒ Object
-
#initialize(u, file_prefix = DFLT_PREFIX, temp_dir = DFLT_TMPDIR) ⇒ RRL
constructor
A new instance of RRL.
Methods included from Fwd
fwd, fwd_reader, fwd_readers, fwd_writer, fwd_writers
Methods inherited from RRL::PathBase
Methods inherited from RRL::URIBase
#initialize_copy, #openfs_, parse
Methods inherited from RRL::WithPath
#absolute?, #base, #base=, #fspath_no_slash, #host, #host=, #opaque, #openfs_, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #scheme, #split
Methods included from Error::NotImplemented
Methods inherited from RRL::Base
#==, #===, #=~, #callstr, #close, #initialize_copy, #length, #openfs_, parse, #to_s, #url
Constructor Details
#initialize(u, file_prefix = DFLT_PREFIX, temp_dir = DFLT_TMPDIR) ⇒ RRL
Returns a new instance of RRL.
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/rio/scheme/temp.rb', line 67 def initialize(u,file_prefix=DFLT_PREFIX,temp_dir=DFLT_TMPDIR) require 'rio/tempdir' alturi = case u when ::Alt::URI::Base then u else ::Alt::URI.parse(u.to_s) end prefix = alturi.query || file_prefix.to_s tmpdir = (alturi.path.nil? || alturi.path.empty?) ? temp_dir.to_s : alturi.path td = ::Tempdir.new( prefix, tmpdir) td = "file:///" + td.to_s if td.to_s =~ /^[a-zA-Z]:/ super(td.to_s) end |