diff --git a/lib/flowerbox/result/failure_message.rb b/lib/flowerbox/result/failure_message.rb index d5ba474..27f325a 100644 --- a/lib/flowerbox/result/failure_message.rb +++ b/lib/flowerbox/result/failure_message.rb @@ -43,13 +43,13 @@ module Flowerbox::Result end def first_local_stack - @first_local_stack ||= stack[1..-1].find do |line| + @first_local_stack ||= stack.find do |line| !system_files.any? { |file| line[%r{\(#{file}}] } end || stack[1] || '' end def exception? - stack[0][%r{^.+Error: }] + (stack[0] || '')[%r{^.+Error: }] end end end diff --git a/lib/flowerbox/sprockets_handler.rb b/lib/flowerbox/sprockets_handler.rb index a716f10..46ba5a9 100644 --- a/lib/flowerbox/sprockets_handler.rb +++ b/lib/flowerbox/sprockets_handler.rb @@ -2,6 +2,7 @@ require 'sprockets' require 'sprockets/engines' require 'forwardable' require 'sprockets-vendor_gems' +require 'fileutils' module Flowerbox class SprocketsHandler @@ -39,6 +40,8 @@ module Flowerbox return @environment if @environment @environment = Sprockets::Environment.new + FileUtils.rm_rf(Flowerbox.cache_dir) + @environment.cache = Sprockets::Cache::FileStore.new(Flowerbox.cache_dir) self.class.gem_asset_paths.each { |path| append_path(path) }