cleaned up js output
This commit is contained in:
parent
a69ae2e4ab
commit
727871117c
|
@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
||||||
|
|
||||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||||
s.authors = ["Nick Gauthier"]
|
s.authors = ["Nick Gauthier"]
|
||||||
s.date = %q{2010-05-24}
|
s.date = %q{2010-05-28}
|
||||||
s.description = %q{Spread your tests over multiple machines to test your code faster.}
|
s.description = %q{Spread your tests over multiple machines to test your code faster.}
|
||||||
s.email = %q{nick@smartlogicsolutions.com}
|
s.email = %q{nick@smartlogicsolutions.com}
|
||||||
s.extra_rdoc_files = [
|
s.extra_rdoc_files = [
|
||||||
|
@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
||||||
"lib/hydra.rb",
|
"lib/hydra.rb",
|
||||||
"lib/hydra/cucumber/formatter.rb",
|
"lib/hydra/cucumber/formatter.rb",
|
||||||
"lib/hydra/hash.rb",
|
"lib/hydra/hash.rb",
|
||||||
|
"lib/hydra/js/lint.js",
|
||||||
"lib/hydra/listener/abstract.rb",
|
"lib/hydra/listener/abstract.rb",
|
||||||
"lib/hydra/listener/minimal_output.rb",
|
"lib/hydra/listener/minimal_output.rb",
|
||||||
"lib/hydra/listener/notifier.rb",
|
"lib/hydra/listener/notifier.rb",
|
||||||
|
@ -59,6 +60,8 @@ Gem::Specification.new do |s|
|
||||||
"test/fixtures/features/write_alternate_file.feature",
|
"test/fixtures/features/write_alternate_file.feature",
|
||||||
"test/fixtures/features/write_file.feature",
|
"test/fixtures/features/write_file.feature",
|
||||||
"test/fixtures/hello_world.rb",
|
"test/fixtures/hello_world.rb",
|
||||||
|
"test/fixtures/js_file.js",
|
||||||
|
"test/fixtures/json_data.json",
|
||||||
"test/fixtures/slow.rb",
|
"test/fixtures/slow.rb",
|
||||||
"test/fixtures/sync_test.rb",
|
"test/fixtures/sync_test.rb",
|
||||||
"test/fixtures/write_file.rb",
|
"test/fixtures/write_file.rb",
|
||||||
|
|
|
@ -178,10 +178,8 @@ module Hydra #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_javascript_file(file)
|
def run_javascript_file(file)
|
||||||
puts "Running #{file}"
|
|
||||||
errors = []
|
errors = []
|
||||||
require 'v8'
|
require 'v8'
|
||||||
require 'pp' #TODO REMOVE!
|
|
||||||
V8::Context.open do |context|
|
V8::Context.open do |context|
|
||||||
context.load(File.expand_path(File.join(File.dirname(__FILE__), 'js', 'lint.js')))
|
context.load(File.expand_path(File.join(File.dirname(__FILE__), 'js', 'lint.js')))
|
||||||
context['input'] = lambda{
|
context['input'] = lambda{
|
||||||
|
@ -190,9 +188,10 @@ module Hydra #:nodoc:
|
||||||
context['reportErrors'] = lambda{|js_errors|
|
context['reportErrors'] = lambda{|js_errors|
|
||||||
js_errors.each do |e|
|
js_errors.each do |e|
|
||||||
e = V8::To.ruby(e)
|
e = V8::To.ruby(e)
|
||||||
errors << "Error at line #{e['line'].to_i + 1} " +
|
errors << "\n\e[1;31mJSLINT: #{file}\e[0m"
|
||||||
"character #{e['character'].to_i + 1}: #{e['reason']}"
|
errors << " Error at line #{e['line'].to_i + 1} " +
|
||||||
errors << e['evidence']
|
"character #{e['character'].to_i + 1}: \e[1;33m#{e['reason']}\e[0m"
|
||||||
|
errors << "#{e['evidence']}"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
context.eval %{
|
context.eval %{
|
||||||
|
|
Loading…
Reference in New Issue