Module: FetchAndProcess::LocalFile

Defined in:
lib/fetch_and_process/local_file.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/fetch_and_process/local_file.rb', line 8

def self.included(base)
  base.add_handler('file', :file_handler)
end

Instance Method Details

#file_handlerObject



12
13
14
15
16
17
# File 'lib/fetch_and_process/local_file.rb', line 12

def file_handler
  from = uri.to_s.sub(%r{^file://}, '')
  from = "./#{from}" if from[0] != '/'
  FileUtils.cp from, cache_location
  cache_location
end