Fix if defined? conditional for R2

This commit is contained in:
Simon Cossar 2015-04-14 20:14:04 -07:00
parent 51ebc56f89
commit b0a3401186
1 changed files with 5 additions and 7 deletions

View File

@ -66,14 +66,12 @@ class DiscourseSassCompiler
# Check if CSS needs to be RTLed after compilation # Check if CSS needs to be RTLed after compilation
# and run R2 gem on compiled CSS if true and R2 gem is available # and run R2 gem on compiled CSS if true and R2 gem is available
css_output = css css_output = css
if defined?(R2)
if !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(%w(he ar fa_IR)) if !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(%w(he ar fa_IR))
begin begin
require 'r2' require 'r2'
css_output = R2.r2(css) css_output = R2.r2(css) if defined?(R2)
rescue; end rescue; end
end end
end
css_output css_output
end end