Class: Dustcart::Resource::Input::File

Inherits:
FileBase show all
Defined in:
lib/dustcart/input/file.rb

Overview

input: file

Instance Attribute Summary

Attributes inherited from FileBase

#from

Attributes inherited from Base

#attributes, #dump_dir

Instance Method Summary collapse

Methods inherited from FileBase

#initialize

Methods inherited from Base

#initialize

Methods inherited from Base

define_attribute, inherited, #initialize, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from Dustcart::Resource::Input::FileBase

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dustcart::Resource::Base

Instance Method Details

#precheckObject



8
9
10
11
12
13
14
# File 'lib/dustcart/input/file.rb', line 8

def precheck
  super

  raise "    target(\#{from}) is not a regular file\n  EOS\nend\n".unindent unless Object::File.file?(from)

#runObject



16
17
18
19
20
21
# File 'lib/dustcart/input/file.rb', line 16

def run
  super

  target = "#{to_dir}/#{label}"
  FileUtils.cp(from, target)
end