From c99ab7fb060dde6e62dad094b42adc4c99007e51 Mon Sep 17 00:00:00 2001 From: Zohar Arad Date: Fri, 8 Aug 2014 16:06:29 +0300 Subject: [PATCH] ensure RTLit gem is included and CSS is RTLed if css_rtl is enabled in discourse config --- lib/sass/discourse_sass_compiler.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/sass/discourse_sass_compiler.rb b/lib/sass/discourse_sass_compiler.rb index a5c4db3cd91..ec8d729fc28 100644 --- a/lib/sass/discourse_sass_compiler.rb +++ b/lib/sass/discourse_sass_compiler.rb @@ -63,11 +63,14 @@ class DiscourseSassCompiler # Check if CSS needs to be RTLed after compilation # and run RTLit gem on compiled CSS if true and RTLit gem is available - if GlobalSetting.rtl_css && defined?(RTLit) - RTLit::Converter.to_rtl(css) - else - css + css_output = css + if GlobalSetting.rtl_css + begin + require 'rtlit' + css_output = RTLit::Converter.to_rtl(css) if defined?(RTLit) + rescue; end end + css_output end end