shenandoah 0.0.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.
- data/.braids +8 -0
- data/.document +5 -0
- data/.gitignore +6 -0
- data/ChangeLog.markdown +6 -0
- data/LICENSE +20 -0
- data/LICENSE-Blue-Ridge +20 -0
- data/LICENSE-Screw.Unit +22 -0
- data/LICENSE-Smoke +22 -0
- data/README.markdown +260 -0
- data/Rakefile +70 -0
- data/VERSION.yml +4 -0
- data/lib/shenandoah/buildr.rb +9 -0
- data/lib/shenandoah/buildr/locator.rb +17 -0
- data/lib/shenandoah/buildr/shenandoah_tasks.rb +18 -0
- data/lib/shenandoah/buildr/test_framework.rb +28 -0
- data/lib/shenandoah/css/screw.css +90 -0
- data/lib/shenandoah/javascript/browser/runner.js +34 -0
- data/lib/shenandoah/javascript/common/jquery-1.3.2.js +4376 -0
- data/lib/shenandoah/javascript/common/jquery.fn.js +29 -0
- data/lib/shenandoah/javascript/common/jquery.print.js +109 -0
- data/lib/shenandoah/javascript/common/screw.behaviors.js +129 -0
- data/lib/shenandoah/javascript/common/screw.builder.js +104 -0
- data/lib/shenandoah/javascript/common/screw.events.js +45 -0
- data/lib/shenandoah/javascript/common/screw.matchers.js +254 -0
- data/lib/shenandoah/javascript/common/screw.mocking.js +22 -0
- data/lib/shenandoah/javascript/common/smoke.core.js +6 -0
- data/lib/shenandoah/javascript/common/smoke.mock.js +130 -0
- data/lib/shenandoah/javascript/common/smoke.stub.js +29 -0
- data/lib/shenandoah/javascript/console/consoleReportForRake.js +32 -0
- data/lib/shenandoah/javascript/console/env.rhino.js +8841 -0
- data/lib/shenandoah/javascript/console/js.jar +0 -0
- data/lib/shenandoah/javascript/console/runner.js +43 -0
- data/lib/shenandoah/javascript/console/shell.js.erb +23 -0
- data/lib/shenandoah/locator.rb +17 -0
- data/lib/shenandoah/runner.rb +69 -0
- data/lib/shenandoah/server.rb +88 -0
- data/lib/shenandoah/server/views/index.haml +12 -0
- data/lib/shenandoah/tasks.rb +58 -0
- data/shenandoah.gemspec +133 -0
- data/spec/shenandoah/buildr/locator_spec.rb +33 -0
- data/spec/shenandoah/buildr/shenandoah_tasks_spec.rb +27 -0
- data/spec/shenandoah/buildr/spec_helper.rb +2 -0
- data/spec/shenandoah/buildr/test_framework_spec.rb +77 -0
- data/spec/shenandoah/locator_spec.rb +74 -0
- data/spec/shenandoah/runner_spec.rb +110 -0
- data/spec/shenandoah/server_spec.rb +216 -0
- data/spec/shenandoah/tasks_spec.rb +76 -0
- data/spec/spec_helper.rb +36 -0
- metadata +232 -0
data/.braids
ADDED
data/.document
ADDED
data/.gitignore
ADDED
data/ChangeLog.markdown
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Rhett Sutphin
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/LICENSE-Blue-Ridge
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008-2009 Relevance, Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/LICENSE-Screw.Unit
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008 Nick Kallen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/LICENSE-Smoke
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008 Andy Kent
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,260 @@
|
|
1
|
+
Shenandoah JavaScript Testing metapackage
|
2
|
+
=========================================
|
3
|
+
|
4
|
+
Shenandoah adds support for command-line and in-browser JavaScript unit tests in your buildr, rails, or other rake-using project. It bundles several great tools together in a convention-over-configuration, Rails-like way. These tools include:
|
5
|
+
|
6
|
+
* `Rhino` - a Java-based JavaScript interpreter
|
7
|
+
* `Screw.Unit` - a behaviour-driven development syntax for JavaScript similar to RSpec
|
8
|
+
* `Smoke` - a JavaScript mocking & stubbing library similar to Mocha
|
9
|
+
* `env.js` - a DOM implementation written entirely in JavaScript
|
10
|
+
|
11
|
+
Shenandoah is a generalization of the [Blue Ridge][blue-ridge] plugin for rails. (See below for differences.)
|
12
|
+
|
13
|
+
[blue-ridge]: http://github.com/relevance/blue-ridge
|
14
|
+
|
15
|
+
General Use
|
16
|
+
-----------
|
17
|
+
|
18
|
+
Shenandoah provides a command-line runner and a server to enable in-browser testing with simple path management.
|
19
|
+
|
20
|
+
The command-line runner is a lot like any other test framework's: It runs some or all of the specs and tells you which ones fail.
|
21
|
+
|
22
|
+
The server (after you start it), is available at [http://localhost:4410/](http://localhost:4410/). The root path will give you a list of specs, linked to the pages where you can run them.
|
23
|
+
|
24
|
+
Shenandoah also provides an interactive shell a la `irb`. You can use it to experiment with javascript in a similar context to the command line runner.
|
25
|
+
|
26
|
+
The following sections describe how to invoke Shenandoah with various build systems.
|
27
|
+
|
28
|
+
Installing and Running
|
29
|
+
----------------------
|
30
|
+
|
31
|
+
To install:
|
32
|
+
|
33
|
+
$ gem install shenandoah
|
34
|
+
|
35
|
+
### Use with buildr
|
36
|
+
|
37
|
+
# In your buildfile
|
38
|
+
require 'shenandoah/buildr'
|
39
|
+
# ...
|
40
|
+
define :web_js do
|
41
|
+
test.using :shenandoah, :main_path => project('web')._("src/main/webapp/js")
|
42
|
+
end
|
43
|
+
|
44
|
+
In buildr, Shenandoah expects to find your specs in the `src/spec/javascript` directory. The main path defaults to `src/main/javascript`, but may be changed as in the example.
|
45
|
+
|
46
|
+
To run the specs from the command line:
|
47
|
+
|
48
|
+
$ buildr web_js:test
|
49
|
+
|
50
|
+
To run an individual spec file called "application_spec.js":
|
51
|
+
|
52
|
+
$ cd web_js
|
53
|
+
web_js$ buildr test:application
|
54
|
+
|
55
|
+
To start the server:
|
56
|
+
|
57
|
+
$ buildr web_js:shen:serve
|
58
|
+
|
59
|
+
To start the shell:
|
60
|
+
|
61
|
+
$ buildr web_js:shen:shell
|
62
|
+
|
63
|
+
### Use with Rails
|
64
|
+
|
65
|
+
TODO
|
66
|
+
|
67
|
+
### Use with rake (in general)
|
68
|
+
|
69
|
+
# In your Rakefile
|
70
|
+
require 'rubygems'
|
71
|
+
require 'shenandoah/tasks'
|
72
|
+
Shenandoah::Tasks.new(:main_path => 'public/javascript', :spec_path => 'test/javascript')
|
73
|
+
|
74
|
+
With plain rake, Shenandoah defaults to `lib` for the main path and `spec` for the spec path.
|
75
|
+
|
76
|
+
To run all the specs from the command_line:
|
77
|
+
|
78
|
+
$ rake shen:spec
|
79
|
+
|
80
|
+
To run an individual spec file called "application_spec.js":
|
81
|
+
|
82
|
+
$ rake shen:spec SHEN_SPEC=application
|
83
|
+
|
84
|
+
To start the server:
|
85
|
+
|
86
|
+
$ rake shen:serve
|
87
|
+
|
88
|
+
To start the shell:
|
89
|
+
|
90
|
+
$ rake shen:shell
|
91
|
+
|
92
|
+
Specs and Fixtures
|
93
|
+
------------------
|
94
|
+
|
95
|
+
Each Shenandoah spec is two files: a javascript spec (e.g. `name_spec.js`) and and HTML fixture (e.g. `name.html`). The spec contains the the actual Screw.Unit test definitions. The fixture contains the DOM that the spec (or the code under test) relies on to work.
|
96
|
+
|
97
|
+
Example Using jQuery
|
98
|
+
--------------------
|
99
|
+
|
100
|
+
Shenandoah is opinionated and assumes you're using jQuery by default. The plugin itself actually uses jQuery under the covers to run Screw.Unit.
|
101
|
+
|
102
|
+
require_spec("spec_helper.js");
|
103
|
+
require_main("application.js");
|
104
|
+
|
105
|
+
Screw.Unit(function() {
|
106
|
+
describe("Your application javascript", function() {
|
107
|
+
it("does something", function() {
|
108
|
+
expect("hello").to(equal, "hello");
|
109
|
+
});
|
110
|
+
|
111
|
+
it("accesses the DOM from fixtures/application.html", function() {
|
112
|
+
expect($('.select_me').length).to(equal, 2);
|
113
|
+
});
|
114
|
+
});
|
115
|
+
});
|
116
|
+
|
117
|
+
(By the way, we don’t actually encourage you to write specs and tests for standard libraries like JQuery and Prototype. It just makes for an easy demo.)
|
118
|
+
|
119
|
+
Example Using Prototype
|
120
|
+
-----------------------
|
121
|
+
|
122
|
+
It's very easy to add support for Prototype. Here's an example spec:
|
123
|
+
|
124
|
+
jQuery.noConflict();
|
125
|
+
|
126
|
+
require_spec("spec_helper.js");
|
127
|
+
require_main("prototype.js");
|
128
|
+
require_main("application.js");
|
129
|
+
|
130
|
+
Screw.Unit(function() {
|
131
|
+
describe("Your application javascript", function() {
|
132
|
+
it("does something", function() {
|
133
|
+
expect("hello").to(equal, "hello");
|
134
|
+
});
|
135
|
+
|
136
|
+
it("accesses the DOM from fixtures/application.html", function() {
|
137
|
+
expect($$('.select_me').length).to(equal, 2);
|
138
|
+
});
|
139
|
+
});
|
140
|
+
});
|
141
|
+
|
142
|
+
More Examples
|
143
|
+
-------------
|
144
|
+
|
145
|
+
TODO.
|
146
|
+
|
147
|
+
<!--
|
148
|
+
To see Shenandoah in action inside a working Rails app, check out the [Shenandoah sample application](http://github.com/relevance/shenandoah-rails-sample-app). Among other things, this sample app includes examples of:
|
149
|
+
|
150
|
+
* using nested `describe` functions
|
151
|
+
* setting up per-spec HTML "fixtures"
|
152
|
+
* stubbing functions
|
153
|
+
* mocking functions
|
154
|
+
* running the javascript specs as part of your default Rake task
|
155
|
+
-->
|
156
|
+
|
157
|
+
JavaScript API
|
158
|
+
--------------
|
159
|
+
|
160
|
+
Shenandoah provides a handful of functions that help you write specs that can run inside a web browser as well from the Rhino command-line test runner.
|
161
|
+
|
162
|
+
### require_main(filename)
|
163
|
+
|
164
|
+
Loads a dependency from the main path.
|
165
|
+
|
166
|
+
When running from the command line, `require_main` becomes a Rhino call to `load`, resolving the file against the configured `main_path`. In a web browser, `require_main` loads and evaluates the script using a synchronous background request to ensure that all the scripts are loaded in order.
|
167
|
+
|
168
|
+
### require_spec(filename)
|
169
|
+
|
170
|
+
Loads a dependency from the spec path.
|
171
|
+
|
172
|
+
Just like `require_main`, but for spec files.
|
173
|
+
|
174
|
+
The Shell
|
175
|
+
---------
|
176
|
+
|
177
|
+
Shenandoah provides an `irb`-like JavaScript shell for debugging your JavaScript code. jQuery and env.js are pre-loaded for you to make debugging DOM code easy.
|
178
|
+
|
179
|
+
=================================================
|
180
|
+
Rhino JavaScript Shell
|
181
|
+
To exit type 'exit', 'quit', or 'quit()'.
|
182
|
+
=================================================
|
183
|
+
- loaded env.js
|
184
|
+
- sample DOM loaded
|
185
|
+
- jQuery-1.2.6 loaded
|
186
|
+
=================================================
|
187
|
+
Rhino 1.7 release 2 PRERELEASE 2008 07 28
|
188
|
+
js> print("Hello World!")
|
189
|
+
Hello World!
|
190
|
+
js>
|
191
|
+
|
192
|
+
Note that if you have `rlwrap` installed and on the command line path (and you really, really should!), then command-line history and readline arrow-up and down will be properly supported automatically. (You can get `rlwrap` from your friendly neighborhood package manager.)
|
193
|
+
|
194
|
+
Mocking Example with Smoke
|
195
|
+
--------------------------
|
196
|
+
|
197
|
+
Smoke is a JavaScript mocking and stubbing toolkit that is somewhat similar to FlexMock or Mocha. It is automatically wired-in to undo its mocking after each Screw.Unit `it` block. Here's an example.
|
198
|
+
|
199
|
+
it("calculates the total cost of a contract by adding the prices of each component", function() {
|
200
|
+
var componentX = {}, componentY = {};
|
201
|
+
mock(SalesContract).should_receive("calculateComponentPrice").with_arguments(componentX).exactly(1, "times").and_return(42);
|
202
|
+
mock(SalesContract).should_receive("calculateComponentPrice").with_arguments(componentY).exactly(1, "times").and_return(24);
|
203
|
+
expect(SalesContract.calculateTotalCost([componentX, componentY])).to(equal, 66);
|
204
|
+
});
|
205
|
+
|
206
|
+
Note that the flexible nature of the JavaScript the language means that you might not need to use Smoke, especially for stubbing.
|
207
|
+
|
208
|
+
Tips & Tricks
|
209
|
+
-------------
|
210
|
+
* Avoid using `print` in your tests while debugging. It works fine from the command line but causes lots of headaches in browser. (Just imagine a print dialog opening ten or fifteen times and then Firefox crashing. This is a mistake I've made too many times! Trust me!)
|
211
|
+
|
212
|
+
Bugs & Patches
|
213
|
+
--------------
|
214
|
+
|
215
|
+
If you see any bugs or possible improvements, please use the project's [GitHub issue tracker](http://github.com/rsutphin/shenandoah/issues) to report them.
|
216
|
+
|
217
|
+
If you like, you could even fork the [GitHub repo](http://www.github.com/rsutphin/shenandoah) and start hacking.
|
218
|
+
|
219
|
+
Differences from Blue Ridge
|
220
|
+
---------------------------
|
221
|
+
|
222
|
+
Shenandoah is based on the [Blue Ridge JavaScript Testing Rails Plugin][blue-ridge]. The main difference is that it works for any project that uses rake or buildr, not just rails projects. If you are using a rails project, you might consider using Shenandoah instead of Blue Ridge anyway:
|
223
|
+
|
224
|
+
* Blue Ridge requires all specs to be in the same directory (subdirectories are not allowed). Shenandoah does not have this limitation.
|
225
|
+
* Shenandoah's design places the spec js and the fixture html in the same directory. Blue Ridge puts them in separate directories, leading to parallel hierarchies.
|
226
|
+
* Shenandoah provides an in-browser index for the specs. Blue Ridge requires opening each HTML fixture separately.
|
227
|
+
|
228
|
+
The cost for all this is that Shenandoah fixtures can't be opened directly in the browser — they can only be opened via the server.
|
229
|
+
|
230
|
+
Links
|
231
|
+
-----
|
232
|
+
|
233
|
+
* [Blue Ridge JavaScript Testing Rails Plugin](http://github.com/relevance/blue-ridge)
|
234
|
+
* [Blue Ridge Sample App](http://github.com/relevance/blue-ridge-sample-app)
|
235
|
+
* [Justin Gehtland's "Fully Headless JSSpec" Blog Post](http://blog.thinkrelevance.com/2008/7/31/fully-headless-jsspec)
|
236
|
+
* [Screw.Unit](http://github.com/nkallen/screw-unit)
|
237
|
+
* [Screw.Unit Mailing List](http://groups.google.com/group/screw-unit)
|
238
|
+
* [Smoke](http://github.com/andykent/smoke)
|
239
|
+
* [env.js](http://github.com/thatcher/env-js)
|
240
|
+
* [env.js Mailing List](http://groups.google.com/group/envjs)
|
241
|
+
* [Mozilla Rhino](http://www.mozilla.org/rhino/)
|
242
|
+
* [W3C DOM Specifications](http://www.w3.org/DOM/DOMTR)
|
243
|
+
|
244
|
+
Contributors
|
245
|
+
------------
|
246
|
+
* Justin Gehtland
|
247
|
+
* Geof Dagley
|
248
|
+
* Larry Karnowski
|
249
|
+
* Chris Thatcher (for numerous env.js bug fixes!)
|
250
|
+
* Raimonds Simanovskis
|
251
|
+
* Jason Rudolph
|
252
|
+
|
253
|
+
Copyrights
|
254
|
+
------------
|
255
|
+
* Copyright © 2009 Rhett Sutphin, under the MIT license
|
256
|
+
* Based on blue-ridge, Copyright 2008-2009 [Relevance, Inc.](http://www.thinkrelevance.com/), under the MIT license
|
257
|
+
* env.js - Copyright 2007-2009 John Resig, under the MIT License
|
258
|
+
* Screw.Unit - Copyright 2008 Nick Kallen, license attached
|
259
|
+
* Rhino - Copyright 2009 Mozilla Foundation, GPL 2.0
|
260
|
+
* Smoke - Copyright 2008 Andy Kent, license attached
|
data/Rakefile
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "shenandoah"
|
8
|
+
gem.summary = %Q{A javascript test framework for buildr, rails, and other ruby-built projects}
|
9
|
+
gem.email = "rhett@detailedbalance.net"
|
10
|
+
gem.homepage = "http://github.com/rsutphin/shenandoah"
|
11
|
+
gem.authors = ["Rhett Sutphin"]
|
12
|
+
gem.rubyforge_project = "detailedbalance"
|
13
|
+
|
14
|
+
# Exclude test-only vendored buildr
|
15
|
+
gem.files.exclude("vendor/**/*")
|
16
|
+
|
17
|
+
gem.add_runtime_dependency('sinatra', '>= 0.9.2')
|
18
|
+
gem.add_runtime_dependency('haml', '>= 2.0.9')
|
19
|
+
gem.add_runtime_dependency('rake')
|
20
|
+
|
21
|
+
# Have to use rspec 1.2.4 for buildr compat
|
22
|
+
gem.add_development_dependency('rspec', '= 1.2.4')
|
23
|
+
gem.add_development_dependency('rack-test', '>= 0.3.0')
|
24
|
+
gem.add_development_dependency('rspec_hpricot_matchers', '>= 1.0.0')
|
25
|
+
gem.add_development_dependency('braid', '>= 0.5.0')
|
26
|
+
|
27
|
+
# These are the dependencies for the vendored buildr (used for testing)
|
28
|
+
gem.add_development_dependency('rake', '= 0.8.4')
|
29
|
+
gem.add_development_dependency('net-ssh', '= 2.0.11')
|
30
|
+
gem.add_development_dependency('net-sftp', '= 2.0.2')
|
31
|
+
gem.add_development_dependency('highline', '= 1.5.0')
|
32
|
+
gem.add_development_dependency('hoe', '= 1.12.2')
|
33
|
+
end
|
34
|
+
|
35
|
+
Jeweler::RubyforgeTasks.new
|
36
|
+
rescue LoadError
|
37
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
38
|
+
end
|
39
|
+
|
40
|
+
require 'spec/rake/spectask'
|
41
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
42
|
+
spec.libs << 'lib' << 'spec'
|
43
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
44
|
+
end
|
45
|
+
|
46
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
47
|
+
spec.libs << 'lib' << 'spec'
|
48
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
49
|
+
spec.rcov = true
|
50
|
+
# rcov can't tell that /Library/Ruby is a system path
|
51
|
+
spec.rcov_opts = ['--exclude', "spec/*,/Library/Ruby/*"]
|
52
|
+
end
|
53
|
+
|
54
|
+
task :default => :spec
|
55
|
+
|
56
|
+
require 'rake/rdoctask'
|
57
|
+
Rake::RDocTask.new do |rdoc|
|
58
|
+
if File.exist?('VERSION.yml')
|
59
|
+
config = YAML.load(File.read('VERSION.yml'))
|
60
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
61
|
+
else
|
62
|
+
version = ""
|
63
|
+
end
|
64
|
+
|
65
|
+
rdoc.rdoc_dir = 'rdoc'
|
66
|
+
rdoc.title = "shenandoah #{version}"
|
67
|
+
rdoc.rdoc_files.include('README*')
|
68
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
69
|
+
end
|
70
|
+
|