Move sources order to Ruby, which is where it's used.

This commit is contained in:
Davis W. Frank
2012-04-01 11:28:57 -07:00
parent 674197aef8
commit 3a0ada034b
7 changed files with 39 additions and 26 deletions

View File

@@ -29,30 +29,17 @@ class JasmineDev < Thor
no_tasks do
def jasmine_js_paths
sources_list = File.read(File.join(JasmineDev.project_root, 'src', 'SourcesList.json'))
first_paths = JSON.parse(sources_list).collect do |f|
paths = JasmineDev::JASMINE_SOURCES[:core].collect do |f|
File.join(JasmineDev.project_root, 'src', 'core', f)
end
remaining_paths = Dir.glob(File.join(JasmineDev.project_root, 'src', 'core', '*.js'))
remaining_paths << File.join(JasmineDev.project_root, 'src', 'version.js')
add_only_new_elements(first_paths, remaining_paths)
paths << File.join(JasmineDev.project_root, 'src', 'version.js')
paths
end
def jasmine_html_js_paths
first_paths = []
first_paths << File.join(JasmineDev.project_root, 'src', 'html', 'HtmlReporterHelpers.js')
first_paths += Dir.glob(File.join('.', 'src', 'html', '*.js'))
remaining_paths = Dir.glob(File.join(JasmineDev.project_root, 'src', 'html', '*.js'))
add_only_new_elements(first_paths, remaining_paths)
end
def add_only_new_elements(first, remaining)
remaining.inject(first) do |result, element|
result << element unless result.include?(element)
result
JasmineDev::JASMINE_SOURCES[:html].collect do |f|
File.join(JasmineDev.project_root, 'src', 'html', f)
end
end

View File

@@ -0,0 +1,32 @@
class JasmineDev < Thor
JASMINE_SOURCES = {
:core => [
"base.js",
"util.js",
"Env.js",
"Reporter.js",
"Block.js",
"JsApiReporter.js",
"Matchers.js",
"mock-timeout.js",
"MultiReporter.js",
"NestedResults.js",
"PrettyPrinter.js",
"Queue.js",
"Runner.js",
"Spec.js",
"Suite.js",
"WaitsBlock.js",
"WaitsForBlock.js"
],
:html => [
"HtmlReporterHelpers.js",
"HtmlReporter.js",
"ReporterView.js",
"SpecView.js",
"SuiteView.js",
"TrivialReporter.js"
]
}
end