./lib/lux_assets/element.rb in lux_assets-0.1.4 vs ./lib/lux_assets/element.rb in lux_assets-0.1.9

- old
+ new

@@ -1,12 +1,9 @@ # One file that can be scss, js, coffee, ts, etc... class LuxAssets::Element - TMP_ASSETS = './tmp/assets' - - def initialize source, opts={} + def initialize source @source = Pathname.new source - @opts = opts @cache = Pathname.new './tmp/assets/%s' % source.gsub('/','-') end def compile method_name = 'compile_%s' % @source.to_s.split('.').last.downcase @@ -27,10 +24,11 @@ ### private def production? - defined?(Rake) + # if building from Rake then we are compiling for production + ENV['LUX_ASSETS_ENV'] == 'production' || defined?(Rake) end def cached @cache.exist? && (@cache.ctime > @source.ctime) ? @cache.read : false end \ No newline at end of file