evergreen 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +15 -0
  2. data/README.rdoc +8 -6
  3. data/lib/evergreen.rb +8 -6
  4. data/lib/evergreen/application.rb +2 -5
  5. data/lib/evergreen/helper.rb +33 -0
  6. data/lib/evergreen/runner.rb +1 -1
  7. data/lib/evergreen/server.rb +1 -0
  8. data/lib/evergreen/suite.rb +6 -0
  9. data/lib/evergreen/version.rb +1 -1
  10. data/lib/evergreen/views/run.erb +16 -6
  11. data/lib/jasmine/Contribute.markdown +8 -7
  12. data/lib/jasmine/Gemfile +0 -1
  13. data/lib/jasmine/README.markdown +1 -8
  14. data/lib/jasmine/Rakefile +26 -15
  15. data/lib/jasmine/Release.markdown +8 -6
  16. data/lib/jasmine/config.rb +29 -0
  17. data/lib/jasmine/jasmine-core.gemspec +9 -2
  18. data/lib/jasmine/jasmine_dev.thor +1 -0
  19. data/lib/jasmine/jshint/run.js +1 -1
  20. data/lib/jasmine/lib/jasmine-core/jasmine-html.js +427 -1
  21. data/lib/jasmine/lib/jasmine-core/jasmine.css +81 -166
  22. data/lib/jasmine/lib/jasmine-core/jasmine.js +245 -192
  23. data/lib/jasmine/lib/jasmine-core/version.rb +1 -1
  24. data/lib/jasmine/spec/core/MatchersSpec.js +273 -0
  25. data/lib/jasmine/spec/core/PrettyPrintSpec.js +7 -0
  26. data/lib/jasmine/spec/html/HTMLReporterSpec.js +209 -0
  27. data/lib/jasmine/spec/node_suite.js +2 -2
  28. data/lib/jasmine/spec/runner.html +10 -3
  29. data/lib/jasmine/spec/spec_helper.rb +51 -0
  30. data/lib/jasmine/spec/tasks/build_distribution_spec.rb +33 -0
  31. data/lib/jasmine/spec/tasks/build_github_pages_spec.rb +69 -0
  32. data/lib/jasmine/spec/tasks/build_standalone_distribution_spec.rb +109 -0
  33. data/lib/jasmine/spec/tasks/build_standalone_runner_spec.rb +63 -0
  34. data/lib/jasmine/spec/tasks/count_specs_spec.rb +26 -0
  35. data/lib/jasmine/spec/tasks/execute_specs_spec.rb +81 -0
  36. data/lib/jasmine/spec/tasks/jshint_spec.rb +39 -0
  37. data/lib/jasmine/spec/tasks/release_spec.rb +39 -0
  38. data/lib/jasmine/spec/tasks/version_spec.rb +55 -0
  39. data/lib/jasmine/spec/templates/runner.html.erb +3 -3
  40. data/lib/jasmine/src/core/Env.js +10 -2
  41. data/lib/jasmine/src/core/Matchers.js +33 -4
  42. data/lib/jasmine/src/core/PrettyPrinter.js +2 -2
  43. data/lib/jasmine/src/core/base.js +15 -0
  44. data/lib/jasmine/src/core/mock-timeout.js +0 -0
  45. data/lib/jasmine/src/html/HtmlReporter.js +101 -0
  46. data/lib/jasmine/src/html/HtmlReporterHelpers.js +60 -0
  47. data/lib/jasmine/src/html/ReporterView.js +164 -0
  48. data/lib/jasmine/src/html/SpecView.js +79 -0
  49. data/lib/jasmine/src/html/SuiteView.js +22 -0
  50. data/lib/jasmine/src/html/TrivialReporter.js +3 -1
  51. data/lib/jasmine/src/html/_HTMLReporter.scss +302 -0
  52. data/lib/jasmine/src/html/_TrivialReporter.scss +169 -0
  53. data/lib/jasmine/src/html/jasmine.css +81 -166
  54. data/lib/jasmine/src/html/jasmine.scss +2 -0
  55. data/lib/jasmine/src/templates/version.js.erb +1 -0
  56. data/lib/jasmine/src/version.js +3 -2
  57. data/lib/jasmine/src/version.json +1 -1
  58. data/lib/jasmine/tasks/jasmine_dev.rb +18 -0
  59. data/lib/jasmine/tasks/jasmine_dev/base.rb +54 -0
  60. data/lib/jasmine/tasks/jasmine_dev/build_distribution.rb +53 -0
  61. data/lib/jasmine/tasks/jasmine_dev/build_github_pages.rb +31 -0
  62. data/lib/jasmine/tasks/jasmine_dev/build_standalone_distribution.rb +49 -0
  63. data/lib/jasmine/tasks/jasmine_dev/build_standalone_runner.rb +59 -0
  64. data/lib/jasmine/tasks/jasmine_dev/count_specs.rb +29 -0
  65. data/lib/jasmine/tasks/jasmine_dev/execute_specs.rb +52 -0
  66. data/lib/jasmine/tasks/jasmine_dev/js_hint.rb +13 -0
  67. data/lib/jasmine/tasks/jasmine_dev/release.rb +16 -0
  68. data/lib/jasmine/tasks/jasmine_dev/sources.rb +32 -0
  69. data/lib/jasmine/tasks/jasmine_dev/version.rb +62 -0
  70. data/spec/helper_spec.rb +25 -0
  71. data/spec/suite1/spec/javascripts/{spec_helper.coffee → helpers/spec_helper.coffee} +0 -0
  72. data/spec/suite1/spec/javascripts/{spec_helper.js → helpers/spec_helper.js} +0 -0
  73. data/spec/suite1/spec/javascripts/templates_spec.js +6 -6
  74. data/spec/suite2/spec/awesome_spec.js +1 -1
  75. data/spec/suite_spec.rb +6 -0
  76. metadata +116 -52
  77. data/lib/jasmine/src/SourcesList.json +0 -7
  78. data/lib/jasmine/tasks/build_dist.rb +0 -48
  79. data/lib/jasmine/tasks/build_specs.rb +0 -50
  80. data/lib/jasmine/tasks/helpers.rb +0 -50
  81. data/lib/jasmine/tasks/pages.rb +0 -13
  82. data/lib/jasmine/tasks/spec.rb +0 -37
  83. data/lib/jasmine/tasks/standalone.rb +0 -91
  84. data/lib/jasmine/tasks/version.rb +0 -5
@@ -1,7 +0,0 @@
1
- [
2
- "base.js",
3
- "util.js",
4
- "Env.js",
5
- "Reporter.js",
6
- "Block.js"
7
- ]
@@ -1,48 +0,0 @@
1
- desc "Build core jasmine.js"
2
- task :build_dist => [:lint, :write_version_files] do
3
- puts 'Building Jasmine distribution from source'.cyan
4
-
5
- concat_into('./lib/jasmine-core/jasmine.js') { core_sources + version_source_file }
6
- concat_into('./lib/jasmine-core/jasmine-html.js') { html_sources }
7
-
8
- FileUtils.cp('./src/html/jasmine.css', './lib/jasmine-core/jasmine.css')
9
- end
10
-
11
- def concat_into(output_file, &block)
12
- files = yield
13
- File.open(output_file, 'w') do |out|
14
- files.each do |f|
15
- out << File.read(f)
16
- end
17
- end
18
- end
19
-
20
- desc 'Check jasmine sources for coding problems'
21
- task :lint => :require_node do
22
- puts "Running JSHint via Node.js".cyan
23
- system("node jshint/run.js") || exit(1)
24
- end
25
-
26
- task :hint => :lint
27
-
28
- task :write_version_files do
29
- scope = OpenStruct.new(:major => version_hash["major"],
30
- :minor => version_hash["minor"],
31
- :build => version_hash["build"],
32
- :release_candidate => version_hash["release_candidate"],
33
- :revision => Time.now.to_i)
34
-
35
- js_template = Tilt.new('./src/templates/version.js.erb')
36
- File.open('./src/version.js', 'w+') do |f|
37
- f << js_template.render(scope)
38
- end
39
-
40
- rb_template = Tilt.new('./src/templates/version.rb.erb')
41
- File.open('./lib/jasmine-core/version.rb', 'w+') do |f|
42
- f << rb_template.render(scope)
43
- end
44
- end
45
-
46
- def version_source_file
47
- Dir.glob('src/version.js')
48
- end
@@ -1,50 +0,0 @@
1
- require 'ostruct'
2
-
3
- #build the browser spec for Jasmine core based on current tree
4
- task :build_runner_html do
5
- template = Tilt.new('spec/templates/runner.html.erb')
6
-
7
- File.open('spec/runner.html', 'w+') do |f|
8
- scope = OpenStruct.new(:title => "Jasmine Spec Runner: Jasmine Core",
9
- :favicon => favicon,
10
- :jasmine_tags => jasmine_tags,
11
- :source_tags => source_tags,
12
- :spec_file_tags => spec_file_tags)
13
- f << template.render(scope)
14
- end
15
- end
16
-
17
- def favicon
18
- <<HTML
19
- <link rel="shortcut icon" type="image/png" href="../images/jasmine_favicon.png">
20
- HTML
21
- end
22
-
23
- def jasmine_tags
24
- tags = %Q{<link href="../lib/jasmine-core/jasmine.css" rel="stylesheet"/>}
25
- tags << "\n "
26
- tags << script_tags_for("../lib/jasmine-core/jasmine.js")
27
- tags << "\n "
28
- tags << undefined_catch
29
- tags
30
- end
31
-
32
- def undefined_catch
33
- <<HTML
34
- <script type="text/javascript">
35
- // yes, really keep this here to keep us honest, but only for jasmine's own runner! [xw]
36
- undefined = "diz be undefined yo";
37
- </script>
38
- HTML
39
- end
40
-
41
- def source_tags
42
- other_files = html_sources + console_sources
43
- script_tags_for other_files.collect { |f| "../#{f}" }
44
- end
45
-
46
- def spec_file_tags
47
- spec_files = core_specfiles + html_specfiles + console_specfiles
48
- script_tags_for spec_files.collect { |f| "../#{f}" }
49
- end
50
-
@@ -1,50 +0,0 @@
1
- require 'json'
2
-
3
- def core_sources
4
- first_sources = JSON.parse(File.read('./src/SourcesList.json')).collect { |f| "./src/core/#{f}" }
5
-
6
- remaining_sources = Dir.glob('./src/core/*.js').reject { |f| first_sources.include?(f) }.sort
7
-
8
- first_sources + remaining_sources
9
- end
10
-
11
- def html_sources
12
- Dir.glob('./src/html/*.js')
13
- end
14
-
15
- def console_sources
16
- Dir.glob('./src/console/*.js')
17
- end
18
-
19
- def core_specfiles
20
- Dir.glob('./spec/core/*.js')
21
- end
22
-
23
- def html_specfiles
24
- Dir.glob('./spec/html/*.js')
25
- end
26
-
27
- def console_specfiles
28
- Dir.glob('./spec/console/*.js')
29
- end
30
-
31
- def version_string
32
- version = "#{version_hash['major']}.#{version_hash['minor']}.#{version_hash['build']}"
33
- version += ".rc#{version_hash['release_candidate']}" if version_hash['release_candidate']
34
- version
35
- end
36
-
37
- def version_hash
38
- @version ||= JSON.parse(File.new("./src/version.json").read);
39
- end
40
-
41
- def script_tags_for(files)
42
- script_tag = Tilt::new('./spec/templates/script_tag.html.erb')
43
-
44
- srcs = (files.is_a?(String) ? [files] : files)
45
- srcs.inject([]) do |tags, f|
46
- scope = OpenStruct.new :file => f
47
- tags << script_tag.render(scope)
48
- tags
49
- end.join("\n ")
50
- end
@@ -1,13 +0,0 @@
1
- desc "Build the Github pages HTML"
2
- task :build_pages => :require_pages_submodule do
3
- Dir.chdir("pages") do
4
- FileUtils.rm_r('pages_output') if File.exist?('pages_output')
5
- Dir.chdir('pages_source') do
6
- system("frank export ../pages_output")
7
- end
8
- puts "\n"
9
- puts "Copying built website to the root of the gh-pages branch".cyan
10
- puts "\n\n"
11
- system("cp -r pages_output/* .")
12
- end
13
- end
@@ -1,37 +0,0 @@
1
- desc "Run spec suite: Browser, Node, JSHint"
2
- task :spec => ["build_dist", "count_specs", "spec:node", "spec:browser"]
3
-
4
- desc 'Run specs in Node.js'
5
- task "spec:node" => [:count_specs, :require_node] do
6
- puts "Running all appropriate specs via Node.js".cyan
7
-
8
- color = Term::ANSIColor.coloring? ? "--color" : "--noColor"
9
- system("node spec/node_suite.js #{color}")
10
- end
11
-
12
- desc "Run specs in the default browser (MacOS only)"
13
- task "spec:browser" => [:count_specs, :build_runner_html] do
14
- puts "Running all appropriate specs via the default web browser".cyan
15
- system("open spec/runner.html")
16
- end
17
-
18
- #Count number of specs in Jasmine core
19
- task :count_specs do
20
- core_specs_count = count_specs_in(Dir.glob('spec/core/*.js'))
21
- console_spec_count = count_specs_in(Dir.glob('spec/console/*.js'))
22
- html_spec_count = count_specs_in(Dir.glob('spec/html/*.js'))
23
-
24
- puts "\n"
25
- puts "#{(core_specs_count + console_spec_count).to_s.yellow.bold} specs for Node.js runner (exclude DOM-related specs)"
26
- puts "#{(core_specs_count + console_spec_count + html_spec_count).to_s.yellow.bold} specs for Browser runner (all specs)"
27
- puts "\n"
28
- puts "Please verify that these numbers match the runner output."
29
- puts "\n"
30
- end
31
-
32
- def count_specs_in(files)
33
- files.inject(0) do |count, file|
34
- File.read(file).scan(/\sit\(/) {|s| count += 1}
35
- count
36
- end
37
- end
@@ -1,91 +0,0 @@
1
- require 'ostruct'
2
-
3
- desc "Build standalone distribution"
4
- task :standalone => [:require_pages_submodule, :protect_current_dist_zip, :build_spec_runner_html] do
5
- require 'tmpdir'
6
-
7
- zip_root = File.join(Dir.tmpdir, "zip_root")
8
- temp_dir = File.join(zip_root, "jasmine-standalone-#{version_string}")
9
- puts "Building Example Project in #{temp_dir}"
10
- FileUtils.rm_r temp_dir if File.exist?(temp_dir)
11
- FileUtils.mkdir_p(temp_dir)
12
-
13
- root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
14
- FileUtils.mkdir_p(File.join(root, "example"))
15
- FileUtils.cp_r(File.join(root, 'example/.'), File.join(temp_dir))
16
-
17
- lib_dir = File.join(temp_dir, "lib/jasmine-#{version_string}")
18
- FileUtils.mkdir_p(lib_dir)
19
- {
20
- "images/jasmine_favicon.png" => "jasmine_favicon.png",
21
- "lib/jasmine-core/jasmine.js" => "jasmine.js",
22
- "lib/jasmine-core/jasmine-html.js" => "jasmine-html.js",
23
- "lib/jasmine-core/jasmine.css" => "jasmine.css",
24
- "MIT.LICENSE" => "MIT.LICENSE"
25
- }.each_pair do |src, dest|
26
- FileUtils.cp(File.join(root, src), File.join(lib_dir, dest))
27
- end
28
-
29
- dist_dir = File.join(root, 'pages/downloads')
30
- zip_file_name = File.join(dist_dir, "jasmine-standalone-#{version_string}.zip")
31
-
32
- puts "Zipping Example Project and moving to #{zip_file_name}"
33
- exec "cd #{zip_root} && zip #{zip_file_name} -r . -x .[a-zA-Z0-9]*"
34
- end
35
-
36
- #Build SpecRunner.html for standalone dist example project
37
- task :build_spec_runner_html do
38
- template = Tilt.new('spec/templates/runner.html.erb')
39
-
40
- File.open('lib/jasmine-core/example/SpecRunner.html', 'w+') do |f|
41
- scope = OpenStruct.new(:title => "Jasmine Spec Runner",
42
- :favicon => example_favicon,
43
- :jasmine_tags => example_jasmine_tags,
44
- :source_tags => example_source_tags,
45
- :spec_file_tags => example_spec_tags)
46
- f << template.render(scope)
47
- end
48
- end
49
-
50
- def example_path
51
- "lib/jasmine-#{version_string}"
52
- end
53
-
54
- def example_favicon
55
- <<HTML
56
- <link rel="shortcut icon" type="image/png" href="#{example_path}/jasmine_favicon.png">
57
- HTML
58
- end
59
-
60
- def example_jasmine_tags
61
- tags = %Q{<link rel="stylesheet" type="text/css" href="#{example_path}/jasmine.css">}
62
- tags << "\n "
63
- tags << script_tags_for(["#{example_path}/jasmine.js", "#{example_path}/jasmine-html.js"])
64
- tags
65
- end
66
-
67
- def example_source_tags
68
- script_tags_for ['spec/SpecHelper.js', 'spec/PlayerSpec.js']
69
- end
70
-
71
- def example_spec_tags
72
- script_tags_for ['src/Player.js', 'src/Song.js']
73
- end
74
-
75
-
76
- task :protect_current_dist_zip do
77
- root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
78
- dist_dir = File.join(root, 'pages/downloads')
79
- zip_file_name = File.join(dist_dir, "jasmine-standalone-#{version_string}.zip")
80
-
81
- zip_present_message = "\n\n"
82
- zip_present_message << "==> STOPPED <==".red
83
- zip_present_message << "\n\n"
84
- zip_present_message << "The file ".red + "#{zip_file_name}" + " already exists.".red + "\n"
85
- zip_present_message << "If you should be building the next version, update src/version.json"
86
- zip_present_message << "\n"
87
- zip_present_message << "If the version is correct, you must be trying to re-build the standalone ZIP. Delete the ZIP and rebuild."
88
- zip_present_message << "\n"
89
-
90
- raise zip_present_message if File.exist?(zip_file_name)
91
- end
@@ -1,5 +0,0 @@
1
- task :version do
2
- require 'pp'
3
- pp version_hash
4
- pp version_string
5
- end