./lib/lux_assets/element.rb in lux_assets-0.2.9 vs ./lib/lux_assets/element.rb in lux_assets-0.2.11

- old
+ new

@@ -13,24 +13,24 @@ def content_type @ext ||= @source.to_s.split('.').last.to_sym [:css, :scss].include?(@ext) ? 'text/css' : 'text/javascript' end - ### - - private - - # use LuxAsset.compile + # use LuxAsset.compile if possible def compile force:nil, production:nil @production = production || false method_name = 'compile_%s' % @source.to_s.split('.').last.downcase if respond_to?(method_name, true) (!force && cached) || send(method_name) else @source.read end end + + ### + + private def cached @cache.exist? && (@cache.ctime > @source.ctime) ? @cache.read : false end \ No newline at end of file