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



222
223
224
# File 'lib/rio/cp.rb', line 222

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

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



225
226
227
# File 'lib/rio/cp.rb', line 225

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

#copy_as_file?(arg) ⇒ Boolean

Returns:

  • (Boolean)


230
231
232
# File 'lib/rio/cp.rb', line 230

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

#spcp(arg) ⇒ Object



233
234
235
236
237
238
239
240
# File 'lib/rio/cp.rb', line 233

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