Class: Epuber::Compiler::FileTypes::CoffeeScriptFile

Inherits:
SourceFile show all
Defined in:
lib/epuber/compiler/file_types/coffee_script_file.rb

Instance Attribute Summary

Attributes inherited from SourceFile

#abs_source_path, #file_request, #source_path

Attributes inherited from AbstractFile

#compilation_context, #destination_path, #final_destination_path, #group, #path_type, #pkg_destination_path, #properties

Instance Method Summary collapse

Methods inherited from SourceFile

#default_file_copy, #destination_file_exist?, #destination_file_up_to_date?, #find_dependencies, #initialize, #properties, resolve_relative_file, #source_file_up_to_date?, #update_metadata!, #write_compiled, #write_processed

Methods inherited from AbstractFile

#==, file_copy!, write_to_file, write_to_file!, write_to_file?

Constructor Details

This class inherits a constructor from Epuber::Compiler::FileTypes::SourceFile

Instance Method Details

#process(_compilation_context) ⇒ Object

Parameters:



13
14
15
16
17
18
19
# File 'lib/epuber/compiler/file_types/coffee_script_file.rb', line 13

def process(_compilation_context)
  return if destination_file_up_to_date?

  write_compiled(CoffeeScript.compile(File.new(abs_source_path)))

  update_metadata!
end