Class: Alula::DummyProcessor

Inherits:
Processor show all
Defined in:
lib/alula/processors/dummy.rb

Instance Attribute Summary

Attributes inherited from Processor

#attachments, #item, #options, #site

Instance Method Summary collapse

Methods inherited from Processor

#asset_path, available?, #cleanup, #info, #initialize, mimetype, process?

Constructor Details

This class inherits a constructor from Alula::Processor

Instance Method Details

#processObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/alula/processors/dummy.rb', line 4

def process
  super
    
  asset_name = self.attachments.asset_name(item.name)
  output = File.join(self.site.storage.path(:cache, "attachments"), asset_name)
  # Make sure our directory exists
  output_dir = self.site.storage.path(:cache, "attachments", File.dirname(asset_name))
  
  # Skip processing if output already exists...
  unless File.exists?(output)
    # Just simply copy attachement
    FileUtils.cp(item.filepath, output)
  end
  
  # Cleanup ourself
  cleanup
end