webkit-rspec-formatter 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data.tar.gz.sig +0 -0
  2. data/ChangeLog +81 -0
  3. data/LICENSE +27 -0
  4. data/README.md +26 -0
  5. data/Rakefile +370 -0
  6. data/data/webkit-rspec-formatter/css/textmate-rspec.css +332 -0
  7. data/data/webkit-rspec-formatter/images/clock.png +0 -0
  8. data/data/webkit-rspec-formatter/images/cross_circle.png +0 -0
  9. data/data/webkit-rspec-formatter/images/cross_circle_frame.png +0 -0
  10. data/data/webkit-rspec-formatter/images/cross_octagon.png +0 -0
  11. data/data/webkit-rspec-formatter/images/cross_octagon_frame.png +0 -0
  12. data/data/webkit-rspec-formatter/images/cross_shield.png +0 -0
  13. data/data/webkit-rspec-formatter/images/exclamation.png +0 -0
  14. data/data/webkit-rspec-formatter/images/exclamation_frame.png +0 -0
  15. data/data/webkit-rspec-formatter/images/exclamation_shield.png +0 -0
  16. data/data/webkit-rspec-formatter/images/exclamation_small.png +0 -0
  17. data/data/webkit-rspec-formatter/images/plus_circle.png +0 -0
  18. data/data/webkit-rspec-formatter/images/plus_circle_frame.png +0 -0
  19. data/data/webkit-rspec-formatter/images/question.png +0 -0
  20. data/data/webkit-rspec-formatter/images/question_frame.png +0 -0
  21. data/data/webkit-rspec-formatter/images/question_shield.png +0 -0
  22. data/data/webkit-rspec-formatter/images/question_small.png +0 -0
  23. data/data/webkit-rspec-formatter/images/tick.png +0 -0
  24. data/data/webkit-rspec-formatter/images/tick_circle.png +0 -0
  25. data/data/webkit-rspec-formatter/images/tick_circle_frame.png +0 -0
  26. data/data/webkit-rspec-formatter/images/tick_shield.png +0 -0
  27. data/data/webkit-rspec-formatter/images/tick_small.png +0 -0
  28. data/data/webkit-rspec-formatter/images/tick_small_circle.png +0 -0
  29. data/data/webkit-rspec-formatter/images/ticket.png +0 -0
  30. data/data/webkit-rspec-formatter/images/ticket_arrow.png +0 -0
  31. data/data/webkit-rspec-formatter/images/ticket_exclamation.png +0 -0
  32. data/data/webkit-rspec-formatter/images/ticket_minus.png +0 -0
  33. data/data/webkit-rspec-formatter/images/ticket_pencil.png +0 -0
  34. data/data/webkit-rspec-formatter/images/ticket_plus.png +0 -0
  35. data/data/webkit-rspec-formatter/images/ticket_small.png +0 -0
  36. data/data/webkit-rspec-formatter/js/jquery-1.4.2.min.js +154 -0
  37. data/data/webkit-rspec-formatter/js/textmate-rspec.js +402 -0
  38. data/data/webkit-rspec-formatter/templates/failed.rhtml +35 -0
  39. data/data/webkit-rspec-formatter/templates/footer.rhtml +9 -0
  40. data/data/webkit-rspec-formatter/templates/header.rhtml +35 -0
  41. data/data/webkit-rspec-formatter/templates/page.rhtml +131 -0
  42. data/data/webkit-rspec-formatter/templates/passed.rhtml +10 -0
  43. data/data/webkit-rspec-formatter/templates/pending-fixed.rhtml +25 -0
  44. data/data/webkit-rspec-formatter/templates/pending.rhtml +14 -0
  45. data/lib/rspec/core/formatters/web_kit.rb +4 -0
  46. data/lib/rspec/core/formatters/webkit.rb +222 -0
  47. data/lib/rspec/mate/runner.rb +65 -0
  48. data/rake/191_compat.rb +26 -0
  49. data/rake/dependencies.rb +76 -0
  50. data/rake/documentation.rb +123 -0
  51. data/rake/helpers.rb +502 -0
  52. data/rake/hg.rb +287 -0
  53. data/rake/manual.rb +787 -0
  54. data/rake/packaging.rb +129 -0
  55. data/rake/publishing.rb +339 -0
  56. data/rake/style.rb +62 -0
  57. data/rake/svn.rb +668 -0
  58. data/rake/testing.rb +151 -0
  59. data/rake/verifytask.rb +64 -0
  60. metadata +217 -0
  61. metadata.gz.sig +0 -0
data.tar.gz.sig ADDED
Binary file
data/ChangeLog ADDED
@@ -0,0 +1,81 @@
1
+ 26[github/master,master,tip] 5ff0e8d21818 2010-10-21 16:35 -0700 ged
2
+ Fix the project page URL
3
+
4
+ 25 dcac16539488 2010-10-21 16:33 -0700 ged
5
+ On second thought, make the links actually links. Duh
6
+
7
+ 24 7d0875336f79 2010-10-21 16:30 -0700 ged
8
+ Actually add the link to the Github mirror
9
+
10
+ 23 118d08bb8ab1 2010-10-21 16:29 -0700 ged
11
+ Rename README -> README.md since I changed it to Markdown
12
+
13
+ 22 406646ae0941 2010-10-21 16:25 -0700 ged
14
+ CSS changes, split out templates, nested example groups
15
+
16
+ 21 06221c136d6b 2010-10-20 17:23 -0700 ged
17
+ More RSpec 2.0 fixes
18
+
19
+ 20 3dd8bff179fd 2010-10-20 13:58 -0700 ged
20
+ Add a shim to allow the formatter for the --format option
21
+
22
+ 19 3df4a3eaa994 2010-10-19 15:30 -0700 ged
23
+ Updated build system, project metadata.
24
+
25
+ 18 e6628d07ab9f 2010-10-19 15:27 -0700 ged
26
+ Added tag 1.0.0 for changeset 45d2888c3afa
27
+
28
+ 17 14ec4d0f642e 2010-10-19 15:26 -0700 ged
29
+ Version bump to 2.0.0
30
+
31
+ 16 9fac9e11e14e 2010-10-19 15:25 -0700 ged
32
+ Upgrade to RSpec 2.0
33
+
34
+ 15 057eca6f4b84 2010-10-19 15:24 -0700 ged
35
+ Move resource files into the datadir
36
+
37
+ 14[1.0.0] 45d2888c3afa 2010-08-23 13:53 -0700 ged
38
+ Updated to work under my fork of rspec/rspec-tmbundle using only an environment variable.
39
+
40
+ 13 195d2dba198a 2010-08-23 10:51 -0700 ged
41
+ Updated build system for JRuby and MRI 1.9.2.
42
+
43
+ 12 91754df5cb4b 2010-04-19 08:48 -0700 ged
44
+ Updated build system.
45
+
46
+ 11 96b80268f5e5 2010-03-23 08:13 -0700 ged
47
+ More cleanup and documentation
48
+
49
+ 10 811c00ded302 2010-03-19 10:28 -0700 ged
50
+ Updated to work with recent version of 'Ruby RSpec' bundle, updated jQuery.
51
+
52
+ 9 bfa9742a4ee5 2009-06-14 00:27 +0000 deveiant
53
+ * Updated build system.
54
+
55
+ 8 c9c79767104a 2009-05-29 02:46 +0000 deveiant
56
+ Fixed the log-toggle click handler.
57
+
58
+ 7 6306a3c2e23f 2009-05-28 23:40 +0000 deveiant
59
+ * Qualify the data directory of the formatter as its gem path if its loaded as a gem.
60
+
61
+ 6 70e99153196a 2009-05-10 21:00 +0000 deveiant
62
+ * Updated for RSpec 1.2.4
63
+
64
+ 5 d8cf7477aa41 2009-04-29 13:23 +0000 deveiant
65
+ Updated build.
66
+
67
+ 4 f479fadaffd8 2009-04-28 00:50 +0000 deveiant
68
+ * Upgraded to RSpec 1.2.4.
69
+
70
+ 3 0ee8ca9d463a 2009-04-27 16:57 +0000 deveiant
71
+ Added alternative TextMate RSpec runner.
72
+
73
+ 2 db46f308449c 2009-04-27 16:50 +0000 deveiant
74
+ * Updated with an in-progress timer that shows the graph as a progress bar
75
+
76
+ 1 2afa45a6e2c6 2009-04-27 13:26 +0000 deveiant
77
+ Added the build system.
78
+
79
+ 0 de236604bbaf 2009-04-27 13:20 +0000 deveiant
80
+ Initial import
81
+
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2009-2010, Michael Granger
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ * Neither the name of the author/s, nor the names of the project's
15
+ contributors may be used to endorse or promote products derived from this
16
+ software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # A WebKit RSpec Formatter
2
+
3
+ This is a formatter for RSpec 2 that takes advantage of features in [WebKit](http://webkit.org/) to make the output from RSpec in Textmate more fun.
4
+
5
+ Test output looks like this:
6
+
7
+ ![Example Output](http://deveiate.org/images/tmrspec-example.png)
8
+
9
+ ## Installation
10
+
11
+ To get started, install the `webkit-rspec-formatter` gem:
12
+
13
+ $ gem install webkit-rspec-formatter
14
+
15
+ If you're running specs in Textmate via [the RSpec bundle](http://github.com/rspec/rspec-tmbundle), you can use the webkit formatter by opening Textmate's 'Advanced' Preferences and adding a `TM_RSPEC_OPTS` Shell Variable with the value `--format RSpec::Core::Formatters::WebKit`:
16
+
17
+ ![Setting TM_RSPEC_OPTS](http://deveiate.org/images/tmrspecopts-shellvar.png)
18
+
19
+ That's it!
20
+
21
+ ## Miscellaneous
22
+
23
+ It's also usable anywhere else the standard HTML formatter is, of course. Also, while it's specifically intended to be used under the Textmate HTML viewer that the RSpec bundle uses, the output should work fine under recent Gecko/Firefox-based viewers, as well.
24
+
25
+ Patches/suggestions welcomed.
26
+
data/Rakefile ADDED
@@ -0,0 +1,370 @@
1
+ #!rake -*- ruby -*-
2
+ #
3
+ # WebKit-RSpec-Formatter rakefile
4
+ #
5
+ # Based on various other Rakefiles, especially one by Ben Bleything
6
+ #
7
+ # Copyright (c) 2007-2010 The FaerieMUD Consortium
8
+ #
9
+ # Authors:
10
+ # * Michael Granger <ged@FaerieMUD.org>
11
+ #
12
+
13
+ BEGIN {
14
+ require 'rbconfig'
15
+ require 'pathname'
16
+ basedir = Pathname.new( __FILE__ ).dirname
17
+
18
+ libdir = basedir + "lib"
19
+ extdir = libdir + Config::CONFIG['sitearch']
20
+
21
+ $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
22
+ $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
23
+ $LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s )
24
+ }
25
+
26
+ begin
27
+ require 'readline'
28
+ include Readline
29
+ rescue LoadError
30
+ # Fall back to a plain prompt
31
+ def readline( text )
32
+ $stderr.print( text.chomp )
33
+ return $stdin.gets
34
+ end
35
+ end
36
+
37
+ begin
38
+ require 'rubygems'
39
+ rescue LoadError
40
+ module Gem
41
+ class Specification; end
42
+ end
43
+ end
44
+
45
+ require 'rbconfig'
46
+ require 'rake'
47
+ require 'rake/testtask'
48
+ require 'rake/packagetask'
49
+ require 'rake/clean'
50
+ # require 'rake/191_compat.rb'
51
+
52
+ $dryrun = false
53
+
54
+ ### Config constants
55
+ BASEDIR = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd )
56
+ BINDIR = BASEDIR + 'bin'
57
+ LIBDIR = BASEDIR + 'lib'
58
+ EXTDIR = BASEDIR + 'ext'
59
+ DOCSDIR = BASEDIR + 'docs'
60
+ PKGDIR = BASEDIR + 'pkg'
61
+ DATADIR = BASEDIR + 'data'
62
+
63
+ MANUALDIR = DOCSDIR + 'manual'
64
+
65
+ PROJECT_NAME = 'WebKit-RSpec-Formatter'
66
+ PKG_NAME = PROJECT_NAME.downcase
67
+ PKG_SUMMARY = 'A webkit-aware pretty formatter for RSpec'
68
+
69
+ # Cruisecontrol stuff
70
+ CC_BUILD_LABEL = ENV['CC_BUILD_LABEL']
71
+ CC_BUILD_ARTIFACTS = ENV['CC_BUILD_ARTIFACTS'] || 'artifacts'
72
+
73
+ VERSION_FILE = LIBDIR + 'rspec/core/formatters/webkit.rb'
74
+ if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
75
+ PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
76
+ elsif VERSION_FILE.exist?
77
+ PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
78
+ end
79
+
80
+ PKG_VERSION = '0.0.0' unless defined?( PKG_VERSION ) && !PKG_VERSION.nil?
81
+
82
+ PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
83
+ GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
84
+
85
+ # Universal VCS constants
86
+ DEFAULT_EDITOR = 'vi'
87
+ COMMIT_MSG_FILE = 'commit-msg.txt'
88
+ FILE_INDENT = " " * 12
89
+ LOG_INDENT = " " * 3
90
+
91
+ EXTCONF = EXTDIR + 'extconf.rb'
92
+
93
+ ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS )
94
+
95
+ TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README* LICENSE] )
96
+ BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" )
97
+ LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" )
98
+ EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" )
99
+ DATA_FILES = Rake::FileList.new( "#{DATADIR}/**/*" )
100
+
101
+ SPECDIR = BASEDIR + 'spec'
102
+ SPECLIBDIR = SPECDIR + 'lib'
103
+ SPEC_FILES = Rake::FileList.new( "#{SPECDIR}/**/*_spec.rb", "#{SPECLIBDIR}/**/*.rb" )
104
+
105
+ TESTDIR = BASEDIR + 'tests'
106
+ TEST_FILES = Rake::FileList.new( "#{TESTDIR}/**/*.tests.rb" )
107
+
108
+ RAKE_TASKDIR = BASEDIR + 'rake'
109
+ RAKE_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/*.rb" )
110
+ PKG_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/{191_compat,helpers,packaging,rdoc,testing}.rb" )
111
+ PKG_TASKLIBS.include( "#{RAKE_TASKDIR}/manual.rb" ) if MANUALDIR.exist?
112
+
113
+ RAKE_TASKLIBS_URL = 'http://repo.deveiate.org/rake-tasklibs'
114
+
115
+ LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
116
+
117
+ EXTRA_PKGFILES = Rake::FileList.new
118
+ EXTRA_PKGFILES.include( "#{BASEDIR}/data/**/*" )
119
+
120
+ RELEASE_FILES = TEXT_FILES +
121
+ SPEC_FILES +
122
+ TEST_FILES +
123
+ BIN_FILES +
124
+ LIB_FILES +
125
+ EXT_FILES +
126
+ DATA_FILES +
127
+ RAKE_TASKLIBS +
128
+ EXTRA_PKGFILES
129
+
130
+
131
+ RELEASE_FILES << LOCAL_RAKEFILE.to_s if LOCAL_RAKEFILE.exist?
132
+
133
+ RELEASE_ANNOUNCE_ADDRESSES = [
134
+ "Ruby-Talk List <ruby-talk@ruby-lang.org>",
135
+ ]
136
+
137
+ COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0
138
+ RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib'
139
+ RCOV_OPTS = [
140
+ '--exclude', RCOV_EXCLUDES,
141
+ '--xrefs',
142
+ '--save',
143
+ '--callsites',
144
+ #'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0
145
+ ]
146
+
147
+
148
+ ### Load some task libraries that need to be loaded early
149
+ if !RAKE_TASKDIR.exist?
150
+ $stderr.puts "It seems you don't have the build task directory. Shall I fetch it "
151
+ ans = readline( "for you? [y]" )
152
+ ans = 'y' if !ans.nil? && ans.empty?
153
+
154
+ if ans =~ /^y/i
155
+ $stderr.puts "Okay, fetching #{RAKE_TASKLIBS_URL} into #{RAKE_TASKDIR}..."
156
+ system 'hg', 'clone', RAKE_TASKLIBS_URL, "./#{RAKE_TASKDIR}"
157
+ if ! $?.success?
158
+ fail "Damn. That didn't work. Giving up; maybe try manually fetching?"
159
+ end
160
+ else
161
+ $stderr.puts "Then I'm afraid I can't continue. Best of luck."
162
+ fail "Rake tasklibs not present."
163
+ end
164
+
165
+ RAKE_TASKLIBS.include( "#{RAKE_TASKDIR}/*.rb" )
166
+ end
167
+
168
+ require RAKE_TASKDIR + 'helpers.rb'
169
+ include RakefileHelpers
170
+
171
+ # Set the build ID if the mercurial executable is available
172
+ if hg = which( 'hg' )
173
+ id = `#{hg} id -n`.chomp
174
+ PKG_BUILD = (id.chomp[ /^[[:xdigit:]]+/ ] || '1')
175
+ else
176
+ PKG_BUILD = '0'
177
+ end
178
+ SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
179
+ SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
180
+
181
+ # Documentation constants
182
+ API_DOCSDIR = DOCSDIR + 'api'
183
+ README_FILE = TEXT_FILES.find {|path| path =~ /^README/ } || 'README'
184
+ RDOC_OPTIONS = [
185
+ '--tab-width=4',
186
+ '--show-hash',
187
+ '--include', BASEDIR.to_s,
188
+ "--main=#{README_FILE}",
189
+ "--title=#{PKG_NAME}",
190
+ ]
191
+ YARD_OPTIONS = [
192
+ '--use-cache',
193
+ '--no-private',
194
+ '--protected',
195
+ '-r', README_FILE,
196
+ '--exclude', 'extconf\\.rb',
197
+ '--files', 'ChangeLog,LICENSE',
198
+ '--output-dir', API_DOCSDIR.to_s,
199
+ '--title', "#{PKG_NAME} #{PKG_VERSION}",
200
+ ]
201
+
202
+ # Release constants
203
+ SMTP_HOST = "mail.faeriemud.org"
204
+ SMTP_PORT = 465 # SMTP + SSL
205
+
206
+ # Project constants
207
+ PROJECT_HOST = 'deveiate'
208
+ PROJECT_PUBDIR = '/usr/local/www/public/code/'
209
+ PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
210
+ PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
211
+ PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
212
+
213
+ GEM_PUBHOST = 'rubygems.org'
214
+
215
+ # Gem dependencies: gemname => version
216
+ DEPENDENCIES = {
217
+ 'rspec-core' => '>=2.0.1',
218
+ }
219
+
220
+ # Developer Gem dependencies: gemname => version
221
+ DEVELOPMENT_DEPENDENCIES = {
222
+ 'rake' => '>= 0.8.7',
223
+ 'rcodetools' => '>= 0.7.0.0',
224
+ 'rcov' => '>= 0.8.1.2.0',
225
+ 'rdoc' => '>= 2.4.3',
226
+ 'RedCloth' => '>= 4.0.3',
227
+ 'rspec' => '>= 1.2.6',
228
+ 'ruby-termios' => '>= 0.9.6',
229
+ 'text-format' => '>= 1.0.0',
230
+ 'tmail' => '>= 1.2.3.1',
231
+ 'diff-lcs' => '>= 1.1.2',
232
+ }
233
+
234
+ # Non-gem requirements: packagename => version
235
+ REQUIREMENTS = {
236
+ 'Rspec-Bundle' => '>=0',
237
+ 'Textmate' => '>=0',
238
+ }
239
+
240
+ # RubyGem specification
241
+ GEMSPEC = Gem::Specification.new do |gem|
242
+ gem.name = PKG_NAME.downcase
243
+ gem.version = PKG_VERSION
244
+
245
+ gem.summary = PKG_SUMMARY
246
+ gem.description = [
247
+ "This is a formatter for RSpec that takes advantage of some of the advanced features of the webkit",
248
+ "HTML engine, like the one TextMate uses for its output.",
249
+ ].join( "\n" )
250
+ gem.post_install_message = [
251
+ "",
252
+ "You can use this formatter from TextMate (if you're using RSpec 2.0.0 ",
253
+ "or later) bysetting the TM_RSPEC_OPTS shell variable (in the ",
254
+ "'Advanced' preference pane) to:",
255
+ "",
256
+ " --format RSpec::Core::Formatters::WebKit",
257
+ "",
258
+ "Have fun!",
259
+ ].join( "\n" )
260
+
261
+ gem.authors = "Michael Granger"
262
+ gem.email = ["ged@FaerieMUD.org"]
263
+ gem.homepage = 'http://deveiate.org/projects/WebKit-RSpec-Formatter'
264
+
265
+ gem.has_rdoc = true
266
+ gem.rdoc_options = RDOC_OPTIONS
267
+ gem.extra_rdoc_files = TEXT_FILES - [ 'Rakefile' ]
268
+
269
+ gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s
270
+ gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }.
271
+ collect {|pn| File.basename(pn) }
272
+ gem.require_paths << EXTDIR.relative_path_from( BASEDIR ).to_s if EXTDIR.exist?
273
+
274
+ if EXTCONF.exist?
275
+ gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
276
+ end
277
+
278
+ gem.files = RELEASE_FILES
279
+ gem.test_files = SPEC_FILES
280
+
281
+ # signing key and certificate chain
282
+ gem.signing_key = '/Volumes/Keys/ged-private_gem_key.pem'
283
+ gem.cert_chain = [File.expand_path('~/.gem/ged-public_gem_cert.pem')]
284
+
285
+ DEPENDENCIES.each do |name, version|
286
+ version = '>= 0' if version.length.zero?
287
+ gem.add_runtime_dependency( name, version )
288
+ end
289
+
290
+ REQUIREMENTS.each do |name, version|
291
+ gem.requirements << [ name, version ].compact.join(' ')
292
+ end
293
+ end
294
+
295
+ $trace = Rake.application.options.trace ? true : false
296
+ $dryrun = Rake.application.options.dryrun ? true : false
297
+ $include_dev_dependencies = false
298
+
299
+ # Load any remaining task libraries
300
+ RAKE_TASKLIBS.each do |tasklib|
301
+ next if tasklib.to_s =~ %r{/helpers\.rb$}
302
+ begin
303
+ trace " loading tasklib %s" % [ tasklib ]
304
+ import tasklib
305
+ rescue ScriptError => err
306
+ fail "Task library '%s' failed to load: %s: %s" %
307
+ [ tasklib, err.class.name, err.message ]
308
+ trace "Backtrace: \n " + err.backtrace.join( "\n " )
309
+ rescue => err
310
+ log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
311
+ [ tasklib, err.class.name, err.message ]
312
+ trace "Backtrace: \n " + err.backtrace.join( "\n " )
313
+ end
314
+ end
315
+
316
+ # Load any project-specific rules defined in 'Rakefile.local' if it exists
317
+ import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
318
+
319
+
320
+ #####################################################################
321
+ ### T A S K S
322
+ #####################################################################
323
+
324
+ ### Default task
325
+ task :default => [:clean, :local, :spec, :apidocs, :package]
326
+
327
+ ### Task the local Rakefile can append to -- no-op by default
328
+ task :local
329
+
330
+ ### Task: clean
331
+ CLEAN.include 'coverage', '**/*.orig', '**/*.rej'
332
+ CLOBBER.include 'artifacts', 'coverage.info', 'ChangeLog', PKGDIR
333
+
334
+ ### Task: changelog
335
+ file 'ChangeLog' do |task|
336
+ log "Updating #{task.name}"
337
+
338
+ changelog = make_changelog()
339
+ File.open( task.name, 'w' ) do |fh|
340
+ fh.print( changelog )
341
+ end
342
+ end
343
+
344
+
345
+ ### Task: cruise (Cruisecontrol task)
346
+ desc "Cruisecontrol build"
347
+ task :cruise => [:clean, 'spec:quiet', :package] do |task|
348
+ raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
349
+ artifact_dir = ARTIFACTS_DIR.cleanpath + (CC_BUILD_LABEL || Time.now.strftime('%Y%m%d-%T'))
350
+ artifact_dir.mkpath
351
+
352
+ coverage = BASEDIR + 'coverage'
353
+ if coverage.exist? && coverage.directory?
354
+ $stderr.puts "Copying coverage stats..."
355
+ FileUtils.cp_r( 'coverage', artifact_dir )
356
+ end
357
+
358
+ $stderr.puts "Copying packages..."
359
+ FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
360
+ end
361
+
362
+
363
+ desc "Update the build system to the latest version"
364
+ task :update_build do
365
+ log "Updating the build system"
366
+ run 'hg', '-R', RAKE_TASKDIR, 'pull', '-u'
367
+ log "Updating the Rakefile"
368
+ sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
369
+ end
370
+