bootcamp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/.rvmrc +1 -0
  4. data/Gemfile +14 -0
  5. data/Gemfile.lock +36 -0
  6. data/LICENSE.txt +20 -0
  7. data/NOTES +3 -0
  8. data/README.rdoc +49 -0
  9. data/Rakefile +42 -0
  10. data/VERSION +1 -0
  11. data/bin/bootcamp +8 -0
  12. data/bootcamp.gemspec +190 -0
  13. data/lib/bootcamp.rb +22 -0
  14. data/lib/bootcamp/armory.rb +20 -0
  15. data/lib/bootcamp/drill_instructor.rb +95 -0
  16. data/lib/bootcamp/formations/core.rb +13 -0
  17. data/lib/bootcamp/formations/html.rb +17 -0
  18. data/lib/bootcamp/formations/jquery.rb +13 -0
  19. data/lib/bootcamp/recruit.rb +28 -0
  20. data/spec/bootcamp_spec.rb +12 -0
  21. data/spec/spec_helper.rb +12 -0
  22. data/vendor/core.js +1 -0
  23. data/vendor/dojo.js +14 -0
  24. data/vendor/jquery.js +18 -0
  25. data/vendor/midori.js +1502 -0
  26. data/vendor/mootools.js +486 -0
  27. data/vendor/prototype.js +6082 -0
  28. data/vendor/test_suites/jasmine/SpecRunner.html +27 -0
  29. data/vendor/test_suites/jasmine/lib/jasmine-1.0.2/MIT.LICENSE +20 -0
  30. data/vendor/test_suites/jasmine/lib/jasmine-1.0.2/jasmine-html.js +188 -0
  31. data/vendor/test_suites/jasmine/lib/jasmine-1.0.2/jasmine.css +166 -0
  32. data/vendor/test_suites/jasmine/lib/jasmine-1.0.2/jasmine.js +2421 -0
  33. data/vendor/test_suites/jasmine/spec/PlayerSpec.js +58 -0
  34. data/vendor/test_suites/jasmine/spec/SpecHelper.js +9 -0
  35. data/vendor/test_suites/jasmine/src/Player.js +22 -0
  36. data/vendor/test_suites/jasmine/src/Song.js +7 -0
  37. data/vendor/test_suites/jspec/History.md +790 -0
  38. data/vendor/test_suites/jspec/Manifest +79 -0
  39. data/vendor/test_suites/jspec/README.md +1030 -0
  40. data/vendor/test_suites/jspec/Rakefile +28 -0
  41. data/vendor/test_suites/jspec/bin/jspec +182 -0
  42. data/vendor/test_suites/jspec/jspec.gemspec +44 -0
  43. data/vendor/test_suites/jspec/lib/images/bg.png +0 -0
  44. data/vendor/test_suites/jspec/lib/images/hr.png +0 -0
  45. data/vendor/test_suites/jspec/lib/images/loading.gif +0 -0
  46. data/vendor/test_suites/jspec/lib/images/sprites.bg.png +0 -0
  47. data/vendor/test_suites/jspec/lib/images/sprites.png +0 -0
  48. data/vendor/test_suites/jspec/lib/images/vr.png +0 -0
  49. data/vendor/test_suites/jspec/lib/jspec.css +149 -0
  50. data/vendor/test_suites/jspec/lib/jspec.growl.js +115 -0
  51. data/vendor/test_suites/jspec/lib/jspec.jquery.js +72 -0
  52. data/vendor/test_suites/jspec/lib/jspec.js +1876 -0
  53. data/vendor/test_suites/jspec/lib/jspec.shell.js +39 -0
  54. data/vendor/test_suites/jspec/lib/jspec.timers.js +90 -0
  55. data/vendor/test_suites/jspec/lib/jspec.xhr.js +195 -0
  56. data/vendor/test_suites/jspec/spec/commands/example_command.rb +19 -0
  57. data/vendor/test_suites/jspec/spec/dom.html +33 -0
  58. data/vendor/test_suites/jspec/spec/fixtures/test.html +1 -0
  59. data/vendor/test_suites/jspec/spec/fixtures/test.json +1 -0
  60. data/vendor/test_suites/jspec/spec/fixtures/test.xml +5 -0
  61. data/vendor/test_suites/jspec/spec/node.js +17 -0
  62. data/vendor/test_suites/jspec/spec/rhino.js +23 -0
  63. data/vendor/test_suites/jspec/spec/ruby/bin/init_spec.rb +101 -0
  64. data/vendor/test_suites/jspec/spec/ruby/bin/install_spec.rb +141 -0
  65. data/vendor/test_suites/jspec/spec/ruby/bin/run_spec.rb +0 -0
  66. data/vendor/test_suites/jspec/spec/ruby/bin/shell_spec.rb +13 -0
  67. data/vendor/test_suites/jspec/spec/ruby/bin/spec_helper.rb +8 -0
  68. data/vendor/test_suites/jspec/spec/ruby/bin/update_spec.rb +72 -0
  69. data/vendor/test_suites/jspec/spec/server.html +29 -0
  70. data/vendor/test_suites/jspec/spec/server.rb +2 -0
  71. data/vendor/test_suites/jspec/spec/support/env.js +10118 -0
  72. data/vendor/test_suites/jspec/spec/support/jquery.js +4376 -0
  73. data/vendor/test_suites/jspec/spec/unit/helpers.js +64 -0
  74. data/vendor/test_suites/jspec/spec/unit/spec.fixtures.js +24 -0
  75. data/vendor/test_suites/jspec/spec/unit/spec.grammar-less.js +34 -0
  76. data/vendor/test_suites/jspec/spec/unit/spec.grammar.js +275 -0
  77. data/vendor/test_suites/jspec/spec/unit/spec.jquery.js +178 -0
  78. data/vendor/test_suites/jspec/spec/unit/spec.jquery.xhr.js +84 -0
  79. data/vendor/test_suites/jspec/spec/unit/spec.js +187 -0
  80. data/vendor/test_suites/jspec/spec/unit/spec.matchers.js +577 -0
  81. data/vendor/test_suites/jspec/spec/unit/spec.modules.js +51 -0
  82. data/vendor/test_suites/jspec/spec/unit/spec.shared-behaviors.js +279 -0
  83. data/vendor/test_suites/jspec/spec/unit/spec.utils.js +346 -0
  84. data/vendor/test_suites/jspec/spec/unit/spec.xhr.js +157 -0
  85. data/vendor/test_suites/jspec/src/browsers.rb +279 -0
  86. data/vendor/test_suites/jspec/src/helpers.rb +67 -0
  87. data/vendor/test_suites/jspec/src/installables.rb +229 -0
  88. data/vendor/test_suites/jspec/src/project.rb +341 -0
  89. data/vendor/test_suites/jspec/src/routes.rb +57 -0
  90. data/vendor/test_suites/jspec/src/server.rb +88 -0
  91. data/vendor/test_suites/jspec/support/js.jar +0 -0
  92. data/vendor/test_suites/jspec/templates/default/History.md +5 -0
  93. data/vendor/test_suites/jspec/templates/default/Readme.md +29 -0
  94. data/vendor/test_suites/jspec/templates/default/lib/yourlib.js +2 -0
  95. data/vendor/test_suites/jspec/templates/default/spec/commands/example_command.rb +19 -0
  96. data/vendor/test_suites/jspec/templates/default/spec/dom.html +22 -0
  97. data/vendor/test_suites/jspec/templates/default/spec/node.js +10 -0
  98. data/vendor/test_suites/jspec/templates/default/spec/rhino.js +10 -0
  99. data/vendor/test_suites/jspec/templates/default/spec/server.html +18 -0
  100. data/vendor/test_suites/jspec/templates/default/spec/server.rb +4 -0
  101. data/vendor/test_suites/jspec/templates/default/spec/unit/spec.helper.js +0 -0
  102. data/vendor/test_suites/jspec/templates/default/spec/unit/spec.js +8 -0
  103. data/vendor/test_suites/jspec/templates/node/History.md +5 -0
  104. data/vendor/test_suites/jspec/templates/node/Readme.md +29 -0
  105. data/vendor/test_suites/jspec/templates/node/lib/yourlib.js +2 -0
  106. data/vendor/test_suites/jspec/templates/node/spec/node.js +10 -0
  107. data/vendor/test_suites/jspec/templates/node/spec/unit/spec.helper.js +0 -0
  108. data/vendor/test_suites/jspec/templates/node/spec/unit/spec.js +8 -0
  109. data/vendor/test_suites/jspec/templates/rails/commands/example_commands.rb +19 -0
  110. data/vendor/test_suites/jspec/templates/rails/dom.html +22 -0
  111. data/vendor/test_suites/jspec/templates/rails/rhino.js +10 -0
  112. data/vendor/test_suites/jspec/templates/rails/server.html +18 -0
  113. data/vendor/test_suites/jspec/templates/rails/server.rb +4 -0
  114. data/vendor/test_suites/jspec/templates/rails/unit/spec.helper.js +0 -0
  115. data/vendor/test_suites/jspec/templates/rails/unit/spec.js +8 -0
  116. data/vendor/test_suites/qunit/README.md +24 -0
  117. data/vendor/test_suites/qunit/package.json +21 -0
  118. data/vendor/test_suites/qunit/qunit/qunit.css +225 -0
  119. data/vendor/test_suites/qunit/qunit/qunit.js +1448 -0
  120. data/vendor/test_suites/qunit/test/headless.html +24 -0
  121. data/vendor/test_suites/qunit/test/index.html +19 -0
  122. data/vendor/test_suites/qunit/test/logs.html +17 -0
  123. data/vendor/test_suites/qunit/test/logs.js +150 -0
  124. data/vendor/test_suites/qunit/test/same.js +1421 -0
  125. data/vendor/test_suites/qunit/test/test.js +324 -0
  126. metadata +282 -0
@@ -0,0 +1,28 @@
1
+
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'echoe'
5
+
6
+ def version
7
+ $1 if File.read('lib/jspec.js').match /version *: *'(.*?)'/
8
+ end
9
+
10
+ Echoe.new "jspec", version do |p|
11
+ p.author = "TJ Holowaychuk"
12
+ p.email = "tj@vision-media.ca"
13
+ p.summary = "JavaScript BDD Testing Framework"
14
+ p.url = "http://visionmedia.github.com/jspec"
15
+ p.runtime_dependencies << "sinatra"
16
+ p.runtime_dependencies << "json_pure"
17
+ p.runtime_dependencies << "commander >=4.0.1"
18
+ p.runtime_dependencies << "bind >=0.2.8"
19
+ end
20
+
21
+ namespace :spec do
22
+ desc 'Run jspec executable specs'
23
+ task :bin do
24
+ sh 'spec --color --require spec/ruby/bin/spec_helper.rb spec/ruby/bin/*_spec.rb'
25
+ end
26
+ end
27
+
28
+ task :gemspec => :build_gemspec
@@ -0,0 +1,182 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ JSPEC_ROOT = File.expand_path File.join(File.dirname(__FILE__), '..')
4
+ $:.unshift JSPEC_ROOT
5
+
6
+ require 'rubygems'
7
+ require 'commander/import'
8
+ require 'bind'
9
+ require 'fileutils'
10
+ require 'src/project'
11
+ require 'src/installables'
12
+ require 'src/server'
13
+
14
+ program :name, 'JSpec'
15
+ program :version, '4.0.0'
16
+ program :description, 'JavaScript BDD Testing Framework'
17
+ default_command :bind
18
+
19
+ JSpec::Project.load_commands_at '~/.jspec/commands'
20
+ JSpec::Project.load_commands_at 'spec/commands'
21
+ JSpec::Project.load_commands_at 'jspec/commands'
22
+
23
+ command :stats do |c|
24
+ c.syntax = 'jspec stats [path ...]'
25
+ c.summary = 'View javascript source statistics'
26
+ c.description = 'View statistics for the given [paths], defaulting to /lib/**/*.js'
27
+ c.example 'View stats for all /lib javascript', 'jspec stats'
28
+ c.example 'View stats for all /public/javascript files', 'jspec stats public/javascript/*.js'
29
+ c.when_called do |paths, options|
30
+ paths = Dir['lib/**/*.js'] if paths.empty?
31
+ paths.each do |path|
32
+ contents = File.read path
33
+ say "%33s : \n" % $terminal.color(path, :bold)
34
+ say "%25s : %0.2f KiB\n" % ['size', File.size(path).to_f / 1024]
35
+ say "%25s : %d\n" % ['lines', contents.to_a.length]
36
+ say "%25s : %d\n" % ['comments', contents.scan(/\/\*.*?\*\/|\/\/.*?$/m).length]
37
+ say "%25s : %d\n" % ['functions', contents.scan(/function/i).length]
38
+ say "%25s : %d\n" % ['vars', contents.scan(/\bvar\b/).length]
39
+ say "\n"
40
+ end
41
+ end
42
+ end
43
+
44
+ command :install do |c|
45
+ c.syntax = 'jspec install <project> [dest]'
46
+ c.summary = 'Install a project such as jQuery, Prototype, Rhino, etc.'
47
+ c.description = 'Install the given <project> to [dest] or spec/support/<project>.
48
+ When --release is not specified, the latest stable release will be used.
49
+ Currently the following projects are supported:
50
+
51
+ - jquery
52
+ - jqueryui
53
+ - prototype
54
+ - mootools
55
+ - dojo
56
+ - envjs (--release not yet supported)
57
+ - rhino (--release not yet supported)'
58
+ c.option '-r', '--release STRING', 'Release version to install'
59
+ c.example 'Install jQuery to spec/support/jquery.js', 'jspec install jquery'
60
+ c.example 'Install jQuery 1.3.0 to spec/support/jquery.js', 'jspec install jquery --release 1.3.0'
61
+ c.example 'Install Prototype to spec/prototype.js', 'jspec install prototype spec'
62
+ c.example 'Install Prototype to spec/vendor/prototype.js', 'jspec install prototype spec/vendor'
63
+ c.when_called do |args, options|
64
+ name = args.shift or raise 'Project name required'
65
+ project = JSpec::Project.for '.'
66
+ if dest = args.shift
67
+ project.install name, :to => dest, :release => options.release
68
+ else
69
+ Dir.mkdir project.normalize('support') unless File.directory? project.normalize('support')
70
+ project.install name, :to => project.normalize('support'), :release => options.release
71
+ end
72
+ end
73
+ end
74
+
75
+ command :init do |c|
76
+ c.syntax = 'jspec init [dest]'
77
+ c.summary = 'Initialize a JSpec project template'
78
+ c.description = 'Initialize a JSpec project template. Defaults to the current directory
79
+ when [dest] is not specified. The template includes several files for
80
+ running via Rhino, DOM, and the JSpec Rack server.
81
+
82
+ JSpec is also packed with a nodejs template via --node, omitting all of the
83
+ unnecessary browser related files.
84
+
85
+ Additional switches --freeze, and --symlink are available in order
86
+ to preserve the version of JSpec at the time of initialization. Otherwise
87
+ incompatibilities from later versions may prevent your suite from
88
+ running properly.
89
+
90
+ To update a project to the recent version of JSpec use
91
+ `jspec help udpate` for more information.'
92
+ c.option '-n', '--node', 'Initialize nodejs template'
93
+ c.option '-R', '--rails', 'Initialize rails template from rails root directory'
94
+ c.option '-f', '--freeze', 'Copy the JSpec library'
95
+ c.option '-s', '--symlink', 'Symlink the JSpec library instead of copying it'
96
+ c.example 'Create a project in the current directory', 'jspec init'
97
+ c.example 'Create a directory foo, initialized with a jspec template', 'jspec init foo'
98
+ c.example 'Rails application support', 'jspec init --rails'
99
+ c.example 'Rails application support, --rails is no longer required', 'jspec init'
100
+ c.example 'Freeze JSpec\'s library at spec/lib', 'jspec init --freeze'
101
+ c.when_called do |args, options|
102
+ JSpec::Project.for(dest = args.shift || '.').init! options.__hash__
103
+ say "Template initialized at `#{dest}'"
104
+ end
105
+ end
106
+
107
+ command :shell do |c|
108
+ c.syntax = 'jspec shell [path ...]'
109
+ c.summary = 'JSpec interactive shell'
110
+ c.description = 'Launch interactive Rhino shell with jspec.js, jspec.shell.js,
111
+ and any [path]s given. Simply type "quit" or "exit" to
112
+ terminate the shell.'
113
+ c.example 'Run shell', 'jspec shell'
114
+ c.example 'Run shell with glob of files', 'jspec shell lib/*.js'
115
+ c.example 'Run shell with list of files', 'jspec shell lib/foo.js lib/bar.js'
116
+ c.when_called do |args, options|
117
+ paths = ['jspec.js', 'jspec.shell.js'] | args
118
+ paths.map! do |path|
119
+ if path.include? 'jspec.'
120
+ "-f #{JSPEC_ROOT}/lib/#{path}"
121
+ else
122
+ "-f #{path}"
123
+ end
124
+ end
125
+ say "JSpec #{program(:version)}"
126
+ `#{JSpec::Project::RHINO} #{paths.join(' ')} -f -`
127
+ end
128
+ end
129
+
130
+ command :update do |c|
131
+ c.syntax = 'jspec update [dest]'
132
+ c.summary = 'Update JSpec releases'
133
+ c.description = 'Update JSpec release relative to [dest], this will allow you
134
+ to utilize the latest JSpec features. Execute from JSpec project
135
+ root without [dest] to update the default template spec files.
136
+
137
+ This command supports regular projects, as well as those initialized
138
+ with --symlink and --freeze.'
139
+ c.example 'Update project in the current directory', 'jspec update'
140
+ c.example 'Update project in the directory specified', 'jspec update path/to/project'
141
+ c.when_called do |args, options|
142
+ JSpec::Project.for(dest = args.shift || '.').update!
143
+ end
144
+ end
145
+
146
+ command :run do |c|
147
+ c.syntax = 'jspec run [path] [options]'
148
+ c.summary = 'Run specifications'
149
+ c.description = 'Run specifications, defaulting [path] to spec/dom.html.
150
+ You will need to supply [path] if your specs do not reside
151
+ in this location. `run --bind` is the default sub-command of
152
+ jspec so you may simply execute `jspec` in order to bind execution
153
+ of your specs when a file is altered.
154
+
155
+ Rhino:
156
+ The [path] is assumed to be spec/rhino.js unless specified.
157
+
158
+ Node.js:
159
+ The [path] is assumed to be spec/node.js unless specified.
160
+
161
+ JSpec\'s server is also available via --server, which defaults
162
+ the [path] to spec/server.html'
163
+ c.example 'Run once in default browser', 'jspec run'
164
+ c.example 'Run once in Safari and Firefox', 'jspec run --browsers Safari,Firefox'
165
+ c.example 'Run once in Opera, Firefox, Chrome, and WebKit', 'jspec run --browsers opera,ff,chrome,webkit'
166
+ c.example 'Run custom spec file', 'jspec run foo.html'
167
+ c.example 'Auto-run browsers when a file is altered', 'jspec run --bind --browsers Safari,Firefox'
168
+ c.example 'Shortcut for the previous example', 'jspec --browsers Safari,Firefox'
169
+ c.example 'Run Rhino specs', 'jspec run --rhino'
170
+ c.example 'Auto-run rhino when a file is altered', 'jspec --rhino'
171
+ c.option '-b', '--browsers BROWSERS', Array, 'Specify browsers to test'
172
+ c.option '-p', '--paths PATHS', Array, 'Specify paths when binding, defaults to javascript within ./lib and ./spec'
173
+ c.option '-B', '--bind', 'Auto-run specs when source files or specs are altered'
174
+ c.option '-R', '--rhino', 'Run specs using Rhino'
175
+ c.option '-N', '--node', 'Run specs using Node.js'
176
+ c.option '-S', '--server', 'Run specs using the JSpec server'
177
+ c.option '-P', '--port NUMBER', Integer, 'Start JSpec server using the given port number'
178
+ c.when_called do |args, options|
179
+ JSpec::Project.for('.').run! args.first, options.__hash__
180
+ end
181
+ end
182
+ alias_command :bind, :run, '--bind'
@@ -0,0 +1,44 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{jspec}
5
+ s.version = "4.0.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["TJ Holowaychuk"]
9
+ s.date = %q{2010-03-22}
10
+ s.default_executable = %q{jspec}
11
+ s.description = %q{JavaScript BDD Testing Framework}
12
+ s.email = %q{tj@vision-media.ca}
13
+ s.executables = ["jspec"]
14
+ s.extra_rdoc_files = ["README.md", "bin/jspec", "lib/images/bg.png", "lib/images/hr.png", "lib/images/loading.gif", "lib/images/sprites.bg.png", "lib/images/sprites.png", "lib/images/vr.png", "lib/jspec.css", "lib/jspec.growl.js", "lib/jspec.jquery.js", "lib/jspec.js", "lib/jspec.shell.js", "lib/jspec.timers.js", "lib/jspec.xhr.js"]
15
+ s.files = ["History.md", "Manifest", "README.md", "Rakefile", "bin/jspec", "jspec.gemspec", "lib/images/bg.png", "lib/images/hr.png", "lib/images/loading.gif", "lib/images/sprites.bg.png", "lib/images/sprites.png", "lib/images/vr.png", "lib/jspec.css", "lib/jspec.growl.js", "lib/jspec.jquery.js", "lib/jspec.js", "lib/jspec.shell.js", "lib/jspec.timers.js", "lib/jspec.xhr.js", "spec/commands/example_command.rb", "spec/dom.html", "spec/fixtures/test.html", "spec/fixtures/test.json", "spec/fixtures/test.xml", "spec/node.js", "spec/rhino.js", "spec/ruby/bin/init_spec.rb", "spec/ruby/bin/install_spec.rb", "spec/ruby/bin/run_spec.rb", "spec/ruby/bin/shell_spec.rb", "spec/ruby/bin/spec_helper.rb", "spec/ruby/bin/update_spec.rb", "spec/server.html", "spec/server.rb", "spec/support/env.js", "spec/support/jquery.js", "spec/unit/helpers.js", "spec/unit/spec.fixtures.js", "spec/unit/spec.grammar-less.js", "spec/unit/spec.grammar.js", "spec/unit/spec.jquery.js", "spec/unit/spec.jquery.xhr.js", "spec/unit/spec.js", "spec/unit/spec.matchers.js", "spec/unit/spec.modules.js", "spec/unit/spec.shared-behaviors.js", "spec/unit/spec.utils.js", "spec/unit/spec.xhr.js", "src/browsers.rb", "src/helpers.rb", "src/installables.rb", "src/project.rb", "src/routes.rb", "src/server.rb", "support/js.jar", "templates/default/History.md", "templates/default/Readme.md", "templates/default/lib/yourlib.js", "templates/default/spec/commands/example_command.rb", "templates/default/spec/dom.html", "templates/default/spec/node.js", "templates/default/spec/rhino.js", "templates/default/spec/server.html", "templates/default/spec/server.rb", "templates/default/spec/unit/spec.helper.js", "templates/default/spec/unit/spec.js", "templates/node/History.md", "templates/node/Readme.md", "templates/node/lib/yourlib.js", "templates/node/spec/node.js", "templates/node/spec/unit/spec.helper.js", "templates/node/spec/unit/spec.js", "templates/rails/commands/example_commands.rb", "templates/rails/dom.html", "templates/rails/rhino.js", "templates/rails/server.html", "templates/rails/server.rb", "templates/rails/unit/spec.helper.js", "templates/rails/unit/spec.js"]
16
+ s.homepage = %q{http://visionmedia.github.com/jspec}
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Jspec", "--main", "README.md"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{jspec}
20
+ s.rubygems_version = %q{1.3.6}
21
+ s.summary = %q{JavaScript BDD Testing Framework}
22
+
23
+ if s.respond_to? :specification_version then
24
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
+ s.specification_version = 3
26
+
27
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
+ s.add_runtime_dependency(%q<sinatra>, [">= 0"])
29
+ s.add_runtime_dependency(%q<json_pure>, [">= 0"])
30
+ s.add_runtime_dependency(%q<commander>, [">= 4.0.1"])
31
+ s.add_runtime_dependency(%q<bind>, [">= 0.2.8"])
32
+ else
33
+ s.add_dependency(%q<sinatra>, [">= 0"])
34
+ s.add_dependency(%q<json_pure>, [">= 0"])
35
+ s.add_dependency(%q<commander>, [">= 4.0.1"])
36
+ s.add_dependency(%q<bind>, [">= 0.2.8"])
37
+ end
38
+ else
39
+ s.add_dependency(%q<sinatra>, [">= 0"])
40
+ s.add_dependency(%q<json_pure>, [">= 0"])
41
+ s.add_dependency(%q<commander>, [">= 4.0.1"])
42
+ s.add_dependency(%q<bind>, [">= 0.2.8"])
43
+ end
44
+ end
@@ -0,0 +1,149 @@
1
+ body.jspec {
2
+ margin: 45px 0;
3
+ font: 12px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
4
+ background: #efefef url(images/bg.png) top left repeat-x;
5
+ text-align: center;
6
+ }
7
+ #jspec {
8
+ margin: 0 auto;
9
+ padding-top: 30px;
10
+ width: 1008px;
11
+ background: url(images/vr.png) top left repeat-y;
12
+ text-align: left;
13
+ }
14
+ #jspec-top {
15
+ position: relative;
16
+ margin: 0 auto;
17
+ width: 1008px;
18
+ height: 40px;
19
+ background: url(images/sprites.bg.png) top left no-repeat;
20
+ }
21
+ #jspec-bottom {
22
+ margin: 0 auto;
23
+ width: 1008px;
24
+ height: 15px;
25
+ background: url(images/sprites.bg.png) bottom left no-repeat;
26
+ }
27
+ #jspec .loading {
28
+ margin-top: -45px;
29
+ width: 1008px;
30
+ height: 80px;
31
+ background: url(images/loading.gif) 50% 50% no-repeat;
32
+ }
33
+ #jspec-title {
34
+ position: absolute;
35
+ top: 15px;
36
+ left: 20px;
37
+ width: 160px;
38
+ font-size: 22px;
39
+ font-weight: normal;
40
+ background: url(images/sprites.png) 0 -126px no-repeat;
41
+ text-align: center;
42
+ }
43
+ #jspec-title em {
44
+ font-size: 10px;
45
+ font-style: normal;
46
+ color: #BCC8D1;
47
+ }
48
+ #jspec-report * {
49
+ margin: 0;
50
+ padding: 0;
51
+ background: none;
52
+ border: none;
53
+ }
54
+ #jspec-report {
55
+ padding: 15px 40px;
56
+ font: 11px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
57
+ color: #7B8D9B;
58
+ }
59
+ #jspec-report.has-failures {
60
+ padding-bottom: 30px;
61
+ }
62
+ #jspec-report .hidden {
63
+ display: none;
64
+ }
65
+ #jspec-report .heading {
66
+ margin-bottom: 15px;
67
+ }
68
+ #jspec-report .heading span {
69
+ padding-right: 10px;
70
+ }
71
+ #jspec-report .heading .passes em {
72
+ color: #0ea0eb;
73
+ }
74
+ #jspec-report .heading .failures em {
75
+ color: #FA1616;
76
+ }
77
+ #jspec-report table {
78
+ font-size: 11px;
79
+ border-collapse: collapse;
80
+ }
81
+ #jspec-report td {
82
+ padding: 8px;
83
+ text-indent: 30px;
84
+ color: #7B8D9B;
85
+ }
86
+ #jspec-report tr.body {
87
+ display: none;
88
+ }
89
+ #jspec-report tr.body pre {
90
+ margin: 0;
91
+ padding: 0 0 5px 25px;
92
+ }
93
+ #jspec-report tr.even:hover + tr.body,
94
+ #jspec-report tr.odd:hover + tr.body {
95
+ display: block;
96
+ }
97
+ #jspec-report tr td:first-child em {
98
+ display: block;
99
+ clear: both;
100
+ font-style: normal;
101
+ font-weight: normal;
102
+ color: #7B8D9B;
103
+ }
104
+ #jspec-report tr.even:hover,
105
+ #jspec-report tr.odd:hover {
106
+ text-shadow: 1px 1px 1px #fff;
107
+ background: #F2F5F7;
108
+ }
109
+ #jspec-report td + td {
110
+ padding-right: 0;
111
+ width: 15px;
112
+ }
113
+ #jspec-report td.pass {
114
+ background: url(images/sprites.png) 3px -7px no-repeat;
115
+ }
116
+ #jspec-report td.fail {
117
+ background: url(images/sprites.png) 3px -158px no-repeat;
118
+ font-weight: bold;
119
+ color: #FC0D0D;
120
+ }
121
+ #jspec-report td.requires-implementation {
122
+ background: url(images/sprites.png) 3px -333px no-repeat;
123
+ }
124
+ #jspec-report tr.description td {
125
+ margin-top: 25px;
126
+ padding-top: 25px;
127
+ font-size: 12px;
128
+ font-weight: bold;
129
+ text-indent: 0;
130
+ color: #1a1a1a;
131
+ }
132
+ #jspec-report tr.description:first-child td {
133
+ border-top: none;
134
+ }
135
+ #jspec-report .assertion {
136
+ display: block;
137
+ float: left;
138
+ margin: 0 0 0 1px;
139
+ padding: 0;
140
+ width: 1px;
141
+ height: 5px;
142
+ background: #7B8D9B;
143
+ }
144
+ #jspec-report .assertion.failed {
145
+ background: red;
146
+ }
147
+ .jspec-sandbox {
148
+ display: none;
149
+ }
@@ -0,0 +1,115 @@
1
+
2
+ // JSpec - Growl - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
3
+
4
+ ;(function(){
5
+
6
+ Growl = {
7
+
8
+ // --- Version
9
+
10
+ version: '1.0.0',
11
+
12
+ /**
13
+ * Execute the given _cmd_, returning an array of lines from stdout.
14
+ *
15
+ * Examples:
16
+ *
17
+ * Growl.exec('growlnotify', '-m', msg)
18
+ *
19
+ * @param {string ...} cmd
20
+ * @return {array}
21
+ * @api public
22
+ */
23
+
24
+ exec: function(cmd) {
25
+ var lines = [], line
26
+ with (JavaImporter(java.lang, java.io)) {
27
+ var proccess = Runtime.getRuntime().exec(Array.prototype.slice.call(arguments))
28
+ var stream = new DataInputStream(proccess.getInputStream())
29
+ while (line = stream.readLine())
30
+ lines.push(line + '')
31
+ stream.close()
32
+ }
33
+ return lines
34
+ },
35
+
36
+ /**
37
+ * Return the extension of the given _path_ or null.
38
+ *
39
+ * @param {string} path
40
+ * @return {string}
41
+ * @api private
42
+ */
43
+
44
+ extname: function(path) {
45
+ return path.lastIndexOf('.') != -1 ?
46
+ path.slice(path.lastIndexOf('.') + 1, path.length) :
47
+ null
48
+ },
49
+
50
+ /**
51
+ * Version of the 'growlnotify' binary.
52
+ *
53
+ * @return {string}
54
+ * @api private
55
+ */
56
+
57
+ binVersion: function() {
58
+ try { return this.exec('growlnotify', '-v')[0].split(' ')[1] } catch (e) {}
59
+ },
60
+
61
+ /**
62
+ * Send growl notification _msg_ with _options_.
63
+ *
64
+ * Options:
65
+ *
66
+ * - title Notification title
67
+ * - sticky Make the notification stick (defaults to false)
68
+ * - name Application name (defaults to growlnotify)
69
+ * - image
70
+ * - path to an icon sets --iconpath
71
+ * - path to an image sets --image
72
+ * - capitalized word sets --appIcon
73
+ * - filename uses extname as --icon
74
+ * - otherwise treated as --icon
75
+ *
76
+ * Examples:
77
+ *
78
+ * Growl.notify('New email')
79
+ * Growl.notify('5 new emails', { title: 'Thunderbird' })
80
+ *
81
+ * @param {string} msg
82
+ * @param {options} hash
83
+ * @api public
84
+ */
85
+
86
+ notify: function(msg, options) {
87
+ options = options || {}
88
+ var args = ['growlnotify', '-m', msg]
89
+ if (!this.binVersion()) throw new Error('growlnotify executable is required')
90
+ if (image = options.image) {
91
+ var flag, ext = this.extname(image)
92
+ flag = flag || ext == 'icns' && 'iconpath'
93
+ flag = flag || /^[A-Z]/.test(image) && 'appIcon'
94
+ flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image'
95
+ flag = flag || ext && (image = ext) && 'icon'
96
+ flag = flag || 'icon'
97
+ args.push('--' + flag, image)
98
+ }
99
+ if (options.sticky) args.push('--sticky')
100
+ if (options.name) args.push('--name', options.name)
101
+ if (options.title) args.push(options.title)
102
+ this.exec.apply(this, args)
103
+ }
104
+ }
105
+
106
+ JSpec.include({
107
+ name: 'Growl',
108
+ reporting: function(options){
109
+ var stats = JSpec.stats
110
+ if (stats.failures) Growl.notify('failed ' + stats.failures + ' assertions', { title: 'JSpec'})
111
+ else Growl.notify('passed ' + stats.passes + ' assertions', { title: 'JSpec' })
112
+ }
113
+ })
114
+
115
+ })()