Move 'if defined?' conditional to before 'require' statement for r2 gem
This commit is contained in:
parent
4b8ad7637c
commit
51ebc56f89
|
@ -66,11 +66,13 @@ 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 !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(%w(he ar fa_IR))
|
if defined?(R2)
|
||||||
begin
|
if !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(%w(he ar fa_IR))
|
||||||
require 'r2'
|
begin
|
||||||
css_output = R2.r2(css) if defined?(R2)
|
require 'r2'
|
||||||
rescue; end
|
css_output = R2.r2(css)
|
||||||
|
rescue; end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
css_output
|
css_output
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue