Skip to content

Commit 9156b6a

Browse files
committed
lazier Java version warnings ... only if you happen to use the compressor. Issue #126
1 parent 96677b2 commit 9156b6a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

lib/jammit.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def self.load_configuration(config_path, soft=false)
8686
set_template_extension(conf[:template_extension])
8787
symbolize_keys(conf[:stylesheets]) if conf[:stylesheets]
8888
symbolize_keys(conf[:javascripts]) if conf[:javascripts]
89-
check_java_version
9089
check_for_deprecations
9190
self
9291
end
@@ -184,7 +183,9 @@ def self.disable_compression
184183

185184
# Jammit 0.5+ no longer supports separate template packages.
186185
def self.check_for_deprecations
187-
raise DeprecationError, "Jammit 0.5+ no longer supports separate packages for templates.\nPlease fold your templates into the appropriate 'javascripts' package instead." if @configuration[:templates]
186+
if @configuration[:templates]
187+
raise DeprecationError, "Jammit 0.5+ no longer supports separate packages for templates.\nPlease fold your templates into the appropriate 'javascripts' package instead."
188+
end
188189
end
189190

190191
def self.warn(message)

lib/jammit/compressor.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ class Compressor
5252
:closure => {},
5353
:uglifier => {:copyright => false}
5454
}
55-
56-
# The css comressor if always YUI Compressor. Js compression can be provided with
57-
# YUI Compressor, Google Closure Compiler or UglifyJS
55+
56+
# The css compressor is always the YUI Compressor. JS compression can be
57+
# provided with YUI Compressor, Google Closure Compiler or UglifyJS.
5858
def initialize
59+
Jammit.check_java_version
5960
@css_compressor = YUI::CssCompressor.new(Jammit.css_compressor_options || {})
6061
flavor = Jammit.javascript_compressor || Jammit::DEFAULT_COMPRESSOR
6162
@options = DEFAULT_OPTIONS[flavor].merge(Jammit.compressor_options || {})

0 commit comments

Comments
 (0)