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.
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/History.md +4 -0
- data/LICENSE +1 -1
- data/Manifest.txt +103 -0
- data/README.md +103 -0
- data/Rakefile +95 -301
- data/ext/VERSION +1 -1
- data/ext/bluecloth.c +69 -23
- data/ext/bluecloth.h +13 -2
- data/ext/config.h +13 -2
- data/ext/css.c +14 -5
- data/ext/cstring.h +4 -2
- data/ext/docheader.c +13 -7
- data/ext/emmatch.c +188 -0
- data/ext/extconf.rb +7 -9
- data/ext/generate.c +333 -293
- data/ext/html5.c +24 -0
- data/ext/markdown.c +326 -185
- data/ext/markdown.h +52 -29
- data/ext/mkdio.c +82 -41
- data/ext/mkdio.h +44 -23
- data/ext/resource.c +4 -2
- data/ext/setup.c +47 -0
- data/ext/tags.c +123 -0
- data/ext/tags.h +19 -0
- data/lib/1.8/bluecloth_ext.so +0 -0
- data/lib/1.9/bluecloth_ext.so +0 -0
- data/lib/bluecloth.rb +77 -42
- data/spec/bluecloth/101_changes_spec.rb +18 -21
- data/spec/bluecloth/TEMPLATE +36 -0
- data/spec/bluecloth/autolinks_spec.rb +4 -7
- data/spec/bluecloth/blockquotes_spec.rb +20 -23
- data/spec/bluecloth/code_spans_spec.rb +2 -5
- data/spec/bluecloth/emphasis_spec.rb +2 -5
- data/spec/bluecloth/entities_spec.rb +2 -5
- data/spec/bluecloth/hrules_spec.rb +2 -5
- data/spec/bluecloth/images_spec.rb +2 -5
- data/spec/bluecloth/inline_html_spec.rb +26 -66
- data/spec/bluecloth/links_spec.rb +1 -5
- data/spec/bluecloth/lists_spec.rb +2 -5
- data/spec/bluecloth/paragraphs_spec.rb +2 -5
- data/spec/bluecloth/titles_spec.rb +2 -5
- data/spec/bluecloth_spec.rb +36 -22
- data/spec/bugfix_spec.rb +90 -10
- data/spec/contributions_spec.rb +2 -3
- data/spec/discount_spec.rb +50 -10
- data/spec/lib/helpers.rb +18 -117
- data/spec/lib/matchers.rb +7 -18
- data/spec/markdowntest_spec.rb +3 -39
- metadata +257 -143
- metadata.gz.sig +0 -0
- data/ChangeLog +0 -387
- data/README +0 -81
- data/Rakefile.local +0 -41
- data/rake/191_compat.rb +0 -26
- data/rake/dependencies.rb +0 -76
- data/rake/helpers.rb +0 -435
- data/rake/hg.rb +0 -273
- data/rake/manual.rb +0 -782
- data/rake/packaging.rb +0 -123
- data/rake/publishing.rb +0 -274
- data/rake/rdoc.rb +0 -30
- data/rake/style.rb +0 -62
- data/rake/svn.rb +0 -668
- data/rake/testing.rb +0 -187
- data/rake/verifytask.rb +0 -64
data.tar.gz.sig
ADDED
Binary file
|
data/.gemtest
ADDED
File without changes
|
data/History.md
ADDED
data/LICENSE
CHANGED
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
|
-
|
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
|
-
|
14
|
-
|
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 '
|
26
|
-
include Readline
|
7
|
+
require 'rake/extensiontask'
|
27
8
|
rescue LoadError
|
28
|
-
|
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 '
|
13
|
+
require 'hoe'
|
37
14
|
rescue LoadError
|
38
|
-
|
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
|
-
|
81
|
-
|
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
|
-
|
84
|
-
|
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
|
-
|
27
|
+
# Load Hoe plugins
|
28
|
+
Hoe.plugin :mercurial
|
29
|
+
Hoe.plugin :yard
|
30
|
+
Hoe.plugin :signing
|
90
31
|
|
91
|
-
|
32
|
+
Hoe.plugins.delete :rubyforge
|
33
|
+
Hoe.plugins.delete :compiler
|
92
34
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
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
|
-
|
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
|
-
|
104
|
-
|
42
|
+
self.extra_dev_deps.push *{
|
43
|
+
'tidy-ext' => '~> 0.1',
|
44
|
+
'rake-compiler' => '~> 0.7',
|
45
|
+
'rspec' => '~> 2.4',
|
46
|
+
}
|
105
47
|
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
-
|
52
|
+
self.require_ruby_version( '>=1.8.7' )
|
112
53
|
|
113
|
-
|
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
|
-
|
116
|
-
|
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
|
-
|
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
|
-
|
149
|
-
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
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
|
-
|
169
|
-
|
170
|
-
|
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
|
-
|
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
|
-
#
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
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
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
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
|
-
###
|
308
|
-
file '
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
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
|
-
|
319
|
-
|
320
|
-
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
|
-
|
332
|
-
|
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
|
|