streamline some more, make running even FASTER
This commit is contained in:
parent
407ebe9c08
commit
8e669b65c6
@ -25,9 +25,11 @@ module Flowerbox
|
||||
end
|
||||
|
||||
get '/' do
|
||||
sprockets.expire_index!
|
||||
|
||||
runner.template
|
||||
begin
|
||||
runner.template
|
||||
rescue Flowerbox::Runner::Base::RunnerDiedError => e
|
||||
e.message
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -81,9 +81,7 @@ module Flowerbox
|
||||
|
||||
@results
|
||||
rescue ExecJS::RuntimeError => e
|
||||
puts e.message.foreground(:red)
|
||||
|
||||
raise RunnerDiedError.new
|
||||
handle_coffeescript_compilation_error(e)
|
||||
end
|
||||
|
||||
def configured?
|
||||
@ -118,6 +116,8 @@ module Flowerbox
|
||||
|
||||
def start_test_environment
|
||||
Flowerbox.test_environment.start
|
||||
rescue ExecJS::ProgramError => e
|
||||
handle_coffeescript_compilation_error(e)
|
||||
end
|
||||
|
||||
def time=(time)
|
||||
@ -201,6 +201,13 @@ module Flowerbox
|
||||
@count = 0
|
||||
end
|
||||
|
||||
def handle_coffeescript_compilation_error(exception)
|
||||
puts exception.message.foreground(:red)
|
||||
@finished = true
|
||||
|
||||
raise RunnerDiedError.new(exception.message)
|
||||
end
|
||||
|
||||
private
|
||||
def result_set_from_test_results(test_results)
|
||||
ResultSet.from_results(test_results, options.merge(:runner => name))
|
||||
|
@ -25,11 +25,11 @@ module Flowerbox
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
def paths_for(asset)
|
||||
environment.find_asset(asset).to_a.collect(&:pathname)
|
||||
def assets_for(asset)
|
||||
environment.find_asset(asset, :bundle => false).to_a
|
||||
end
|
||||
|
||||
def expire_index!
|
||||
@ -52,10 +52,6 @@ module Flowerbox
|
||||
environment.find_asset(*args)
|
||||
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)
|
||||
asset_path = asset.pathname.to_s
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user