Skip to content

Commit

Permalink
Move sources order to Ruby, which is where it's used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Davis W. Frank committed Apr 1, 2012
1 parent 674197a commit 3a0ada0
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 26 deletions.
7 changes: 0 additions & 7 deletions src/SourcesList.json

This file was deleted.

Empty file modified src/core/base.js 100755 → 100644
Empty file.
Empty file modified src/core/mock-timeout.js 100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/version.js
Expand Up @@ -2,5 +2,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
"revision": 1333301588
"revision": 1333304168
};
1 change: 1 addition & 0 deletions tasks/jasmine_dev.rb
Expand Up @@ -7,6 +7,7 @@
$:.unshift(File.join(File.dirname(__FILE__), "jasmine_dev"))

require "base"
require "sources"
require "js_hint"
require "build_distribution"
require "build_github_pages"
Expand Down
23 changes: 5 additions & 18 deletions tasks/jasmine_dev/build_distribution.rb
Expand Up @@ -29,30 +29,17 @@ def build_distribution(directory = "./lib/jasmine-core")

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

Expand Down
32 changes: 32 additions & 0 deletions tasks/jasmine_dev/sources.rb
@@ -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

0 comments on commit 3a0ada0

Please sign in to comment.