bluecloth 2.0.7-x86-mswin32 → 2.0.11pre158-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.gemtest +0 -0
  3. data/History.md +4 -0
  4. data/LICENSE +1 -1
  5. data/Manifest.txt +103 -0
  6. data/README.md +103 -0
  7. data/Rakefile +95 -301
  8. data/ext/VERSION +1 -1
  9. data/ext/bluecloth.c +69 -23
  10. data/ext/bluecloth.h +13 -2
  11. data/ext/config.h +13 -2
  12. data/ext/css.c +14 -5
  13. data/ext/cstring.h +4 -2
  14. data/ext/docheader.c +13 -7
  15. data/ext/emmatch.c +188 -0
  16. data/ext/extconf.rb +7 -9
  17. data/ext/generate.c +333 -293
  18. data/ext/html5.c +24 -0
  19. data/ext/markdown.c +326 -185
  20. data/ext/markdown.h +52 -29
  21. data/ext/mkdio.c +82 -41
  22. data/ext/mkdio.h +44 -23
  23. data/ext/resource.c +4 -2
  24. data/ext/setup.c +47 -0
  25. data/ext/tags.c +123 -0
  26. data/ext/tags.h +19 -0
  27. data/lib/1.8/bluecloth_ext.so +0 -0
  28. data/lib/1.9/bluecloth_ext.so +0 -0
  29. data/lib/bluecloth.rb +77 -42
  30. data/spec/bluecloth/101_changes_spec.rb +18 -21
  31. data/spec/bluecloth/TEMPLATE +36 -0
  32. data/spec/bluecloth/autolinks_spec.rb +4 -7
  33. data/spec/bluecloth/blockquotes_spec.rb +20 -23
  34. data/spec/bluecloth/code_spans_spec.rb +2 -5
  35. data/spec/bluecloth/emphasis_spec.rb +2 -5
  36. data/spec/bluecloth/entities_spec.rb +2 -5
  37. data/spec/bluecloth/hrules_spec.rb +2 -5
  38. data/spec/bluecloth/images_spec.rb +2 -5
  39. data/spec/bluecloth/inline_html_spec.rb +26 -66
  40. data/spec/bluecloth/links_spec.rb +1 -5
  41. data/spec/bluecloth/lists_spec.rb +2 -5
  42. data/spec/bluecloth/paragraphs_spec.rb +2 -5
  43. data/spec/bluecloth/titles_spec.rb +2 -5
  44. data/spec/bluecloth_spec.rb +36 -22
  45. data/spec/bugfix_spec.rb +90 -10
  46. data/spec/contributions_spec.rb +2 -3
  47. data/spec/discount_spec.rb +50 -10
  48. data/spec/lib/helpers.rb +18 -117
  49. data/spec/lib/matchers.rb +7 -18
  50. data/spec/markdowntest_spec.rb +3 -39
  51. metadata +257 -143
  52. metadata.gz.sig +0 -0
  53. data/ChangeLog +0 -387
  54. data/README +0 -81
  55. data/Rakefile.local +0 -41
  56. data/rake/191_compat.rb +0 -26
  57. data/rake/dependencies.rb +0 -76
  58. data/rake/helpers.rb +0 -435
  59. data/rake/hg.rb +0 -273
  60. data/rake/manual.rb +0 -782
  61. data/rake/packaging.rb +0 -123
  62. data/rake/publishing.rb +0 -274
  63. data/rake/rdoc.rb +0 -30
  64. data/rake/style.rb +0 -62
  65. data/rake/svn.rb +0 -668
  66. data/rake/testing.rb +0 -187
  67. data/rake/verifytask.rb +0 -64
data.tar.gz.sig ADDED
Binary file
data/.gemtest ADDED
File without changes
data/History.md ADDED
@@ -0,0 +1,4 @@
1
+ ## 0.0.1 [2011-02-08] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Initial release.
4
+
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2010, Michael Granger
1
+ Copyright (c) 2004-2011, Michael Granger
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/Manifest.txt ADDED
@@ -0,0 +1,103 @@
1
+ .gemtest
2
+ History.md
3
+ Manifest.txt
4
+ LICENSE
5
+ LICENSE.discount
6
+ README.md
7
+ Rakefile
8
+ bin/bluecloth
9
+ ext/Csio.c
10
+ ext/VERSION
11
+ ext/amalloc.h
12
+ ext/bluecloth.c
13
+ ext/bluecloth.h
14
+ ext/config.h
15
+ ext/css.c
16
+ ext/cstring.h
17
+ ext/docheader.c
18
+ ext/emmatch.c
19
+ ext/extconf.rb
20
+ ext/generate.c
21
+ ext/html5.c
22
+ ext/markdown.c
23
+ ext/markdown.h
24
+ ext/mkdio.c
25
+ ext/mkdio.h
26
+ ext/resource.c
27
+ ext/setup.c
28
+ ext/tags.c
29
+ ext/tags.h
30
+ ext/version.c
31
+ ext/xml.c
32
+ ext/xmlpage.c
33
+ lib/bluecloth.rb
34
+ spec/bluecloth/101_changes_spec.rb
35
+ spec/bluecloth/TEMPLATE
36
+ spec/bluecloth/autolinks_spec.rb
37
+ spec/bluecloth/blockquotes_spec.rb
38
+ spec/bluecloth/code_spans_spec.rb
39
+ spec/bluecloth/emphasis_spec.rb
40
+ spec/bluecloth/entities_spec.rb
41
+ spec/bluecloth/hrules_spec.rb
42
+ spec/bluecloth/images_spec.rb
43
+ spec/bluecloth/inline_html_spec.rb
44
+ spec/bluecloth/links_spec.rb
45
+ spec/bluecloth/lists_spec.rb
46
+ spec/bluecloth/paragraphs_spec.rb
47
+ spec/bluecloth/titles_spec.rb
48
+ spec/bluecloth_spec.rb
49
+ spec/bugfix_spec.rb
50
+ spec/contributions_spec.rb
51
+ spec/data/antsugar.txt
52
+ spec/data/markdowntest/Amps and angle encoding.html
53
+ spec/data/markdowntest/Amps and angle encoding.text
54
+ spec/data/markdowntest/Auto links.html
55
+ spec/data/markdowntest/Auto links.text
56
+ spec/data/markdowntest/Backslash escapes.html
57
+ spec/data/markdowntest/Backslash escapes.text
58
+ spec/data/markdowntest/Blockquotes with code blocks.html
59
+ spec/data/markdowntest/Blockquotes with code blocks.text
60
+ spec/data/markdowntest/Code Blocks.html
61
+ spec/data/markdowntest/Code Blocks.text
62
+ spec/data/markdowntest/Code Spans.html
63
+ spec/data/markdowntest/Code Spans.text
64
+ spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.html
65
+ spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.text
66
+ spec/data/markdowntest/Horizontal rules.html
67
+ spec/data/markdowntest/Horizontal rules.text
68
+ spec/data/markdowntest/Inline HTML (Advanced).html
69
+ spec/data/markdowntest/Inline HTML (Advanced).text
70
+ spec/data/markdowntest/Inline HTML (Simple).html
71
+ spec/data/markdowntest/Inline HTML (Simple).text
72
+ spec/data/markdowntest/Inline HTML comments.html
73
+ spec/data/markdowntest/Inline HTML comments.text
74
+ spec/data/markdowntest/Links, inline style.html
75
+ spec/data/markdowntest/Links, inline style.text
76
+ spec/data/markdowntest/Links, reference style.html
77
+ spec/data/markdowntest/Links, reference style.text
78
+ spec/data/markdowntest/Links, shortcut references.html
79
+ spec/data/markdowntest/Links, shortcut references.text
80
+ spec/data/markdowntest/Literal quotes in titles.html
81
+ spec/data/markdowntest/Literal quotes in titles.text
82
+ spec/data/markdowntest/Markdown Documentation - Basics.html
83
+ spec/data/markdowntest/Markdown Documentation - Basics.text
84
+ spec/data/markdowntest/Markdown Documentation - Syntax.html
85
+ spec/data/markdowntest/Markdown Documentation - Syntax.text
86
+ spec/data/markdowntest/Nested blockquotes.html
87
+ spec/data/markdowntest/Nested blockquotes.text
88
+ spec/data/markdowntest/Ordered and unordered lists.html
89
+ spec/data/markdowntest/Ordered and unordered lists.text
90
+ spec/data/markdowntest/Strong and em together.html
91
+ spec/data/markdowntest/Strong and em together.text
92
+ spec/data/markdowntest/Tabs.html
93
+ spec/data/markdowntest/Tabs.text
94
+ spec/data/markdowntest/Tidyness.html
95
+ spec/data/markdowntest/Tidyness.text
96
+ spec/data/ml-announce.txt
97
+ spec/data/re-overflow.txt
98
+ spec/data/re-overflow2.txt
99
+ spec/discount_spec.rb
100
+ spec/lib/constants.rb
101
+ spec/lib/helpers.rb
102
+ spec/lib/matchers.rb
103
+ spec/markdowntest_spec.rb
data/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # bluecloth 2
2
+
3
+ * http://deveiate.org/projects/BlueCloth
4
+
5
+ ## Description
6
+
7
+ BlueCloth is a Ruby implementation of John Gruber's [Markdown][markdown], a
8
+ text-to-HTML conversion tool for web writers. To quote from the project page:
9
+ Markdown allows you to write using an easy-to-read, easy-to-write plain text
10
+ format, then convert it to structurally valid XHTML (or HTML).
11
+
12
+ It borrows a naming convention and several helpings of interface from
13
+ [Redcloth][redcloth], Why the Lucky Stiff's processor for a similar
14
+ text-to-HTML conversion syntax called [Textile][textile].
15
+
16
+ BlueCloth 2 is a complete rewrite using David Parsons' [Discount][discount]
17
+ library, a C implementation of Markdown. I rewrote it using the extension for
18
+ speed and accuracy; the original BlueCloth was a straight port from the Perl
19
+ version that I wrote in a few days for my own use just to avoid having to
20
+ shell out to Markdown.pl, and it was quite buggy and slow. I apologize to all
21
+ the good people that sent me patches for it that were never released.
22
+
23
+ Note that the new gem is called 'bluecloth' and the old one 'BlueCloth'. If
24
+ you have both installed, you can ensure you're loading the new one with the
25
+ 'gem' directive:
26
+
27
+ # Load the 2.0 version
28
+ gem 'bluecloth', '>= 2.0.0'
29
+
30
+ # Load the 1.0 version
31
+ gem 'BlueCloth'
32
+ require 'bluecloth'
33
+
34
+
35
+ ## Installation
36
+
37
+ gem install bluecloth
38
+
39
+
40
+ ## Contributing
41
+
42
+ You can check out the current development source [with Mercurial][hgrepo], or if you prefer Git, via [its Github mirror][gitmirror].
43
+
44
+ After checking out the source, run:
45
+
46
+ $ rake newb
47
+
48
+ This task will install any missing dependencies, run the tests/specs, and
49
+ generate the API documentation.
50
+
51
+
52
+ ## Contributors
53
+
54
+ * Martin Chase <stillflame@FaerieMUD.org>
55
+ * Florian Gross <flgr@ccan.de>
56
+
57
+ This product includes software developed by David Loren
58
+ Parsons <http://www.pell.portland.or.us/~orc>.
59
+
60
+
61
+ ## License
62
+
63
+ Discount's license may be found in the [README.discount][discountreadme] file
64
+ included with the distribution.
65
+
66
+ All other code:
67
+
68
+ Copyright (c) 2004-2011, Michael Granger
69
+ All rights reserved.
70
+
71
+ Redistribution and use in source and binary forms, with or without
72
+ modification, are permitted provided that the following conditions are met:
73
+
74
+ * Redistributions of source code must retain the above copyright notice,
75
+ this list of conditions and the following disclaimer.
76
+
77
+ * Redistributions in binary form must reproduce the above copyright notice,
78
+ this list of conditions and the following disclaimer in the documentation
79
+ and/or other materials provided with the distribution.
80
+
81
+ * Neither the name of the author/s, nor the names of the project's
82
+ contributors may be used to endorse or promote products derived from this
83
+ software without specific prior written permission.
84
+
85
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
86
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
87
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
88
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
89
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
90
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
91
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
92
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
93
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
94
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95
+
96
+
97
+ [markdown]:http://daringfireball.net/projects/markdown/
98
+ [redcloth]:http://redcloth.org/
99
+ [textile]:http://www.textism.com/tools/textile/
100
+ [discount]:http://www.pell.portland.or.us/~orc/Code/discount/
101
+ [hgrepo]:http://repo.deveiate.org/BlueCloth
102
+ [gitmirror]:https://github.com/ged/bluecloth
103
+ [discountreadme]:http://deveiate.org/projects/BlueCloth/browser/LICENSE.discount
data/Rakefile CHANGED
@@ -1,343 +1,137 @@
1
- #!rake -*- ruby -*-
2
- #
3
- # BlueCloth 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
- #
1
+ #!/usr/bin/env rake
12
2
 
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
- }
3
+ require 'rbconfig'
4
+ require 'pathname'
23
5
 
24
6
  begin
25
- require 'readline'
26
- include Readline
7
+ require 'rake/extensiontask'
27
8
  rescue LoadError
28
- # Fall back to a plain prompt
29
- def readline( text )
30
- $stderr.print( text.chomp )
31
- return $stdin.gets
32
- end
9
+ abort "This Rakefile requires rake-compiler (gem install rake-compiler)"
33
10
  end
34
11
 
35
12
  begin
36
- require 'rubygems'
13
+ require 'hoe'
37
14
  rescue LoadError
38
- module Gem
39
- class Specification; end
40
- end
41
- end
42
-
43
- require 'rbconfig'
44
- require 'rake'
45
- require 'rake/testtask'
46
- require 'rake/packagetask'
47
- require 'rake/clean'
48
- # require 'rake/191_compat.rb'
49
-
50
- $dryrun = false
51
-
52
- ### Config constants
53
- BASEDIR = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd )
54
- BINDIR = BASEDIR + 'bin'
55
- LIBDIR = BASEDIR + 'lib'
56
- EXTDIR = BASEDIR + 'ext'
57
- DOCSDIR = BASEDIR + 'docs'
58
- PKGDIR = BASEDIR + 'pkg'
59
- DATADIR = BASEDIR + 'data'
60
-
61
- MANUALDIR = DOCSDIR + 'manual'
62
-
63
- PROJECT_NAME = 'BlueCloth'
64
- PKG_NAME = PROJECT_NAME.downcase
65
- PKG_SUMMARY = 'BlueCloth is a Ruby implementation of Markdown'
66
-
67
- # Cruisecontrol stuff
68
- CC_BUILD_LABEL = ENV['CC_BUILD_LABEL']
69
- CC_BUILD_ARTIFACTS = ENV['CC_BUILD_ARTIFACTS'] || 'artifacts'
70
-
71
- VERSION_FILE = LIBDIR + 'bluecloth.rb'
72
- if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
73
- PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
74
- elsif VERSION_FILE.exist?
75
- PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
76
- else
77
- PKG_VERSION = '0.0.0'
15
+ abort "This Rakefile requires hoe (gem install hoe)"
78
16
  end
79
17
 
80
- PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
81
- GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
18
+ # Build constants
19
+ BASEDIR = Pathname( __FILE__ ).dirname.relative_path_from( Pathname.pwd )
20
+ SPECDIR = BASEDIR + 'spec'
21
+ LIBDIR = BASEDIR + 'lib'
22
+ EXTDIR = BASEDIR + 'ext'
82
23
 
83
- # Universal VCS constants
84
- DEFAULT_EDITOR = 'vi'
85
- COMMIT_MSG_FILE = 'commit-msg.txt'
86
- FILE_INDENT = " " * 12
87
- LOG_INDENT = " " * 3
24
+ DLEXT = Config::CONFIG['DLEXT']
25
+ EXT = LIBDIR + "bluecloth_ext.#{DLEXT}"
88
26
 
89
- EXTCONF = EXTDIR + 'extconf.rb'
27
+ # Load Hoe plugins
28
+ Hoe.plugin :mercurial
29
+ Hoe.plugin :yard
30
+ Hoe.plugin :signing
90
31
 
91
- ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS )
32
+ Hoe.plugins.delete :rubyforge
33
+ Hoe.plugins.delete :compiler
92
34
 
93
- TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README LICENSE] )
94
- BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" )
95
- LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" )
96
- EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" )
97
- DATA_FILES = Rake::FileList.new( "#{DATADIR}/**/*" )
35
+ # Configure Hoe
36
+ hoespec = Hoe.spec 'bluecloth' do
37
+ self.readme_file = 'README.md'
38
+ self.history_file = 'History.md'
98
39
 
99
- SPECDIR = BASEDIR + 'spec'
100
- SPECLIBDIR = SPECDIR + 'lib'
101
- SPEC_FILES = Rake::FileList.new( "#{SPECDIR}/**/*_spec.rb", "#{SPECLIBDIR}/**/*.rb" )
40
+ self.developer 'Michael Granger', 'ged@FaerieMUD.org'
102
41
 
103
- TESTDIR = BASEDIR + 'tests'
104
- TEST_FILES = Rake::FileList.new( "#{TESTDIR}/**/*.tests.rb" )
42
+ self.extra_dev_deps.push *{
43
+ 'tidy-ext' => '~> 0.1',
44
+ 'rake-compiler' => '~> 0.7',
45
+ 'rspec' => '~> 2.4',
46
+ }
105
47
 
106
- RAKE_TASKDIR = BASEDIR + 'rake'
107
- RAKE_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/*.rb" )
108
- PKG_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/{191_compat,helpers,packaging,rdoc,testing}.rb" )
109
- PKG_TASKLIBS.include( "#{RAKE_TASKDIR}/manual.rb" ) if MANUALDIR.exist?
48
+ self.spec_extras[:licenses] = ["BSD"]
49
+ self.spec_extras[:signing_key] = '/Volumes/Keys/ged-private_gem_key.pem'
50
+ self.spec_extras[:extensions] = [ "ext/extconf.rb" ]
110
51
 
111
- RAKE_TASKLIBS_URL = 'http://repo.deveiate.org/rake-tasklibs'
52
+ self.require_ruby_version( '>=1.8.7' )
112
53
 
113
- LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
54
+ self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
55
+ self.yard_opts = [ '--protected', '--verbose' ] if self.respond_to?( :yard_opts= )
114
56
 
115
- EXTRA_PKGFILES = Rake::FileList.new
116
- EXTRA_PKGFILES.include( "#{BASEDIR}/LICENSE.discount" )
117
- EXTRA_PKGFILES.include( "#{BASEDIR}/spec/data/**/*.{txt,text,html}" )
118
- EXTRA_PKGFILES.include( "#{BASEDIR}/ext/VERSION" )
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
- ]
57
+ self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
58
+ end
136
59
 
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
- ]
60
+ ENV['VERSION'] ||= hoespec.spec.version.to_s
146
61
 
62
+ # Ensure the specs pass before checking in
63
+ task 'hg:precheckin' => :spec
147
64
 
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?
65
+ # Ensure the extension is compiled before testing
66
+ task :spec => :compile
153
67
 
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" )
68
+ # gem-testers support
69
+ task :test do
70
+ # rake-compiler always wants to copy the compiled extension into lib/, but
71
+ # we don't want testers to have to re-compile, especially since that
72
+ # often fails because they can't (and shouldn't have to) write to tmp/ in
73
+ # the installed gem dir. So we clear the task rake-compiler set up
74
+ # to break the dependency between :spec and :compile when running under
75
+ # rubygems-test, and then run :spec.
76
+ Rake::Task[ EXT.to_s ].clear
77
+ Rake::Task[ :spec ].execute
166
78
  end
167
79
 
168
- require RAKE_TASKDIR + 'helpers.rb'
169
-
170
- # Set the build ID if the mercurial executable is available
171
- if hg = which( 'hg' )
172
- id = IO.read('|-') or exec hg.to_s, 'id', '-n'
173
- PKG_BUILD = 'pre' + (id.chomp[ /^[[:xdigit:]]+/ ] || '1')
174
- else
175
- PKG_BUILD = 'pre0'
80
+ desc "Turn on warnings and debugging in the build."
81
+ task :maint do
82
+ ENV['MAINTAINER_MODE'] = 'yes'
176
83
  end
177
- SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
178
- SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
179
-
180
- # Documentation constants
181
- RDOCDIR = DOCSDIR + 'api'
182
- RDOC_OPTIONS = [
183
- '-w', '4',
184
- '-HN',
185
- '-i', '.',
186
- '-m', 'README',
187
- '-t', PKG_NAME,
188
- '-W', 'http://deveiate.org/projects/BlueCloth/browser/'
189
- ]
190
-
191
- # Release constants
192
- SMTP_HOST = "mail.faeriemud.org"
193
- SMTP_PORT = 465 # SMTP + SSL
194
-
195
- # Project constants
196
- PROJECT_HOST = 'deveiate'
197
- PROJECT_PUBDIR = '/usr/local/www/public/code'
198
- PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
199
- PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
200
- PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
201
-
202
- # Gem dependencies: gemname => version
203
- DEPENDENCIES = {
204
- }
205
84
 
206
- # Developer Gem dependencies: gemname => version
207
- DEVELOPMENT_DEPENDENCIES = {
208
- 'rake' => '>= 0.8.7',
209
- 'rcodetools' => '>= 0.7.0.0',
210
- 'rcov' => '>= 0.8.1.2.0',
211
- 'rdoc' => '>= 2.4.3',
212
- 'RedCloth' => '>= 4.0.3',
213
- 'rspec' => '>= 1.2.6',
214
- 'termios' => '>= 0',
215
- 'text-format' => '>= 1.0.0',
216
- 'tmail' => '>= 1.2.3.1',
217
- 'diff-lcs' => '>= 1.1.2',
218
- 'rake-compiler' => '>= 0.7.0',
219
- }
85
+ ENV['RUBY_CC_VERSION'] = '1.8.7:1.9.2'
220
86
 
221
- # Non-gem requirements: packagename => version
222
- REQUIREMENTS = {
223
- }
224
-
225
- # RubyGem specification
226
- GEMSPEC = Gem::Specification.new do |gem|
227
- gem.name = PKG_NAME.downcase
228
- gem.version = PKG_VERSION
229
-
230
- gem.summary = PKG_SUMMARY
231
- gem.description = [
232
- "BlueCloth is a Ruby implementation of [Markdown][1], a text-to-HTML conversion",
233
- "tool for web writers. To quote from the project page: Markdown allows you to",
234
- "write using an easy-to-read, easy-to-write plain text format, then convert it to",
235
- "structurally valid XHTML (or HTML).",
236
- ].join( "\n" )
237
-
238
- gem.authors = "Michael Granger"
239
- gem.email = ["ged@FaerieMUD.org"]
240
- gem.homepage = 'http://deveiate.org/projects/BlueCloth/'
241
-
242
- gem.has_rdoc = true
243
- gem.rdoc_options = RDOC_OPTIONS
244
- gem.extra_rdoc_files = %w[ChangeLog README LICENSE]
245
-
246
- gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s
247
- gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }.
248
- collect {|pn| File.basename(pn) }
249
- gem.require_paths << EXTDIR.relative_path_from( BASEDIR ).to_s if EXTDIR.exist?
250
-
251
- if EXTCONF.exist?
252
- gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
253
- end
254
-
255
- gem.files = RELEASE_FILES
256
- gem.test_files = SPEC_FILES
257
-
258
- DEPENDENCIES.each do |name, version|
259
- version = '>= 0' if version.length.zero?
260
- gem.add_runtime_dependency( name, version )
261
- end
262
-
263
- REQUIREMENTS.each do |name, version|
264
- gem.requirements << [ name, version ].compact.join(' ')
265
- end
87
+ # Rake-compiler task
88
+ Rake::ExtensionTask.new do |ext|
89
+ ext.name = 'bluecloth_ext'
90
+ ext.gem_spec = hoespec.spec
91
+ ext.ext_dir = 'ext'
92
+ ext.source_pattern = "*.{c,h}"
93
+ ext.cross_compile = true
94
+ ext.cross_platform = %w[i386-mswin32 i386-mingw32]
266
95
  end
267
96
 
268
- $trace = Rake.application.options.trace ? true : false
269
- $dryrun = Rake.application.options.dryrun ? true : false
270
- $include_dev_dependencies = false
271
97
 
272
- # Load any remaining task libraries
273
- RAKE_TASKLIBS.each do |tasklib|
274
- next if tasklib.to_s =~ %r{/helpers\.rb$}
275
- begin
276
- trace " loading tasklib %s" % [ tasklib ]
277
- import tasklib
278
- rescue ScriptError => err
279
- fail "Task library '%s' failed to load: %s: %s" %
280
- [ tasklib, err.class.name, err.message ]
281
- trace "Backtrace: \n " + err.backtrace.join( "\n " )
282
- rescue => err
283
- log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
284
- [ tasklib, err.class.name, err.message ]
285
- trace "Backtrace: \n " + err.backtrace.join( "\n " )
98
+ begin
99
+ include Hoe::MercurialHelpers
100
+
101
+ ### Task: prerelease
102
+ desc "Append the package build number to package versions"
103
+ task :pre do
104
+ rev = get_numeric_rev()
105
+ trace "Current rev is: %p" % [ rev ]
106
+ hoespec.spec.version.version << "pre#{rev}"
107
+ Rake::Task[:gem].clear
108
+
109
+ Gem::PackageTask.new( hoespec.spec ) do |pkg|
110
+ pkg.need_zip = true
111
+ pkg.need_tar = true
112
+ end
286
113
  end
287
- end
288
-
289
- # Load any project-specific rules defined in 'Rakefile.local' if it exists
290
- import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
291
-
292
-
293
- #####################################################################
294
- ### T A S K S
295
- #####################################################################
296
-
297
- ### Default task
298
- task :default => [:clean, :local, :spec, :rdoc, :package]
299
-
300
- ### Task the local Rakefile can append to -- no-op by default
301
- task :local
302
-
303
- ### Task: clean
304
- CLEAN.include 'coverage', '**/*.orig', '**/*.rej'
305
- CLOBBER.include 'artifacts', 'coverage.info', 'ChangeLog', PKGDIR
306
114
 
307
- ### Task: changelog
308
- file 'ChangeLog' do |task|
309
- log "Updating #{task.name}"
310
-
311
- changelog = make_changelog()
312
- File.open( task.name, 'w' ) do |fh|
313
- fh.print( changelog )
115
+ ### Make the ChangeLog update if the repo has changed since it was last built
116
+ file '.hg/branch'
117
+ file 'ChangeLog' => '.hg/branch' do |task|
118
+ $stderr.puts "Updating the changelog..."
119
+ content = make_changelog()
120
+ File.open( task.name, 'w', 0644 ) do |fh|
121
+ fh.print( content )
122
+ end
314
123
  end
315
- end
316
124
 
125
+ # Rebuild the ChangeLog immediately before release
126
+ task :prerelease => 'ChangeLog'
317
127
 
318
- ### Task: cruise (Cruisecontrol task)
319
- desc "Cruisecontrol build"
320
- task :cruise => [:clean, 'spec:quiet', :package] do |task|
321
- raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
322
- artifact_dir = ARTIFACTS_DIR.cleanpath + (CC_BUILD_LABEL || Time.now.strftime('%Y%m%d-%T'))
323
- artifact_dir.mkpath
324
-
325
- coverage = BASEDIR + 'coverage'
326
- if coverage.exist? && coverage.directory?
327
- $stderr.puts "Copying coverage stats..."
328
- FileUtils.cp_r( 'coverage', artifact_dir )
128
+ rescue NameError => err
129
+ task :no_hg_helpers do
130
+ fail "Couldn't define the :pre task: %s: %s" % [ err.class.name, err.message ]
329
131
  end
330
132
 
331
- $stderr.puts "Copying packages..."
332
- FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
333
- end
334
-
133
+ task :pre => :no_hg_helpers
134
+ task 'ChangeLog' => :no_hg_helpers
335
135
 
336
- desc "Update the build system to the latest version"
337
- task :update_build do
338
- log "Updating the build system"
339
- run 'hg', '-R', RAKE_TASKDIR, 'pull', '-u'
340
- log "Updating the Rakefile"
341
- sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
342
136
  end
343
137