bluecloth 2.0.5-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/ChangeLog +784 -0
  2. data/LICENSE +27 -0
  3. data/LICENSE.discount +47 -0
  4. data/README +81 -0
  5. data/Rakefile +346 -0
  6. data/Rakefile.local +63 -0
  7. data/bin/bluecloth +84 -0
  8. data/ext/Csio.c +61 -0
  9. data/ext/VERSION +1 -0
  10. data/ext/amalloc.h +29 -0
  11. data/ext/bluecloth.c +377 -0
  12. data/ext/config.h +51 -0
  13. data/ext/css.c +76 -0
  14. data/ext/cstring.h +74 -0
  15. data/ext/docheader.c +43 -0
  16. data/ext/extconf.rb +48 -0
  17. data/ext/generate.c +1481 -0
  18. data/ext/markdown.c +970 -0
  19. data/ext/markdown.h +145 -0
  20. data/ext/mkdio.c +303 -0
  21. data/ext/mkdio.h +78 -0
  22. data/ext/resource.c +155 -0
  23. data/ext/version.c +28 -0
  24. data/ext/xml.c +82 -0
  25. data/ext/xmlpage.c +48 -0
  26. data/lib/bluecloth.rb +161 -0
  27. data/rake/191_compat.rb +26 -0
  28. data/rake/dependencies.rb +76 -0
  29. data/rake/helpers.rb +412 -0
  30. data/rake/hg.rb +214 -0
  31. data/rake/manual.rb +782 -0
  32. data/rake/packaging.rb +135 -0
  33. data/rake/publishing.rb +321 -0
  34. data/rake/rdoc.rb +30 -0
  35. data/rake/style.rb +62 -0
  36. data/rake/svn.rb +668 -0
  37. data/rake/testing.rb +187 -0
  38. data/rake/verifytask.rb +64 -0
  39. data/rake/win32.rb +190 -0
  40. data/spec/bluecloth/101_changes_spec.rb +141 -0
  41. data/spec/bluecloth/autolinks_spec.rb +49 -0
  42. data/spec/bluecloth/blockquotes_spec.rb +143 -0
  43. data/spec/bluecloth/code_spans_spec.rb +164 -0
  44. data/spec/bluecloth/emphasis_spec.rb +164 -0
  45. data/spec/bluecloth/entities_spec.rb +65 -0
  46. data/spec/bluecloth/hrules_spec.rb +90 -0
  47. data/spec/bluecloth/images_spec.rb +92 -0
  48. data/spec/bluecloth/inline_html_spec.rb +238 -0
  49. data/spec/bluecloth/links_spec.rb +171 -0
  50. data/spec/bluecloth/lists_spec.rb +294 -0
  51. data/spec/bluecloth/paragraphs_spec.rb +75 -0
  52. data/spec/bluecloth/titles_spec.rb +305 -0
  53. data/spec/bluecloth_spec.rb +250 -0
  54. data/spec/bugfix_spec.rb +136 -0
  55. data/spec/contributions_spec.rb +85 -0
  56. data/spec/data/antsugar.txt +34 -0
  57. data/spec/data/markdowntest/Amps and angle encoding.html +17 -0
  58. data/spec/data/markdowntest/Amps and angle encoding.text +21 -0
  59. data/spec/data/markdowntest/Auto links.html +18 -0
  60. data/spec/data/markdowntest/Auto links.text +13 -0
  61. data/spec/data/markdowntest/Backslash escapes.html +118 -0
  62. data/spec/data/markdowntest/Backslash escapes.text +120 -0
  63. data/spec/data/markdowntest/Blockquotes with code blocks.html +15 -0
  64. data/spec/data/markdowntest/Blockquotes with code blocks.text +11 -0
  65. data/spec/data/markdowntest/Code Blocks.html +18 -0
  66. data/spec/data/markdowntest/Code Blocks.text +14 -0
  67. data/spec/data/markdowntest/Code Spans.html +5 -0
  68. data/spec/data/markdowntest/Code Spans.text +5 -0
  69. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.html +8 -0
  70. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.text +8 -0
  71. data/spec/data/markdowntest/Horizontal rules.html +71 -0
  72. data/spec/data/markdowntest/Horizontal rules.text +67 -0
  73. data/spec/data/markdowntest/Inline HTML (Advanced).html +15 -0
  74. data/spec/data/markdowntest/Inline HTML (Advanced).text +15 -0
  75. data/spec/data/markdowntest/Inline HTML (Simple).html +72 -0
  76. data/spec/data/markdowntest/Inline HTML (Simple).text +69 -0
  77. data/spec/data/markdowntest/Inline HTML comments.html +13 -0
  78. data/spec/data/markdowntest/Inline HTML comments.text +13 -0
  79. data/spec/data/markdowntest/Links, inline style.html +11 -0
  80. data/spec/data/markdowntest/Links, inline style.text +12 -0
  81. data/spec/data/markdowntest/Links, reference style.html +52 -0
  82. data/spec/data/markdowntest/Links, reference style.text +71 -0
  83. data/spec/data/markdowntest/Links, shortcut references.html +9 -0
  84. data/spec/data/markdowntest/Links, shortcut references.text +20 -0
  85. data/spec/data/markdowntest/Literal quotes in titles.html +3 -0
  86. data/spec/data/markdowntest/Literal quotes in titles.text +7 -0
  87. data/spec/data/markdowntest/Markdown Documentation - Basics.html +314 -0
  88. data/spec/data/markdowntest/Markdown Documentation - Basics.text +306 -0
  89. data/spec/data/markdowntest/Markdown Documentation - Syntax.html +942 -0
  90. data/spec/data/markdowntest/Markdown Documentation - Syntax.text +888 -0
  91. data/spec/data/markdowntest/Nested blockquotes.html +9 -0
  92. data/spec/data/markdowntest/Nested blockquotes.text +5 -0
  93. data/spec/data/markdowntest/Ordered and unordered lists.html +148 -0
  94. data/spec/data/markdowntest/Ordered and unordered lists.text +131 -0
  95. data/spec/data/markdowntest/Strong and em together.html +7 -0
  96. data/spec/data/markdowntest/Strong and em together.text +7 -0
  97. data/spec/data/markdowntest/Tabs.html +25 -0
  98. data/spec/data/markdowntest/Tabs.text +21 -0
  99. data/spec/data/markdowntest/Tidyness.html +8 -0
  100. data/spec/data/markdowntest/Tidyness.text +5 -0
  101. data/spec/data/ml-announce.txt +17 -0
  102. data/spec/data/re-overflow.txt +67 -0
  103. data/spec/data/re-overflow2.txt +281 -0
  104. data/spec/discount_spec.rb +67 -0
  105. data/spec/lib/constants.rb +5 -0
  106. data/spec/lib/helpers.rb +137 -0
  107. data/spec/lib/matchers.rb +235 -0
  108. data/spec/markdowntest_spec.rb +79 -0
  109. metadata +329 -0
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2004-2008, 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/LICENSE.discount ADDED
@@ -0,0 +1,47 @@
1
+ ->Copyright (C) 2007 David Loren Parsons.
2
+ All rights reserved.<-
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation files
6
+ (the "Software"), to deal in the Software without restriction,
7
+ including without limitation the rights to use, copy, modify, merge,
8
+ publish, distribute, sublicence, and/or sell copies of the Software,
9
+ and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ 1. Redistributions of source code must retain the above copyright
13
+ notice, this list of conditions, and the following disclaimer.
14
+
15
+ 2. Redistributions in binary form must reproduce the above
16
+ copyright notice, this list of conditions and the following
17
+ disclaimer in the documentation and/or other materials provided
18
+ with the distribution, and in the same place and form as other
19
+ copyright, license and disclaimer information.
20
+
21
+ 3. The end-user documentation included with the redistribution, if
22
+ any, must include the following acknowledgment:
23
+
24
+ This product includes software developed by
25
+ David Loren Parsons <http://www.pell.portland.or.us/~orc>
26
+
27
+ in the same place and form as other third-party acknowledgments.
28
+ Alternately, this acknowledgment may appear in the software
29
+ itself, in the same form and location as other such third-party
30
+ acknowledgments.
31
+
32
+ 4. Except as contained in this notice, the name of David Loren
33
+ Parsons shall not be used in advertising or otherwise to promote
34
+ the sale, use or other dealings in this Software without prior
35
+ written authorization from David Loren Parsons.
36
+
37
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
39
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
40
+ IN NO EVENT SHALL DAVID LOREN PARSONS BE LIABLE FOR ANY DIRECT,
41
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
42
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47
+ OF THE POSSIBILITY OF SUCH DAMAGE.
data/README ADDED
@@ -0,0 +1,81 @@
1
+ = BlueCloth 2
2
+
3
+ BlueCloth is a Ruby implementation of John Gruber's
4
+ Markdown[http://daringfireball.net/projects/markdown/], a text-to-HTML
5
+ conversion tool for web writers. To quote from the project page:
6
+ Markdown allows you to write using an easy-to-read, easy-to-write plain
7
+ text format, then convert it to structurally valid XHTML (or HTML).
8
+
9
+ It borrows a naming convention and several helpings of interface from
10
+ Redcloth[http://www.whytheluckystiff.net/ruby/redcloth/], {Why the Lucky
11
+ Stiff}[http://www.whytheluckystiff.net/] 's processor for a similar
12
+ text-to-HTML conversion syntax called
13
+ Textile[http://www.textism.com/tools/textile/].
14
+
15
+ BlueCloth 2 is a complete rewrite using David Parsons' Discount library,
16
+ a C implementation of Markdown. I rewrote it using the extension for
17
+ speed and accuracy; the original BlueCloth was a straight port from the
18
+ Perl version that I wrote in a few days for my own use just to avoid
19
+ having to shell out to Markdown.pl, and it was quite buggy and slow. I
20
+ apologize to all the good people that sent me patches for it that were
21
+ never released.
22
+
23
+ Note that the new gem is called 'bluecloth' and the old one 'BlueCloth'. If you have both installed, you can ensure you're loading the new one with the 'gem' directive:
24
+
25
+ # Load the 2.0 version
26
+ gem 'bluecloth', '>= 2.0.0'
27
+
28
+ # Load the 1.0 version
29
+ gem 'BlueCloth'
30
+ require 'bluecloth'
31
+
32
+
33
+ == Authors
34
+
35
+ * Michael Granger (ged@FaerieMUD.org)
36
+
37
+
38
+ == Contributors
39
+
40
+ * Martin Chase <stillflame@FaerieMUD.org>
41
+ * Florian Gross <flgr@ccan.de>
42
+
43
+ This product includes software developed by David Loren
44
+ Parsons <http://www.pell.portland.or.us/~orc>.
45
+
46
+
47
+ == Installation
48
+
49
+ If you use RubyGems, you can install it via:
50
+
51
+ $ sudo gem install bluecloth
52
+
53
+ You can also install as a site library via the Rakefile:
54
+
55
+ $ wget http://deveiate.org/code/bluecloth-x.y.z.tar.gz
56
+ $ tar xzvf bluecloth-x.y.z.tar.gz
57
+ $ cd bluecloth-x.y.z
58
+ $ sudo rake install
59
+
60
+
61
+ == Source
62
+
63
+ You can check out the current development source with Subversion from
64
+ the following URL:
65
+
66
+ svn://deveiate.org/BlueCloth/trunk
67
+
68
+ You can report bugs, suggest improvements, or check on development
69
+ activity at the project page:
70
+
71
+ http://deveiate.org/projects/BlueCloth/
72
+
73
+
74
+ == License
75
+
76
+ See the LICENSE file included with the distribution for licensing and
77
+ copyright details.
78
+
79
+ The licensing terms of Discount are described in the LICENSE.discount
80
+ file, also included with the distribution.
81
+
data/Rakefile ADDED
@@ -0,0 +1,346 @@
1
+ #!rake
2
+ #
3
+ # BlueCloth rakefile
4
+ #
5
+ # Based on various other Rakefiles, especially one by Ben Bleything
6
+ #
7
+ # Copyright (c) 2007-2009 The FaerieMUD Consortium
8
+ #
9
+ # Authors:
10
+ # * Michael Granger <ged@FaerieMUD.org>
11
+ #
12
+
13
+ BEGIN {
14
+ require 'pathname'
15
+ basedir = Pathname.new( __FILE__ ).dirname
16
+
17
+ libdir = basedir + "lib"
18
+ extdir = basedir + "ext"
19
+
20
+ $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
21
+ $LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s )
22
+ }
23
+
24
+ begin
25
+ require 'readline'
26
+ include Readline
27
+ rescue LoadError
28
+ # Fall back to a plain prompt
29
+ def readline( text )
30
+ $stderr.print( text.chomp )
31
+ return $stdin.gets
32
+ end
33
+ end
34
+
35
+ require 'rbconfig'
36
+ require 'rake'
37
+ require 'rake/testtask'
38
+ require 'rake/packagetask'
39
+ require 'rake/clean'
40
+ # require 'rake/191_compat.rb'
41
+
42
+ $dryrun = false
43
+
44
+ ### Config constants
45
+ BASEDIR = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd )
46
+ BINDIR = BASEDIR + 'bin'
47
+ LIBDIR = BASEDIR + 'lib'
48
+ EXTDIR = BASEDIR + 'ext'
49
+ DOCSDIR = BASEDIR + 'docs'
50
+ PKGDIR = BASEDIR + 'pkg'
51
+ DATADIR = BASEDIR + 'data'
52
+
53
+ MANUALDIR = DOCSDIR + 'manual'
54
+
55
+ PROJECT_NAME = 'BlueCloth'
56
+ PKG_NAME = PROJECT_NAME.downcase
57
+ PKG_SUMMARY = 'BlueCloth is a Ruby implementation of Markdown'
58
+
59
+ # Cruisecontrol stuff
60
+ CC_BUILD_LABEL = ENV['CC_BUILD_LABEL']
61
+ CC_BUILD_ARTIFACTS = ENV['CC_BUILD_ARTIFACTS'] || 'artifacts'
62
+
63
+ VERSION_FILE = LIBDIR + 'bluecloth.rb'
64
+ if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
65
+ PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
66
+ elsif VERSION_FILE.exist?
67
+ PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
68
+ else
69
+ PKG_VERSION = '0.0.0'
70
+ end
71
+
72
+ PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
73
+ GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
74
+
75
+ # Universal VCS constants
76
+ DEFAULT_EDITOR = 'vi'
77
+ COMMIT_MSG_FILE = 'commit-msg.txt'
78
+ FILE_INDENT = " " * 12
79
+ LOG_INDENT = " " * 3
80
+
81
+ EXTCONF = EXTDIR + 'extconf.rb'
82
+
83
+ ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS )
84
+
85
+ TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README LICENSE] )
86
+ BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" )
87
+ LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" )
88
+ EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" )
89
+ DATA_FILES = Rake::FileList.new( "#{DATADIR}/**/*" )
90
+
91
+ SPECDIR = BASEDIR + 'spec'
92
+ SPECLIBDIR = SPECDIR + 'lib'
93
+ SPEC_FILES = Rake::FileList.new( "#{SPECDIR}/**/*_spec.rb", "#{SPECLIBDIR}/**/*.rb" )
94
+
95
+ TESTDIR = BASEDIR + 'tests'
96
+ TEST_FILES = Rake::FileList.new( "#{TESTDIR}/**/*.tests.rb" )
97
+
98
+ RAKE_TASKDIR = BASEDIR + 'rake'
99
+ RAKE_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/*.rb" )
100
+ PKG_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/{191_compat,helpers,packaging,rdoc,testing}.rb" )
101
+ PKG_TASKLIBS.include( "#{RAKE_TASKDIR}/manual.rb" ) if MANUALDIR.exist?
102
+
103
+ RAKE_TASKLIBS_URL = 'http://repo.deveiate.org/rake-tasklibs'
104
+
105
+ LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
106
+
107
+ EXTRA_PKGFILES = Rake::FileList.new
108
+ EXTRA_PKGFILES.include "#{BASEDIR}/LICENSE.discount"
109
+ EXTRA_PKGFILES.include "#{BASEDIR}/spec/data/**/*.{txt,text,html}"
110
+ EXTRA_PKGFILES.include "#{BASEDIR}/ext/VERSION"
111
+
112
+ RELEASE_FILES = TEXT_FILES +
113
+ SPEC_FILES +
114
+ TEST_FILES +
115
+ BIN_FILES +
116
+ LIB_FILES +
117
+ EXT_FILES +
118
+ DATA_FILES +
119
+ RAKE_TASKLIBS +
120
+ EXTRA_PKGFILES
121
+
122
+ RELEASE_FILES << LOCAL_RAKEFILE.to_s if LOCAL_RAKEFILE.exist?
123
+
124
+ COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0
125
+ RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib'
126
+ RCOV_OPTS = [
127
+ '--exclude', RCOV_EXCLUDES,
128
+ '--xrefs',
129
+ '--save',
130
+ '--callsites',
131
+ #'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0
132
+ ]
133
+
134
+
135
+ ### Load some task libraries that need to be loaded early
136
+ if !RAKE_TASKDIR.exist?
137
+ $stderr.puts "It seems you don't have the build task directory. Shall I fetch it "
138
+ ans = readline( "for you? [y]" )
139
+ ans = 'y' if !ans.nil? && ans.empty?
140
+
141
+ if ans =~ /^y/i
142
+ $stderr.puts "Okay, fetching #{RAKE_TASKLIBS_URL} into #{RAKE_TASKDIR}..."
143
+ system 'hg', 'clone', RAKE_TASKLIBS_URL, RAKE_TASKDIR
144
+ if ! $?.success?
145
+ fail "Damn. That didn't work. Giving up; maybe try manually fetching?"
146
+ end
147
+ else
148
+ $stderr.puts "Then I'm afraid I can't continue. Best of luck."
149
+ fail "Rake tasklibs not present."
150
+ end
151
+
152
+ RAKE_TASKLIBS.include( "#{RAKE_TASKDIR}/*.rb" )
153
+ end
154
+
155
+ require RAKE_TASKDIR + 'helpers.rb'
156
+
157
+ # Define some constants that depend on the 'svn' tasklib
158
+ if hg = which( 'hg' )
159
+ id = IO.read('|-') or exec hg, 'id', '-q'
160
+ PKG_BUILD = id.chomp
161
+ else
162
+ PKG_BUILD = 0
163
+ end
164
+ SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
165
+ SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
166
+
167
+ # Documentation constants
168
+ RDOCDIR = DOCSDIR + 'api'
169
+ RDOC_OPTIONS = [
170
+ '-w', '4',
171
+ '-HN',
172
+ '-i', '.',
173
+ '-m', 'README',
174
+ '-t', PKG_NAME,
175
+ '-W', 'http://deveiate.org/projects/BlueCloth/browser/'
176
+ ]
177
+
178
+ # Release constants
179
+ SMTP_HOST = 'mail.faeriemud.org'
180
+ SMTP_PORT = 465 # SMTP + SSL
181
+
182
+ # Project constants
183
+ PROJECT_HOST = 'deveiate'
184
+ PROJECT_PUBDIR = '/usr/local/www/public/code'
185
+ PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
186
+ PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
187
+ PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
188
+
189
+ # Rubyforge stuff
190
+ RUBYFORGE_GROUP = 'deveiate'
191
+ RUBYFORGE_PROJECT = 'bluecloth'
192
+
193
+ # Gem dependencies: gemname => version
194
+ DEPENDENCIES = {
195
+ }
196
+
197
+ # Developer Gem dependencies: gemname => version
198
+ DEVELOPMENT_DEPENDENCIES = {
199
+ 'amatch' => '>= 0.2.3',
200
+ 'rake' => '>= 0.8.1',
201
+ 'rcodetools' => '>= 0.7.0.0',
202
+ 'rcov' => '>= 0',
203
+ 'RedCloth' => '>= 4.0.3',
204
+ 'rspec' => '>= 0',
205
+ 'rubyforge' => '>= 0',
206
+ 'termios' => '>= 0',
207
+ 'text-format' => '>= 1.0.0',
208
+ 'tmail' => '>= 1.2.3.1',
209
+ 'ultraviolet' => '>= 0.10.2',
210
+ 'libxml-ruby' => '>= 0.8.3',
211
+ 'rdoc' => '>= 2.4.3',
212
+ }
213
+
214
+ # Non-gem requirements: packagename => version
215
+ REQUIREMENTS = {
216
+ }
217
+
218
+ # RubyGem specification
219
+ GEMSPEC = Gem::Specification.new do |gem|
220
+ gem.name = PKG_NAME.downcase
221
+ gem.version = PKG_VERSION
222
+
223
+ gem.summary = PKG_SUMMARY
224
+ gem.description = [
225
+ "BlueCloth is a Ruby implementation of [Markdown][1], a text-to-HTML conversion",
226
+ "tool for web writers. To quote from the project page: Markdown allows you to",
227
+ "write using an easy-to-read, easy-to-write plain text format, then convert it to",
228
+ "structurally valid XHTML (or HTML).",
229
+ ].join( "\n" )
230
+
231
+ gem.authors = "Michael Granger"
232
+ gem.email = ["ged@FaerieMUD.org"]
233
+ gem.homepage = 'http://deveiate.org/projects/BlueCloth/'
234
+ gem.rubyforge_project = RUBYFORGE_PROJECT
235
+
236
+ gem.has_rdoc = true
237
+ gem.rdoc_options = RDOC_OPTIONS
238
+ gem.extra_rdoc_files = %w[ChangeLog README LICENSE]
239
+
240
+ gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s
241
+ gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }.
242
+ collect {|pn| File.basename(pn) }
243
+ gem.require_paths << EXTDIR.relative_path_from( BASEDIR ).to_s
244
+
245
+ if EXTCONF.exist?
246
+ gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
247
+ end
248
+
249
+ gem.files = RELEASE_FILES
250
+ gem.test_files = SPEC_FILES
251
+
252
+ DEPENDENCIES.each do |name, version|
253
+ version = '>= 0' if version.length.zero?
254
+ gem.add_runtime_dependency( name, version )
255
+ end
256
+
257
+ # Developmental dependencies don't work as of RubyGems 1.2.0
258
+ unless Gem::Version.new( Gem::RubyGemsVersion ) <= Gem::Version.new( "1.2.0" )
259
+ DEVELOPMENT_DEPENDENCIES.each do |name, version|
260
+ version = '>= 0' if version.length.zero?
261
+ gem.add_development_dependency( name, version )
262
+ end
263
+ end
264
+
265
+ REQUIREMENTS.each do |name, version|
266
+ gem.requirements << [ name, version ].compact.join(' ')
267
+ end
268
+ end
269
+
270
+ $trace = Rake.application.options.trace ? true : false
271
+ $dryrun = Rake.application.options.dryrun ? true : false
272
+
273
+
274
+ # Load any remaining task libraries
275
+ RAKE_TASKLIBS.each do |tasklib|
276
+ next if tasklib.to_s =~ %r{/helpers\.rb$}
277
+ begin
278
+ trace " loading tasklib %s" % [ tasklib ]
279
+ import tasklib
280
+ rescue ScriptError => err
281
+ fail "Task library '%s' failed to load: %s: %s" %
282
+ [ tasklib, err.class.name, err.message ]
283
+ trace "Backtrace: \n " + err.backtrace.join( "\n " )
284
+ rescue => err
285
+ log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
286
+ [ tasklib, err.class.name, err.message ]
287
+ trace "Backtrace: \n " + err.backtrace.join( "\n " )
288
+ end
289
+ end
290
+
291
+ # Load any project-specific rules defined in 'Rakefile.local' if it exists
292
+ import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
293
+
294
+
295
+ #####################################################################
296
+ ### T A S K S
297
+ #####################################################################
298
+
299
+ ### Default task
300
+ task :default => [:clean, :local, :spec, :rdoc, :package]
301
+
302
+ ### Task the local Rakefile can append to -- no-op by default
303
+ task :local
304
+
305
+
306
+ ### Task: clean
307
+ CLEAN.include 'coverage'
308
+ CLOBBER.include 'artifacts', 'coverage.info', PKGDIR
309
+
310
+ ### Task: changelog
311
+ file 'ChangeLog' do |task|
312
+ log "Updating #{task.name}"
313
+
314
+ changelog = make_changelog()
315
+ File.open( task.name, 'w' ) do |fh|
316
+ fh.print( changelog )
317
+ end
318
+ end
319
+
320
+
321
+ ### Task: cruise (Cruisecontrol task)
322
+ desc "Cruisecontrol build"
323
+ task :cruise => [:clean, 'spec:quiet', :package] do |task|
324
+ raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
325
+ artifact_dir = ARTIFACTS_DIR.cleanpath + (CC_BUILD_LABEL || Time.now.strftime('%Y%m%d-%T'))
326
+ artifact_dir.mkpath
327
+
328
+ coverage = BASEDIR + 'coverage'
329
+ if coverage.exist? && coverage.directory?
330
+ $stderr.puts "Copying coverage stats..."
331
+ FileUtils.cp_r( 'coverage', artifact_dir )
332
+ end
333
+
334
+ $stderr.puts "Copying packages..."
335
+ FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
336
+ end
337
+
338
+
339
+ desc "Update the build system to the latest version"
340
+ task :update_build do
341
+ log "Updating the build system"
342
+ run 'hg', '-R', RAKE_TASKDIR, 'pull', '-u'
343
+ log "Updating the Rakefile"
344
+ sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
345
+ end
346
+