bluecloth 2.0.9 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data.tar.gz.sig +0 -0
  2. data/ChangeLog +29 -2
  3. data/Rakefile +18 -15
  4. data/ext/VERSION +1 -1
  5. data/ext/bluecloth.c +26 -5
  6. data/ext/config.h +13 -2
  7. data/ext/css.c +14 -5
  8. data/ext/cstring.h +1 -1
  9. data/ext/docheader.c +13 -7
  10. data/ext/emmatch.c +1 -1
  11. data/ext/generate.c +134 -48
  12. data/ext/markdown.c +207 -94
  13. data/ext/markdown.h +37 -28
  14. data/ext/mkdio.c +39 -32
  15. data/ext/mkdio.h +34 -24
  16. data/ext/resource.c +3 -1
  17. data/ext/setup.c +47 -0
  18. data/ext/tags.c +15 -2
  19. data/ext/tags.h +1 -0
  20. data/lib/bluecloth.rb +65 -40
  21. data/rake/documentation.rb +9 -1
  22. data/rake/hg.rb +34 -3
  23. data/rake/packaging.rb +1 -1
  24. data/rake/publishing.rb +2 -9
  25. data/rake/testing.rb +53 -88
  26. data/spec/bluecloth/101_changes_spec.rb +17 -17
  27. data/spec/bluecloth/autolinks_spec.rb +1 -1
  28. data/spec/bluecloth/blockquotes_spec.rb +18 -18
  29. data/spec/bluecloth/code_spans_spec.rb +1 -1
  30. data/spec/bluecloth/emphasis_spec.rb +1 -1
  31. data/spec/bluecloth/entities_spec.rb +1 -1
  32. data/spec/bluecloth/hrules_spec.rb +1 -1
  33. data/spec/bluecloth/images_spec.rb +1 -1
  34. data/spec/bluecloth/inline_html_spec.rb +1 -1
  35. data/spec/bluecloth/links_spec.rb +1 -1
  36. data/spec/bluecloth/lists_spec.rb +1 -1
  37. data/spec/bluecloth/paragraphs_spec.rb +1 -1
  38. data/spec/bluecloth/titles_spec.rb +1 -1
  39. data/spec/bluecloth_spec.rb +13 -13
  40. data/spec/bugfix_spec.rb +6 -1
  41. data/spec/contributions_spec.rb +1 -1
  42. data/spec/discount_spec.rb +2 -2
  43. data/spec/lib/helpers.rb +1 -124
  44. data/spec/lib/matchers.rb +1 -1
  45. data/spec/markdowntest_spec.rb +1 -1
  46. metadata +10 -10
  47. metadata.gz.sig +0 -0
data/ext/tags.h CHANGED
@@ -12,6 +12,7 @@ struct kw {
12
12
 
13
13
  struct kw* mkd_search_tags(char *, int);
14
14
  void mkd_prepare_tags();
15
+ void mkd_deallocate_tags();
15
16
  void mkd_sort_tags();
16
17
  void mkd_define_tag(char *, int);
17
18
 
@@ -21,7 +21,7 @@ require 'rbconfig'
21
21
  #
22
22
  # == Version
23
23
  #
24
- # $Id: bluecloth.rb,v 486a5a2a8cd2 2010/09/23 14:15:03 ged $
24
+ # $Id: bluecloth.rb,v 3dd45baec201 2011/01/17 17:14:20 ged $
25
25
  #
26
26
  # == License
27
27
  #
@@ -32,20 +32,31 @@ require 'rbconfig'
32
32
  class BlueCloth
33
33
 
34
34
  # Release Version
35
- VERSION = '2.0.9'
35
+ VERSION = '2.0.10'
36
36
 
37
37
  # The defaults for all supported options.
38
38
  DEFAULT_OPTIONS = {
39
- :remove_links => false,
40
- :remove_images => false,
41
- :smartypants => true,
42
- :pseudoprotocols => false,
43
- :pandoc_headers => false,
44
- :header_labels => false,
45
- :escape_html => false,
46
- :strict_mode => true,
47
- :auto_links => false,
48
- :safe_links => false,
39
+ :alphalists => true,
40
+ :auto_links => false,
41
+ :definition_lists => false,
42
+ :divquotes => false,
43
+ :escape_html => false,
44
+ :expand_tabs => true,
45
+ :header_labels => false,
46
+ :mdtest_1_compat => false,
47
+ :pandoc_headers => false,
48
+ :pseudoprotocols => false,
49
+ :relaxed => false,
50
+ :remove_images => false,
51
+ :remove_links => false,
52
+ :safe_links => false,
53
+ :smartypants => true,
54
+ :strict_mode => true,
55
+ :strikethrough => true,
56
+ :superscript => false,
57
+ :tables => false,
58
+ :tagtext_mode => false,
59
+ :xml_cdata => false,
49
60
  }.freeze
50
61
 
51
62
  # The number of characters of the original markdown source to include in the
@@ -74,20 +85,27 @@ class BlueCloth
74
85
 
75
86
  flags = 0
76
87
 
77
- if opthash[:remove_links] then flags |= MKD_NOLINKS; end
78
- if opthash[:remove_images] then flags |= MKD_NOIMAGE; end
79
- if ! opthash[:smartypants] then flags |= MKD_NOPANTS; end
80
- if ! opthash[:pseudoprotocols] then flags |= MKD_NO_EXT; end
81
- if ! opthash[:pandoc_headers] then flags |= MKD_NOHEADER; end
82
- if opthash[:header_labels] then flags |= MKD_TOC; end
83
- if opthash[:mdtest_1_compat] then flags |= MKD_1_COMPAT; end
84
- if opthash[:escape_html] then flags |= MKD_NOHTML; end
85
- if opthash[:strict_mode] then flags |= MKD_STRICT; end
86
- if opthash[:tagtext_mode] then flags |= MKD_TAGTEXT; end
87
- if opthash[:auto_links] then flags |= MKD_AUTOLINK; end
88
- if opthash[:safe_links] then flags |= MKD_SAFELINK; end
89
- if ! opthash[:tables] then flags |= MKD_NOTABLES; end
90
- if ! opthash[:strikethrough] then flags |= MKD_NOSTRIKETHROUGH; end
88
+ if opthash[:remove_links] then flags |= MKD_NOLINKS; end
89
+ if opthash[:remove_images] then flags |= MKD_NOIMAGE; end
90
+ if ! opthash[:smartypants] then flags |= MKD_NOPANTS; end
91
+ if opthash[:escape_html] then flags |= MKD_NOHTML; end
92
+ if opthash[:strict_mode] then flags |= MKD_STRICT; end
93
+ if opthash[:tagtext_mode] then flags |= MKD_TAGTEXT; end
94
+ if ! opthash[:pseudoprotocols] then flags |= MKD_NO_EXT; end
95
+ if opthash[:xml_cdata] then flags |= MKD_CDATA; end
96
+ if ! opthash[:superscript] then flags |= MKD_NOSUPERSCRIPT; end
97
+ if ! opthash[:relaxed] then flags |= MKD_NORELAXED; end
98
+ if ! opthash[:tables] then flags |= MKD_NOTABLES; end
99
+ if ! opthash[:strikethrough] then flags |= MKD_NOSTRIKETHROUGH; end
100
+ if opthash[:header_labels] then flags |= MKD_TOC; end
101
+ if opthash[:mdtest_1_compat] then flags |= MKD_1_COMPAT; end
102
+ if opthash[:auto_links] then flags |= MKD_AUTOLINK; end
103
+ if opthash[:safe_links] then flags |= MKD_SAFELINK; end
104
+ if ! opthash[:pandoc_headers] then flags |= MKD_NOHEADER; end
105
+ if opthash[:expand_tabs] then flags |= MKD_TABSTOP; end
106
+ if ! opthash[:divquotes] then flags |= MKD_NODIVQUOTE; end
107
+ if ! opthash[:alphalists] then flags |= MKD_NOALPHALIST; end
108
+ if ! opthash[:definition_lists] then flags |= MKD_NODLIST; end
91
109
 
92
110
  return flags
93
111
  end
@@ -98,20 +116,27 @@ class BlueCloth
98
116
  flags = flags.to_i
99
117
 
100
118
  opthash = {}
101
- if ( flags & MKD_NOLINKS ).nonzero? then opthash[:remove_links] = true; end
102
- if ( flags & MKD_NOIMAGE ).nonzero? then opthash[:remove_images] = true; end
103
- if !( flags & MKD_NOPANTS ).nonzero? then opthash[:smartypants] = true; end
104
- if !( flags & MKD_NO_EXT ).nonzero? then opthash[:pseudoprotocols] = true; end
105
- if !( flags & MKD_NOHEADER ).nonzero? then opthash[:pandoc_headers] = true; end
106
- if ( flags & MKD_TOC ).nonzero? then opthash[:header_labels] = true; end
107
- if ( flags & MKD_1_COMPAT ).nonzero? then opthash[:mdtest_1_compat] = true; end
108
- if ( flags & MKD_NOHTML ).nonzero? then opthash[:escape_html] = true; end
109
- if ( flags & MKD_STRICT ).nonzero? then opthash[:strict_mode] = true; end
110
- if ( flags & MKD_TAGTEXT ).nonzero? then opthash[:tagtext_mode] = true; end
111
- if ( flags & MKD_AUTOLINK ).nonzero? then opthash[:auto_links] = true; end
112
- if ( flags & MKD_SAFELINK ).nonzero? then opthash[:safe_links] = true; end
113
- if !( flags & MKD_NOTABLES ).nonzero? then opthash[:tables] = true; end
114
- if !( flags & MKD_NOSTRIKETHROUGH ).nonzero? then opthash[:strikethrough] = true; end
119
+ if ( flags & MKD_NOLINKS ).nonzero? then opthash[:remove_links] = true; end
120
+ if ( flags & MKD_NOIMAGE ).nonzero? then opthash[:remove_images] = true; end
121
+ if !( flags & MKD_NOPANTS ).nonzero? then opthash[:smartypants] = true; end
122
+ if ( flags & MKD_NOHTML ).nonzero? then opthash[:escape_html] = true; end
123
+ if ( flags & MKD_STRICT ).nonzero? then opthash[:strict_mode] = true; end
124
+ if ( flags & MKD_TAGTEXT ).nonzero? then opthash[:tagtext_mode] = true; end
125
+ if !( flags & MKD_NO_EXT ).nonzero? then opthash[:pseudoprotocols] = true; end
126
+ if ( flags & MKD_CDATA ).nonzero? then opthash[:xml_cdata] = true; end
127
+ if !( flags & MKD_NOSUPERSCRIPT ).nonzero? then opthash[:superscript] = true; end
128
+ if !( flags & MKD_NORELAXED ).nonzero? then opthash[:relaxed] = true; end
129
+ if !( flags & MKD_NOTABLES ).nonzero? then opthash[:tables] = true; end
130
+ if !( flags & MKD_NOSTRIKETHROUGH ).nonzero? then opthash[:strikethrough] = true; end
131
+ if ( flags & MKD_TOC ).nonzero? then opthash[:header_labels] = true; end
132
+ if ( flags & MKD_1_COMPAT ).nonzero? then opthash[:mdtest_1_compat] = true; end
133
+ if ( flags & MKD_AUTOLINK ).nonzero? then opthash[:auto_links] = true; end
134
+ if ( flags & MKD_SAFELINK ).nonzero? then opthash[:safe_links] = true; end
135
+ if !( flags & MKD_NOHEADER ).nonzero? then opthash[:pandoc_headers] = true; end
136
+ if ( flags & MKD_TABSTOP ).nonzero? then opthash[:expand_tabs] = true; end
137
+ if !( flags & MKD_NODIVQUOTE ).nonzero? then opthash[:divquotes] = true; end
138
+ if !( flags & MKD_NOALPHALIST ).nonzero? then opthash[:alphalists] = true; end
139
+ if !( flags & MKD_NODLIST ).nonzero? then opthash[:definition_lists] = true; end
115
140
 
116
141
  return opthash
117
142
  end
@@ -54,6 +54,7 @@ begin
54
54
  class YARD::RegistryStore; include YardGlobals; end
55
55
  class YARD::Docstring; include YardGlobals; end
56
56
  module YARD::Templates::Helpers::ModuleHelper; include YardGlobals; end
57
+ module YARD::Templates::Helpers::HtmlHelper; include YardGlobals; end
57
58
 
58
59
  if vvec(RUBY_VERSION) >= vvec("1.9.1")
59
60
  # Monkeypatched to allow more than two '#' characters at the beginning
@@ -62,8 +63,15 @@ begin
62
63
  require 'yard/parser/ruby/ruby_parser'
63
64
  class YARD::Parser::Ruby::RipperParser < Ripper
64
65
  def on_comment(comment)
65
- $stderr.puts "Adding comment: %p" % [ comment ]
66
66
  visit_ns_token(:comment, comment)
67
+ case comment
68
+ when /\A# @group\s+(.+)\s*\Z/
69
+ @groups.unshift [lineno, $1]
70
+ return
71
+ when /\A# @endgroup\s*\Z/
72
+ @groups.unshift [lineno, nil]
73
+ return
74
+ end
67
75
 
68
76
  comment = comment.gsub(/^\#+\s{0,1}/, '').chomp
69
77
  append_comment = @comments[lineno - 1]
data/rake/hg.rb CHANGED
@@ -83,6 +83,15 @@ unless defined?( HG_DOTDIR )
83
83
  return paths
84
84
  end
85
85
 
86
+ ### Return the list of files which are not of status 'clean'
87
+ def get_uncommitted_files
88
+ list = read_command_output( 'hg', 'status', '-n', '--color', 'never' )
89
+ list = list.split( /\n/ )
90
+
91
+ trace "Changed files: %p" % [ list ]
92
+ return list
93
+ end
94
+
86
95
  ### Return the list of files which are of status 'unknown'
87
96
  def get_unknown_files
88
97
  list = read_command_output( 'hg', 'status', '-un', '--color', 'never' )
@@ -149,11 +158,21 @@ unless defined?( HG_DOTDIR )
149
158
 
150
159
  desc "Prepare for a new release"
151
160
  task :prep_release do
161
+ uncommitted_files = get_uncommitted_files()
162
+ unless uncommitted_files.empty?
163
+ log "Uncommitted files:\n",
164
+ *uncommitted_files.map {|fn| " #{fn}\n" }
165
+ ask_for_confirmation( "\nRelease anyway?", true ) do
166
+ log "Okay, releasing with uncommitted versions."
167
+ end
168
+ end
169
+
152
170
  tags = get_tags()
153
171
  rev = get_current_rev()
172
+ pkg_version_tag = "v#{PKG_VERSION}"
154
173
 
155
174
  # Look for a tag for the current release version, and if it exists abort
156
- if tags.include?( PKG_VERSION )
175
+ if tags.include?( pkg_version_tag )
157
176
  error "Version #{PKG_VERSION} already has a tag. Did you mean " +
158
177
  "to increment the version in #{VERSION_FILE}?"
159
178
  fail
@@ -164,8 +183,8 @@ unless defined?( HG_DOTDIR )
164
183
  run 'hg', 'sign'
165
184
 
166
185
  # Tag the current rev
167
- log "Tagging rev #{rev} as #{PKG_VERSION}"
168
- run 'hg', 'tag', PKG_VERSION
186
+ log "Tagging rev #{rev} as #{pkg_version_tag}"
187
+ run 'hg', 'tag', pkg_version_tag
169
188
 
170
189
  # Offer to push
171
190
  Rake::Task['hg:push'].invoke
@@ -229,6 +248,18 @@ unless defined?( HG_DOTDIR )
229
248
  end
230
249
 
231
250
 
251
+ desc "Update to tip"
252
+ task :update do
253
+ run 'hg', 'update'
254
+ end
255
+
256
+
257
+ desc "Clobber all changes (hg up -C)"
258
+ task :update_and_clobber do
259
+ run 'hg', 'update', '-C'
260
+ end
261
+
262
+
232
263
  desc "Check the current code in if tests pass"
233
264
  task :checkin => ['hg:pull', 'hg:newfiles', 'test', COMMIT_MSG_FILE] do
234
265
  targets = get_target_args()
@@ -12,7 +12,7 @@ include Config
12
12
  ### Task: prerelease
13
13
  desc "Append the package build number to package versions"
14
14
  task :prerelease do
15
- GEMSPEC.version.version << ".#{PKG_BUILD}"
15
+ GEMSPEC.version.version << "pre#{PKG_BUILD}"
16
16
  Rake::Task[:gem].clear
17
17
 
18
18
  Gem::PackageTask.new( GEMSPEC ) do |pkg|
@@ -5,6 +5,8 @@
5
5
  RELEASE_NOTES_FILE = 'release.notes'
6
6
  RELEASE_ANNOUNCE_FILE = 'release.ann'
7
7
 
8
+ GEM_PUBHOST = '' unless defined?( GEM_PUBHOST )
9
+
8
10
  require 'net/smtp'
9
11
  require 'net/protocol'
10
12
  require 'openssl'
@@ -235,17 +237,8 @@ begin
235
237
 
236
238
  == Installation
237
239
 
238
- Via gems:
239
-
240
240
  $ sudo gem install #{GEMSPEC.name}
241
241
 
242
- or from source:
243
-
244
- $ wget http://deveiate.org/code/#{PKG_FILE_NAME}.tar.gz
245
- $ tar -xzvf #{PKG_FILE_NAME}.tar.gz
246
- $ cd #{PKG_FILE_NAME}
247
- $ sudo rake install
248
-
249
242
  == Changes
250
243
  #{relnotes}
251
244
  }.gsub( /^\t+/, '' )
@@ -16,7 +16,7 @@ end
16
16
  SPEC_FILES = [] unless defined?( SPEC_FILES )
17
17
  TEST_FILES = [] unless defined?( TEST_FILES )
18
18
 
19
- COMMON_SPEC_OPTS = ['-Du'] unless defined?( COMMON_SPEC_OPTS )
19
+ COMMON_RSPEC_OPTS = [] unless defined?( COMMON_RSPEC_OPTS )
20
20
 
21
21
  COVERAGE_TARGETDIR = BASEDIR + 'coverage' unless defined?( COVERAGE_TARGETDIR )
22
22
  RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib' unless
@@ -39,149 +39,114 @@ end
39
39
 
40
40
  ### RSpec specifications
41
41
  begin
42
- gem 'rspec', '>= 1.1.3'
42
+ gem 'rspec', '>= 2.0.0'
43
43
 
44
- require 'spec'
45
- require 'spec/rake/spectask'
44
+ require 'rspec'
45
+ require 'rspec/core/rake_task'
46
46
 
47
47
  ### Task: spec
48
48
  desc "Run specs"
49
49
  task :spec => 'spec:doc'
50
+ task :specs => :spec
50
51
 
51
52
  namespace :spec do
52
53
  desc "Run rspec every time there's a change to one of the files"
53
54
  task :autotest do
54
- require 'autotest/rspec'
55
-
56
- autotester = Autotest::Rspec.new
57
- autotester.run
55
+ require 'autotest'
56
+ Autotest.add_discovery { "rspec2" }
57
+ Autotest.run
58
58
  end
59
59
 
60
60
  desc "Generate regular color 'doc' spec output"
61
- Spec::Rake::SpecTask.new( :doc ) do |task|
62
- task.spec_files = SPEC_FILES
63
- task.spec_opts = COMMON_SPEC_OPTS + ['-f', 's', '-c']
61
+ RSpec::Core::RakeTask.new( :doc ) do |task|
62
+ task.rspec_opts = COMMON_RSPEC_OPTS + ['-f', 'd', '-c']
64
63
  end
65
64
 
66
65
  desc "Generate spec output with profiling"
67
- Spec::Rake::SpecTask.new( :profile ) do |task|
68
- task.spec_files = SPEC_FILES
69
- task.spec_opts = COMMON_SPEC_OPTS + ['-f', 'o']
66
+ RSpec::Core::RakeTask.new( :profile ) do |task|
67
+ task.rspec_opts = COMMON_RSPEC_OPTS + ['-f', 'p', '-p']
70
68
  end
71
69
 
72
70
  desc "Generate quiet non-colored plain-text output"
73
- Spec::Rake::SpecTask.new( :quiet ) do |task|
74
- task.spec_files = SPEC_FILES
75
- task.spec_opts = COMMON_SPEC_OPTS + ['-f', 'p']
71
+ RSpec::Core::RakeTask.new( :quiet ) do |task|
72
+ task.rspec_opts = COMMON_RSPEC_OPTS + ['-f', 'p']
76
73
  end
77
74
 
78
75
  desc "Generate HTML output"
79
- Spec::Rake::SpecTask.new( :html ) do |task|
80
- task.spec_files = SPEC_FILES
81
- task.spec_opts = COMMON_SPEC_OPTS + ['-f', 'h']
76
+ RSpec::Core::RakeTask.new( :html ) do |task|
77
+ task.rspec_opts = COMMON_RSPEC_OPTS + ['-f', 'h']
82
78
  end
83
79
 
84
- end
85
- rescue LoadError => err
86
- task :no_rspec do
87
- $stderr.puts "Specification tasks not defined: %s" % [ err.message ]
88
- end
89
-
90
- task :spec => :no_rspec
91
- namespace :spec do
92
- task :autotest => :no_rspec
93
- task :doc => :no_rspec
94
- task :profile => :no_rspec
95
- task :quiet => :no_rspec
96
- task :html => :no_rspec
97
- end
98
- end
99
-
100
-
101
- ### Test::Unit tests
102
- begin
103
- require 'rake/testtask'
104
-
105
- Rake::TestTask.new( :unittests ) do |task|
106
- task.libs += [LIBDIR]
107
- task.test_files = TEST_FILES
108
- task.verbose = true
109
- end
110
80
 
111
- rescue LoadError => err
112
- task :no_test do
113
- $stderr.puts "Test tasks not defined: %s" % [ err.message ]
114
81
  end
115
82
 
116
- task :unittests => :no_rspec
117
- end
118
-
119
-
120
- ### RCov (via RSpec) tasks
121
- begin
122
- gem 'rcov'
123
- gem 'rspec', '>= 1.1.3'
124
-
125
- require 'spec'
126
- require 'rcov'
127
-
128
83
  ### Task: coverage (via RCov)
129
84
  desc "Build test coverage reports"
130
- unless SPEC_FILES.empty?
131
- Spec::Rake::SpecTask.new( :coverage ) do |task|
132
- task.spec_files = SPEC_FILES
133
- task.libs += [LIBDIR]
134
- task.spec_opts = ['-f', 'p', '-b']
135
- task.rcov_opts = RCOV_OPTS
136
- task.rcov = true
137
- end
85
+ RSpec::Core::RakeTask.new( :coverage ) do |task|
86
+ task.ruby_opts = [ "-I#{LIBDIR}" ]
87
+ task.rspec_opts = ['-f', 'p', '-b']
88
+ task.rcov_opts = RCOV_OPTS
89
+ task.rcov = true
138
90
  end
139
91
 
140
-
141
92
  ### Task: rcov
142
93
  task :rcov => :coverage
143
94
 
144
95
  ### Other coverage tasks
145
96
  namespace :coverage do
146
97
  desc "Generate a detailed text coverage report"
147
- Spec::Rake::SpecTask.new( :text ) do |task|
148
- task.spec_files = SPEC_FILES
98
+ RSpec::Core::RakeTask.new( :text ) do |task|
149
99
  task.rcov_opts = RCOV_OPTS + ['--text-report']
150
100
  task.rcov = true
151
101
  end
152
102
 
153
103
  desc "Show differences in coverage from last run"
154
- Spec::Rake::SpecTask.new( :diff ) do |task|
155
- task.spec_files = SPEC_FILES
156
- task.spec_opts = ['-f', 'p', '-b']
104
+ RSpec::Core::RakeTask.new( :diff ) do |task|
105
+ task.rspec_opts = ['-f', 'p', '-b']
157
106
  task.rcov_opts = RCOV_OPTS - ['--save'] + ['--text-coverage-diff']
158
107
  task.rcov = true
159
108
  end
160
109
 
161
110
  desc "Run RCov in 'spec-only' mode to check coverage from specs"
162
- Spec::Rake::SpecTask.new( :speconly ) do |task|
163
- task.spec_files = SPEC_FILES
111
+ RSpec::Core::RakeTask.new( :speconly ) do |task|
164
112
  task.rcov_opts = ['--exclude', RCOV_EXCLUDES, '--text-report', '--save']
165
113
  task.rcov = true
166
114
  end
167
115
  end
168
116
 
169
117
  CLOBBER.include( COVERAGE_TARGETDIR )
170
-
171
118
  rescue LoadError => err
172
- task :no_rcov do
173
- $stderr.puts "Coverage tasks not defined: RSpec+RCov tasklib not available: %s" %
174
- [ err.message ]
119
+ task :no_rspec do
120
+ $stderr.puts "Specification tasks not defined: %s" % [ err.message ]
175
121
  end
176
122
 
177
- task :coverage => :no_rcov
178
- task :clobber_coverage
179
- task :rcov => :no_rcov
180
- namespace :coverage do
181
- task :text => :no_rcov
182
- task :diff => :no_rcov
123
+ task :spec => :no_rspec
124
+ namespace :spec do
125
+ task :autotest => :no_rspec
126
+ task :doc => :no_rspec
127
+ task :profile => :no_rspec
128
+ task :quiet => :no_rspec
129
+ task :html => :no_rspec
183
130
  end
184
- task :verify => :no_rcov
131
+ end
132
+
133
+
134
+ ### Test::Unit tests
135
+ begin
136
+ require 'rake/testtask'
137
+
138
+ Rake::TestTask.new( :unittests ) do |task|
139
+ task.libs += [LIBDIR]
140
+ task.test_files = TEST_FILES
141
+ task.verbose = true
142
+ end
143
+
144
+ rescue LoadError => err
145
+ task :no_test do
146
+ $stderr.puts "Test tasks not defined: %s" % [ err.message ]
147
+ end
148
+
149
+ task :unittests => :no_rspec
185
150
  end
186
151
 
187
152