Module: RIO::Cp::File::Input

Includes:
Util::Input
Included in:
Ops::File::Existing
Defined in:
lib/rio/cp.rb

Instance Method Summary collapse

Methods included from Util::InOut

#cpclose, #cpclose0

Instance Method Details

#>(arg) ⇒ Object Also known as: copy_to



208
209
210
# File 'lib/rio/cp.rb', line 208

def >(arg)  
  spcp(arg) || cpclose(arg) { self.iostate(:>) > arg  } 
end

#>>(arg) ⇒ Object Also known as: append_to



211
212
213
# File 'lib/rio/cp.rb', line 211

def >>(arg) 
  spcp(arg) || cpclose(arg) { self.iostate(:>>) >> arg } 
end

#copy_as_file?(arg) ⇒ Boolean

Returns:

  • (Boolean)


216
217
218
# File 'lib/rio/cp.rb', line 216

def copy_as_file?(arg)
  arg.kind_of?(Rio) and arg.scheme == 'ftp'
end

#spcp(arg) ⇒ Object



219
220
221
222
223
224
225
226
# File 'lib/rio/cp.rb', line 219

def spcp(arg)
  if arg.kind_of?(Rio) and arg.scheme == 'ftp'
    arg.copy_from(new_rio(rl.path))
    self
  else
    nil
  end
end