rearrange the furniture some more
This commit is contained in:
parent
298e8c2d3d
commit
69d865c050
@ -3,6 +3,8 @@
|
||||
# watch('file/path') { `command(s)` }
|
||||
#
|
||||
|
||||
guard 'coffeescript', :input => 'vendor/assets/coffeescripts', :output => 'vendor/assets/javascripts'
|
||||
|
||||
guard 'shell' do
|
||||
watch(%r{ext/jasmine-webkit-specrunner/.*\.(cpp|h|pro|pri)}) { |m|
|
||||
if !m[0]['moc_']
|
||||
@ -32,4 +34,3 @@ end
|
||||
|
||||
compile
|
||||
|
||||
guard 'coffeescript', :input => 'jasmine'
|
||||
|
@ -6,17 +6,30 @@ module Jasmine
|
||||
class FilesList
|
||||
attr_reader :files, :spec_files, :filtered_files, :spec_outside_scope
|
||||
|
||||
class << self
|
||||
def find_vendored_asset_paths(*names)
|
||||
require 'rubygems'
|
||||
|
||||
raise StandardError.new("A newer version of Rubygems is required to use vendored assets. Please upgrade.") if !Gem::Specification.respond_to?(:map)
|
||||
all_spec_files.find_all do |file|
|
||||
names.any? { |name| file["/#{name}.js"] }
|
||||
end
|
||||
end
|
||||
|
||||
def all_spec_files
|
||||
@all_spec_files ||= Gem::Specification.map { |spec| spec.files.find_all { |file|
|
||||
file["vendor/assets/javascripts"]
|
||||
}.compact.collect { |file| File.join(spec.gem_dir, file) } }.flatten
|
||||
end
|
||||
end
|
||||
|
||||
DEFAULT_FILES = [
|
||||
File.join(Jasmine::Core.path, "jasmine.js"),
|
||||
File.join(Jasmine::Core.path, "jasmine-html.js"),
|
||||
File.join(Jasmine::Core.path, "jasmine.css"),
|
||||
Jasmine::Headless.root.join('jasmine/jasmine-extensions.js').to_s,
|
||||
Jasmine::Headless.root.join('jasmine/intense.js').to_s,
|
||||
Jasmine::Headless.root.join('jasmine/headless_reporter_result.js').to_s,
|
||||
Jasmine::Headless.root.join('jasmine/jasmine.headless-reporter.js').to_s,
|
||||
Jasmine::Headless.root.join('js-lib/jsDump.js').to_s,
|
||||
Jasmine::Headless.root.join('js-lib/beautify-html.js').to_s
|
||||
]
|
||||
File.join(Jasmine::Core.path, "jasmine.css")
|
||||
] + %w{jasmine-extensions intense headless_reporter_result jasmine.headless-reporter jsDump beautify-html}.collect { |name|
|
||||
Jasmine::Headless.root.join("vendor/assets/javascripts/#{name}.js").to_s
|
||||
}
|
||||
|
||||
PLEASE_WAIT_IM_WORKING_TIME = 2
|
||||
|
||||
@ -75,13 +88,10 @@ module Jasmine
|
||||
cache = Jasmine::Headless::CoffeeScriptCache.new(file)
|
||||
source = cache.handle
|
||||
if cache.cached?
|
||||
%{
|
||||
<script type="text/javascript" src="#{cache.cache_file}"></script>S
|
||||
%{<script type="text/javascript" src="#{cache.cache_file}"></script>
|
||||
<script type="text/javascript">
|
||||
window.CoffeeScriptToFilename = window.CoffeeScriptToFilename || {};
|
||||
window.CoffeeScriptToFilename['#{File.split(cache.cache_file).last}'] = '#{file}';
|
||||
</script>
|
||||
}
|
||||
</script>}
|
||||
else
|
||||
%{<script type="text/javascript">#{source}</script>}
|
||||
end
|
||||
@ -161,19 +171,6 @@ module Jasmine
|
||||
def expanded_dir(path)
|
||||
Dir[path].collect { |file| File.expand_path(file) }
|
||||
end
|
||||
|
||||
def self.find_vendored_asset_path(name)
|
||||
require 'rubygems'
|
||||
|
||||
raise StandardError.new("A newer version of Rubygems is required to use vendored assets. Please upgrade.") if !Gem::Specification.respond_to?(:map)
|
||||
all_spec_files.find_all { |file| file["vendor/assets/javascripts/#{name}.js"] }
|
||||
end
|
||||
|
||||
def self.all_spec_files
|
||||
@all_spec_files ||= Gem::Specification.map { |spec| spec.files.find_all { |file|
|
||||
file["vendor/assets/javascripts"]
|
||||
}.compact.collect { |file| File.join(spec.gem_dir, file) } }.flatten
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
|
||||
<title>Jasmine Test Runner - Generated by jasmine-headless-webkit</title>
|
||||
<script type="text/javascript" src="<%= Jasmine::Headless.root.join('jasmine/prolog.js') %>"</script>
|
||||
<script type="text/javascript" src="<%= Jasmine::Headless.root.join('vendor/assets/javascripts/prolog.js') %>"</script>
|
||||
<%= files.join("\n") %>
|
||||
<script type="text/javascript">
|
||||
if (window.JHW) { HeadlessReporterResult.specLineNumbers = <%= MultiJson.encode(spec_lines) %>; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
src_files: [ 'jasmine/*.coffee' ]
|
||||
src_files: [ 'vendor/assets/coffeescripts/*.coffee' ]
|
||||
spec_files: [ 'spec/javascripts/*_spec.coffee' ]
|
||||
src_dir: .
|
||||
spec_dir: .
|
||||
|
@ -14,12 +14,12 @@ describe Jasmine::FilesList do
|
||||
File.join(Jasmine::Core.path, "jasmine.js"),
|
||||
File.join(Jasmine::Core.path, "jasmine-html.js"),
|
||||
File.join(Jasmine::Core.path, "jasmine.css"),
|
||||
File.expand_path('jasmine/jasmine-extensions.js'),
|
||||
File.expand_path('jasmine/intense.js'),
|
||||
File.expand_path('jasmine/headless_reporter_result.js'),
|
||||
File.expand_path('jasmine/jasmine.headless-reporter.js'),
|
||||
File.expand_path('js-lib/jsDump.js'),
|
||||
File.expand_path('js-lib/beautify-html.js'),
|
||||
File.expand_path('vendor/assets/javascripts/jasmine-extensions.js'),
|
||||
File.expand_path('vendor/assets/javascripts/intense.js'),
|
||||
File.expand_path('vendor/assets/javascripts/headless_reporter_result.js'),
|
||||
File.expand_path('vendor/assets/javascripts/jasmine.headless-reporter.js'),
|
||||
File.expand_path('vendor/assets/javascripts/jsDump.js'),
|
||||
File.expand_path('vendor/assets/javascripts/beautify-html.js'),
|
||||
]
|
||||
end
|
||||
end
|
||||
|
@ -17,7 +17,9 @@ class window.HeadlessReporterResult
|
||||
if result.lineNumber
|
||||
output += " (line ~#{bestChoice.lineNumber + result.lineNumber})".foreground('red').bright()
|
||||
JHW.stdout.puts(" " + output)
|
||||
JHW.stdout.puts(" #{result.line}".foreground('yellow'))
|
||||
|
||||
if result.line?
|
||||
JHW.stdout.puts(" #{result.line}".foreground('yellow'))
|
||||
|
||||
@findSpecLine: (splitName) ->
|
||||
bestChoice = { accuracy: 0, file: null, lineNumber: null }
|
@ -61,3 +61,4 @@ if window.JHW
|
||||
JHW._usedConsole = true
|
||||
JHW.stdout.puts(msg)
|
||||
|
||||
window.CoffeeScriptToFilename = {}
|
@ -25,7 +25,7 @@
|
||||
output += (" (line ~" + (bestChoice.lineNumber + result.lineNumber) + ")").foreground('red').bright();
|
||||
}
|
||||
JHW.stdout.puts(" " + output);
|
||||
_results.push(JHW.stdout.puts((" " + result.line).foreground('yellow')));
|
||||
_results.push(result.line != null ? JHW.stdout.puts((" " + result.line).foreground('yellow')) : void 0);
|
||||
}
|
||||
return _results;
|
||||
};
|
@ -80,4 +80,5 @@
|
||||
return JHW.stdout.puts(msg);
|
||||
};
|
||||
}
|
||||
window.CoffeeScriptToFilename = {};
|
||||
}).call(this);
|
Loading…
Reference in New Issue
Block a user