Module: JavascriptFeatures::Compiler
- Defined in:
- lib/javascript_features/compiler.rb
Class Method Summary collapse
Class Method Details
.compile(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/javascript_features/compiler.rb', line 5 def self.compile( = {}) defaults = {:minify => true, :package => 'main'} = defaults.merge() files = files_for_package([:package]) compiled = files.map{|file| File.read(file) }.join("\n") minified = JSMin.minify(compiled) if [:minify] minified || compiled end |
.package_modified_time(package = 'main') ⇒ Object
16 17 18 |
# File 'lib/javascript_features/compiler.rb', line 16 def self.package_modified_time(package = 'main') files_for_package(package).map{|f| File.mtime(f) }.max end |