Class: RIO::Temp::Dir::RRL

Inherits:
RRL::PathBase show all
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

RRL::PathBase::RESET_STATE

Instance Attribute Summary

Attributes inherited from RRL::Base

#fs, #uri

Instance Method Summary collapse

Methods included from Fwd

fwd, fwd_reader, fwd_readers, fwd_writer, fwd_writers

Methods inherited from RRL::PathBase

#to_s

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

#nodef

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

Instance Method Details

#dir_rlObject



85
86
87
# File 'lib/rio/scheme/temp.rb', line 85

def dir_rl() 
  RIO::Dir::RRL.new(self.uri, {:fs => self.fs})
end