From b6db1384d6ab359f0232b4beafb0134164d97d4a Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 19 Mar 2012 17:10:23 -0400 Subject: [PATCH] a few more fixes --- lib/flowerbox/result/failure_message.rb | 4 ++-- lib/flowerbox/sprockets_handler.rb | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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) }