RedCloth 4.2.3 → 4.2.4.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of RedCloth might be problematic. Click here for more details.

@@ -0,0 +1,15 @@
1
+ namespace :release do
2
+ desc 'Upload all packages and tag git'
3
+ task :all => ['build:all', :release, :push_native_gems]
4
+
5
+ desc 'Push all gems to rubygems.org (gemcutter)'
6
+ task :push_native_gems do
7
+ Dir.chdir('release') do
8
+ Dir['*.gem'].each do |gem_file|
9
+ sh("gem push #{gem_file}")
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ Rake::Task['release'].prerequisites.unshift('build')
@@ -0,0 +1,11 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
4
+
5
+ RSpec::Core::RakeTask.new(:rcov) do |t|
6
+ t.rcov = true
7
+ t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
8
+ end
9
+
10
+ task :default => [:spec]
11
+ task :spec => [:compile]
@@ -0,0 +1,43 @@
1
+ namespace :rvm do
2
+
3
+ RVM_RUBIES = ['jruby-1.5.3', 'ruby-1.8.6-p398', 'ruby-1.9.1-p243', 'ruby-1.9.2-head', 'ree-1.8.7']
4
+ RVM_GEMSET_NAME = 'redcloth'
5
+
6
+ task :setup do
7
+ unless @rvm_setup
8
+ rvm_lib_path = "#{`echo $rvm_path`.strip}/lib"
9
+ $LOAD_PATH.unshift(rvm_lib_path) unless $LOAD_PATH.include?(rvm_lib_path)
10
+ require 'rvm'
11
+ require 'tmpdir'
12
+ @rvm_setup = true
13
+ end
14
+ end
15
+
16
+ desc "Install development gems using bundler to each rubie version"
17
+ task :bundle => :setup do
18
+ rvm_each_rubie { RVM.run 'gem install bundler; bundle install' }
19
+ end
20
+
21
+ desc "Echo command to run specs under each rvm ruby"
22
+ task :spec => :setup do
23
+ puts "rvm #{rvm_rubies.join(',')} rake"
24
+ end
25
+
26
+ end
27
+
28
+
29
+ # RVM Helper Methods
30
+
31
+ def rvm_each_rubie
32
+ rvm_rubies.each do |rubie|
33
+ RVM.use(rubie)
34
+ yield
35
+ end
36
+ ensure
37
+ RVM.reset_current!
38
+ end
39
+
40
+ def rvm_rubies(options={})
41
+ RVM_RUBIES.map{ |rubie| "#{rubie}@#{RVM_GEMSET_NAME}" }
42
+ end
43
+
@@ -0,0 +1,73 @@
1
+ class RagelProfiler
2
+ MEM_CONVERSION = 1024
3
+
4
+ COMMANDS = { :compile => %w(ragel rlgen-cd gcc-4.0 gnumake cc1),
5
+ :test => %w(ruby) }
6
+
7
+ FIELDS = %w(compile_time compile_max_rss test_time test_max_rss file_size)
8
+
9
+ @@results = {}
10
+
11
+ def initialize(name)
12
+ @name = name
13
+ @@results[name] = []
14
+ end
15
+
16
+ def measure(type)
17
+ raise "not a valid type" unless COMMANDS.keys.include?(type)
18
+ regex = COMMANDS[type].map {|c| Regexp.escape(c) }.join("|")
19
+ t = Thread.new do
20
+ Thread.current[:max] = 0
21
+ loop do
22
+ Thread.current[:max] = [run(regex), Thread.current[:max]].max
23
+ sleep 0.5
24
+ end
25
+ end
26
+ begin_time = Time.now
27
+ yield
28
+ total_time = Time.now - begin_time
29
+
30
+ t.kill
31
+ store_result(type, "time", total_time)
32
+ store_result(type, "max_rss", t[:max])
33
+ end
34
+
35
+ def ext_size(file)
36
+ store_result(:file, "size", File.size(file) / MEM_CONVERSION)
37
+ end
38
+
39
+ def self.results
40
+ out = []
41
+ out << "name\t" + FIELDS.join("\t")
42
+ @@results.each do |name, results|
43
+ out << [name, results ].flatten.join("\t")
44
+ end
45
+ out.join("\n")
46
+ end
47
+
48
+ private
49
+
50
+ def store_result(type, metric, value)
51
+ index = FIELDS.index("#{type.to_s}_#{metric}")
52
+ @@results[@name][index] = "%.2f" % value
53
+ end
54
+
55
+ def run(ps_regex)
56
+ ps_command = "ps axucww"
57
+ ps_output = `#{ps_command}`
58
+ fields = ps_output.to_a.first.downcase.split
59
+ memory_index = fields.index("rss")
60
+ pid_index = fields.index("pid")
61
+ ppid_index = fields.index("ppid")
62
+ total = ps_output.grep(/(#{ps_regex})\s+$/i).map do |com|
63
+ Float(com.split[memory_index]).abs
64
+ end.inject(0) { |s,v| s += v }
65
+ if total
66
+ return total/MEM_CONVERSION
67
+ else
68
+ STDERR.puts "Command not found. No processes found matching #{ps_regex}."
69
+ end
70
+
71
+ end
72
+
73
+ end
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ require 'erb'
6
+ require 'w3c_validators'
7
+
8
+ class ValidateFixtures < Test::Unit::TestCase
9
+ include W3CValidators
10
+
11
+ def setup
12
+ @v = MarkupValidator.new
13
+ sleep 1 # delay per WC3 request
14
+ end
15
+
16
+ HTML_4_0_TEMPLATE = <<EOD
17
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
18
+ <html>
19
+ <head>
20
+ <title><%= test_name %></title>
21
+ </head>
22
+ <body>
23
+ <%= content %>
24
+ </body>
25
+ </html>
26
+ EOD
27
+ XHTML_1_0_TEMPLATE = <<EOD
28
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
29
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
30
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
31
+ <head>
32
+ <title><%= test_name %></title>
33
+ </head>
34
+ <body>
35
+ <%= content %>
36
+ </body>
37
+ </html>
38
+ EOD
39
+
40
+ fixtures.each do |name, doc|
41
+ if doc['html'] && (doc['valid_html'].nil? || doc['valid_html'])
42
+ define_method("test_html_output_validity_of_#{name}") do
43
+ assert_produces_valid_html(name, doc['html'])
44
+ end
45
+ define_method("test_xhtml_output_validity_of_#{name}") do
46
+ assert_produces_valid_xhtml(name, doc['html'])
47
+ end
48
+ end
49
+ end
50
+
51
+ private
52
+ def assert_produces_valid_html(test_name, content)
53
+ body = ERB.new(HTML_4_0_TEMPLATE, nil,'-%').result(binding)
54
+ assert_validates(body)
55
+ end
56
+
57
+ def assert_produces_valid_xhtml(test_name, content)
58
+ body = ERB.new(XHTML_1_0_TEMPLATE, nil,'-%').result(binding)
59
+ assert_validates(body)
60
+ end
61
+
62
+ def assert_validates(body)
63
+ results = @v.validate_text(body)
64
+ errors = results.errors
65
+ warnings = results.warnings.reject {|w| w.message_id == "247" } # NET-enabling start-tag requires SHORTTAG YES.
66
+
67
+ assert(errors.empty?, "Validator errors: \n" +
68
+ errors.collect {|e| "'#{e.to_s}'"}.join("\n"))
69
+
70
+ assert(warnings.empty?, "Validator warnings: \n" +
71
+ warnings.collect {|w| "'#{w.to_s}'"}.join("\n"))
72
+ end
73
+
74
+ end
metadata CHANGED
@@ -1,49 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RedCloth
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 270495392
5
+ prerelease: true
5
6
  segments:
6
7
  - 4
7
8
  - 2
8
- - 3
9
- version: 4.2.3
9
+ - 4
10
+ - pre1
11
+ version: 4.2.4.pre1
10
12
  platform: ruby
11
13
  authors:
12
14
  - Jason Garber
15
+ - why the lucky stiff
16
+ - Ola Bini
13
17
  autorequire:
14
18
  bindir: bin
15
19
  cert_chain: []
16
20
 
17
- date: 2010-03-01 00:00:00 -05:00
18
- default_executable:
19
- dependencies: []
20
-
21
- description: |-
22
- RedCloth-4.2.3 - Textile parser for Ruby.
23
- http://redcloth.org/
21
+ date: 2010-11-22 00:00:00 -06:00
22
+ default_executable: redcloth
23
+ dependencies:
24
+ - !ruby/object:Gem::Dependency
25
+ name: rvm
26
+ prerelease: false
27
+ requirement: &id001 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ hash: 3
33
+ segments:
34
+ - 0
35
+ version: "0"
36
+ type: :development
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ name: rake
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ hash: 49
47
+ segments:
48
+ - 0
49
+ - 8
50
+ - 7
51
+ version: 0.8.7
52
+ type: :development
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: rspec
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ hash: 1
63
+ segments:
64
+ - 2
65
+ - 1
66
+ version: "2.1"
67
+ type: :development
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: diff-lcs
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ type: :development
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake-compiler
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ~>
90
+ - !ruby/object:Gem::Version
91
+ hash: 1
92
+ segments:
93
+ - 0
94
+ - 7
95
+ - 1
96
+ version: 0.7.1
97
+ type: :development
98
+ version_requirements: *id005
99
+ description: Textile parser for Ruby.
24
100
  email: redcloth-upwards@rubyforge.org
25
101
  executables:
26
102
  - redcloth
27
103
  extensions:
28
104
  - ext/redcloth_scan/extconf.rb
29
105
  extra_rdoc_files:
30
- - CHANGELOG
31
- - lib/case_sensitive_require/RedCloth.rb
32
- - lib/redcloth/erb_extension.rb
33
- - lib/redcloth/formatters/base.rb
34
- - lib/redcloth/formatters/html.rb
35
- - lib/redcloth/formatters/latex.rb
36
- - lib/redcloth/textile_doc.rb
37
- - lib/redcloth/version.rb
38
- - lib/redcloth.rb
106
+ - COPYING
39
107
  - README
108
+ - CHANGELOG
40
109
  files:
41
- - bin/redcloth
110
+ - .bundle/config
111
+ - .gitignore
112
+ - .rspec
113
+ - .rvmrc
42
114
  - CHANGELOG
43
115
  - COPYING
44
- - ext/redcloth_scan/extconf.rb
45
- - ext/redcloth_scan/redcloth.h
116
+ - Gemfile
117
+ - Gemfile.lock
118
+ - Manifest
119
+ - README
120
+ - Rakefile
121
+ - bin/redcloth
122
+ - doc/textile_reference.html
46
123
  - lib/case_sensitive_require/RedCloth.rb
124
+ - lib/redcloth.rb
47
125
  - lib/redcloth/erb_extension.rb
48
126
  - lib/redcloth/formatters/base.rb
49
127
  - lib/redcloth/formatters/html.rb
@@ -51,14 +129,11 @@ files:
51
129
  - lib/redcloth/formatters/latex_entities.yml
52
130
  - lib/redcloth/textile_doc.rb
53
131
  - lib/redcloth/version.rb
54
- - lib/redcloth.rb
55
132
  - lib/tasks/pureruby.rake
56
- - Manifest
57
- - Rakefile
58
- - README
133
+ - redcloth.gemspec
59
134
  - setup.rb
135
+ - spec/benchmark_spec.rb
60
136
  - spec/custom_tags_spec.rb
61
- - spec/differs/inline.rb
62
137
  - spec/erb_spec.rb
63
138
  - spec/extension_spec.rb
64
139
  - spec/fixtures/basic.yml
@@ -88,51 +163,55 @@ files:
88
163
  - spec/formatters/sanitized_html_spec.rb
89
164
  - spec/formatters/style_filtered_html_spec.rb
90
165
  - spec/parser_spec.rb
91
- - spec/spec.opts
92
166
  - spec/spec_helper.rb
93
- - RedCloth.gemspec
167
+ - tasks/compile.rake
168
+ - tasks/gems.rake
169
+ - tasks/ragel_extension_task.rb
170
+ - tasks/release.rake
171
+ - tasks/rspec.rake
172
+ - tasks/rvm.rake
173
+ - test/ragel_profiler.rb
174
+ - test/validate_fixtures.rb
94
175
  - ext/redcloth_scan/redcloth_attributes.c
95
176
  - ext/redcloth_scan/redcloth_inline.c
96
177
  - ext/redcloth_scan/redcloth_scan.c
178
+ - ext/redcloth_scan/redcloth.h
179
+ - ext/redcloth_scan/extconf.rb
97
180
  has_rdoc: true
98
181
  homepage: http://redcloth.org
99
182
  licenses: []
100
183
 
101
184
  post_install_message:
102
185
  rdoc_options:
103
- - --line-numbers
104
- - --inline-source
105
- - --title
106
- - RedCloth
107
- - --main
108
- - README
186
+ - --charset=UTF-8
109
187
  require_paths:
110
188
  - lib
111
- - ext
112
- - lib/case_sensitive_require
113
189
  required_ruby_version: !ruby/object:Gem::Requirement
190
+ none: false
114
191
  requirements:
115
192
  - - ">="
116
193
  - !ruby/object:Gem::Version
194
+ hash: 3
117
195
  segments:
118
- - 1
119
- - 8
120
- - 4
121
- version: 1.8.4
196
+ - 0
197
+ version: "0"
122
198
  required_rubygems_version: !ruby/object:Gem::Requirement
199
+ none: false
123
200
  requirements:
124
- - - ">="
201
+ - - ">"
125
202
  - !ruby/object:Gem::Version
203
+ hash: 25
126
204
  segments:
127
205
  - 1
128
- - 2
129
- version: "1.2"
206
+ - 3
207
+ - 1
208
+ version: 1.3.1
130
209
  requirements: []
131
210
 
132
211
  rubyforge_project: redcloth
133
- rubygems_version: 1.3.6
212
+ rubygems_version: 1.3.7
134
213
  signing_key:
135
214
  specification_version: 3
136
- summary: RedCloth-4.2.3 - Textile parser for Ruby. http://redcloth.org/
215
+ summary: RedCloth-4.2.4.pre1
137
216
  test_files: []
138
217