lib/jammit/dependencies.rb in jammit-0.6.5 vs lib/jammit/dependencies.rb in jammit-0.6.6
- old
+ new
@@ -5,31 +5,48 @@
require 'yaml'
require 'base64'
require 'pathname'
require 'fileutils'
-# Include YUI as the default
-require 'yui/compressor'
+# Try Uglifier.
+begin
+ require 'uglifier'
+ require 'jammit/uglifier'
+rescue LoadError
+ Jammit.javascript_compressors.delete :uglifier
+end
+# Try YUI
+begin
+ require 'yui/compressor'
+rescue LoadError
+ Jammit.javascript_compressors.delete :yui
+ Jammit.css_compressors.delete :yui
+end
+
# Try Closure.
begin
require 'closure-compiler'
rescue LoadError
- Jammit.compressors.delete :closure
+ Jammit.javascript_compressors.delete :closure
end
-# Try Uglifier.
+# Try Sass
begin
- require 'uglifier'
+ require 'sass'
+ require 'jammit/sass_compressor'
rescue LoadError
- Jammit.compressors.delete :uglifier
+ Jammit.css_compressors.delete :sass
end
# Load initial configuration before the rest of Jammit.
Jammit.load_configuration(Jammit::DEFAULT_CONFIG_PATH, true) if defined?(Rails)
# Jammit Core:
-require 'jammit/uglifier' if Jammit.compressors.include? :uglifier
+require 'jsmin'
+require 'cssmin'
+require 'jammit/jsmin_compressor'
+require 'jammit/cssmin_compressor'
require 'jammit/compressor'
require 'jammit/packager'
# Jammit Rails Integration:
if defined?(Rails)