streamline some more, make running even FASTER

This commit is contained in:
John Bintz 2012-03-22 08:41:33 -04:00
parent 407ebe9c08
commit 8e669b65c6
3 changed files with 18 additions and 13 deletions

View File

@ -25,9 +25,11 @@ module Flowerbox
end end
get '/' do get '/' do
sprockets.expire_index! begin
runner.template
runner.template rescue Flowerbox::Runner::Base::RunnerDiedError => e
e.message
end
end end
end end
end end

View File

@ -81,9 +81,7 @@ module Flowerbox
@results @results
rescue ExecJS::RuntimeError => e rescue ExecJS::RuntimeError => e
puts e.message.foreground(:red) handle_coffeescript_compilation_error(e)
raise RunnerDiedError.new
end end
def configured? def configured?
@ -118,6 +116,8 @@ module Flowerbox
def start_test_environment def start_test_environment
Flowerbox.test_environment.start Flowerbox.test_environment.start
rescue ExecJS::ProgramError => e
handle_coffeescript_compilation_error(e)
end end
def time=(time) def time=(time)
@ -201,6 +201,13 @@ module Flowerbox
@count = 0 @count = 0
end end
def handle_coffeescript_compilation_error(exception)
puts exception.message.foreground(:red)
@finished = true
raise RunnerDiedError.new(exception.message)
end
private private
def result_set_from_test_results(test_results) def result_set_from_test_results(test_results)
ResultSet.from_results(test_results, options.merge(:runner => name)) ResultSet.from_results(test_results, options.merge(:runner => name))

View File

@ -25,11 +25,11 @@ module Flowerbox
end end
def add(asset) def add(asset)
paths_for(asset).each { |path| add_paths_for_compiled_asset(path) } assets_for(asset).each { |dependent_asset| @files.add(dependent_asset) }
end end
def paths_for(asset) def assets_for(asset)
environment.find_asset(asset).to_a.collect(&:pathname) environment.find_asset(asset, :bundle => false).to_a
end end
def expire_index! def expire_index!
@ -52,10 +52,6 @@ module Flowerbox
environment.find_asset(*args) environment.find_asset(*args)
end end
def add_paths_for_compiled_asset(path)
asset_for(path, :bundle => false).to_a.each { |file_path| @files.add(file_path) }
end
def logical_path_for(asset) def logical_path_for(asset)
asset_path = asset.pathname.to_s asset_path = asset.pathname.to_s