Class: RIO::Temp::File::RL

Inherits:
RL::PathBase show all
Defined in:
lib/rio/scheme/temp.rb

Constant Summary collapse

RIOSCHEME =
'tempfile'
DFLT_PREFIX =
Temp::RL::DFLT_PREFIX
DFLT_TMPDIR =
Temp::RL::DFLT_TMPDIR
SPLIT_RE =
Temp::RL::SPLIT_RE

Constants inherited from RL::PathBase

RL::PathBase::RESET_STATE

Constants inherited from RL::URIBase

RL::URIBase::HOST, RL::URIBase::SCHEME

Constants inherited from RL::WithPath

RL::WithPath::HOST, RL::WithPath::SCHEME

Instance Attribute Summary collapse

Attributes inherited from RL::URIBase

#uri

Attributes inherited from RL::Base

#fs

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RL::PathBase

#arg0_info_, #build_arg0_, #fspath, #join, #scheme, #to_s, #url, #use_host?

Methods inherited from RL::URIBase

#_get_base_from_arg, #_get_opts_from_args, #absolute?, #arg0_info_, #base, #base=, #host, #host=, #init_from_args_, #initialize_copy, #join, #opaque, #openfs_, #path, #path=, #pathroot, #scheme, #to_s, #url, #urlpath, #urlpath=, #urlroot

Methods inherited from RL::WithPath

#_build, #_parts, #_uri, #abs, #base, #basename, #build_arg0_, #dirname, #filename, #fspath, #fspath=, #fspath_no_slash, #host, #host=, #is_root?, #join, #merge, #opaque, #openfs_, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #route_from, #route_to, #scheme, #split, #uri, #uri_from_string_, #urlpath, #urlpath=

Methods included from Error::NotImplemented

#nodef

Methods inherited from RL::Base

#==, #===, #=~, #callstr, #escape, #fs2url, #fspath, #initialize_copy, is_riorl?, #length, #openfs_, parse, #path, #rl, split_riorl, subscheme, #to_rl, #to_s, #unescape, #url, #url2fs

Constructor Details

#initialize(file_prefix = DFLT_PREFIX, temp_dir = DFLT_TMPDIR) ⇒ RL

Returns a new instance of RL.



112
113
114
115
116
117
118
119
# File 'lib/rio/scheme/temp.rb', line 112

def initialize(file_prefix=DFLT_PREFIX,temp_dir=DFLT_TMPDIR)
  #puts "initialize(#{file_prefix.inspect},#{temp_dir.inspect})"
  @prefix = file_prefix || DFLT_PREFIX
  @tmpdir = temp_dir || DFLT_TMPDIR
  require 'tempfile'
  @tf = ::Tempfile.new( @prefix.to_s, @tmpdir.to_s)
  super(@tf.path)
end

Instance Attribute Details

#prefixObject (readonly)

Returns the value of attribute prefix.



111
112
113
# File 'lib/rio/scheme/temp.rb', line 111

def prefix
  @prefix
end

#tmpdirObject (readonly)

Returns the value of attribute tmpdir.



111
112
113
# File 'lib/rio/scheme/temp.rb', line 111

def tmpdir
  @tmpdir
end

#tmprlObject (readonly)

Returns the value of attribute tmprl.



111
112
113
# File 'lib/rio/scheme/temp.rb', line 111

def tmprl
  @tmprl
end

Class Method Details

.splitrl(s) ⇒ Object



133
134
135
# File 'lib/rio/scheme/temp.rb', line 133

def self.splitrl(s)
  Temp::RL.splitrl(s)
end

Instance Method Details

#closeObject



128
129
130
131
# File 'lib/rio/scheme/temp.rb', line 128

def close 
  super
  @tf = nil
end

#file_rlObject



120
121
122
123
# File 'lib/rio/scheme/temp.rb', line 120

def file_rl() 
RIO::File::RL.new(self.uri,{:fs => self.fs})
  #self 
end

#open(mode = 'ignored') ⇒ Object

self



124
125
126
127
# File 'lib/rio/scheme/temp.rb', line 124

def open(mode='ignored')
  #p callstr('open',mode)
  @tf
end