RedCloth 4.2.4-java

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.

Files changed (62) hide show
  1. data/.gemtest +0 -0
  2. data/.gitignore +26 -0
  3. data/.rspec +1 -0
  4. data/CHANGELOG +235 -0
  5. data/COPYING +18 -0
  6. data/Gemfile +7 -0
  7. data/README +198 -0
  8. data/Rakefile +16 -0
  9. data/bin/redcloth +28 -0
  10. data/doc/textile_reference.html +631 -0
  11. data/lib/case_sensitive_require/RedCloth.rb +6 -0
  12. data/lib/redcloth.rb +44 -0
  13. data/lib/redcloth/erb_extension.rb +27 -0
  14. data/lib/redcloth/formatters/base.rb +63 -0
  15. data/lib/redcloth/formatters/html.rb +345 -0
  16. data/lib/redcloth/formatters/latex.rb +322 -0
  17. data/lib/redcloth/formatters/latex_entities.yml +2414 -0
  18. data/lib/redcloth/textile_doc.rb +103 -0
  19. data/lib/redcloth/version.rb +34 -0
  20. data/lib/tasks/pureruby.rake +17 -0
  21. data/redcloth.gemspec +47 -0
  22. data/spec/benchmark_spec.rb +15 -0
  23. data/spec/custom_tags_spec.rb +50 -0
  24. data/spec/erb_spec.rb +10 -0
  25. data/spec/extension_spec.rb +26 -0
  26. data/spec/fixtures/basic.yml +1028 -0
  27. data/spec/fixtures/code.yml +257 -0
  28. data/spec/fixtures/definitions.yml +82 -0
  29. data/spec/fixtures/extra_whitespace.yml +64 -0
  30. data/spec/fixtures/filter_html.yml +177 -0
  31. data/spec/fixtures/filter_pba.yml +20 -0
  32. data/spec/fixtures/html.yml +348 -0
  33. data/spec/fixtures/images.yml +279 -0
  34. data/spec/fixtures/instiki.yml +38 -0
  35. data/spec/fixtures/links.yml +291 -0
  36. data/spec/fixtures/lists.yml +462 -0
  37. data/spec/fixtures/poignant.yml +89 -0
  38. data/spec/fixtures/sanitize_html.yml +42 -0
  39. data/spec/fixtures/table.yml +434 -0
  40. data/spec/fixtures/textism.yml +509 -0
  41. data/spec/fixtures/threshold.yml +762 -0
  42. data/spec/formatters/class_filtered_html_spec.rb +7 -0
  43. data/spec/formatters/filtered_html_spec.rb +7 -0
  44. data/spec/formatters/html_no_breaks_spec.rb +9 -0
  45. data/spec/formatters/html_spec.rb +13 -0
  46. data/spec/formatters/id_filtered_html_spec.rb +7 -0
  47. data/spec/formatters/latex_spec.rb +13 -0
  48. data/spec/formatters/lite_mode_html_spec.rb +7 -0
  49. data/spec/formatters/no_span_caps_html_spec.rb +7 -0
  50. data/spec/formatters/sanitized_html_spec.rb +7 -0
  51. data/spec/formatters/style_filtered_html_spec.rb +7 -0
  52. data/spec/parser_spec.rb +102 -0
  53. data/spec/spec_helper.rb +36 -0
  54. data/tasks/compile.rake +47 -0
  55. data/tasks/gems.rake +37 -0
  56. data/tasks/ragel_extension_task.rb +127 -0
  57. data/tasks/release.rake +15 -0
  58. data/tasks/rspec.rake +13 -0
  59. data/tasks/rvm.rake +78 -0
  60. data/test/ragel_profiler.rb +73 -0
  61. data/test/validate_fixtures.rb +74 -0
  62. metadata +166 -0
@@ -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('pkg') do
8
+ Dir['*.gem'].select {|g| g =~ /\w+-[^-]+-\w+.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,13 @@
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
12
+
13
+ RSpec::Core::RakeTask.new(:test) # for rubygems-test
@@ -0,0 +1,78 @@
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-2010.02']
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 "Runs specs under each rvm ruby"
17
+ task :spec => :setup do
18
+ puts rvm_rubies.join(',')
19
+ rvm_each_rubie do
20
+ # Make sure all dependencies are installed but ignore Gemfile.lock. It
21
+ # gets confused when locked to java and running ruby and vice-versa.
22
+ STDERR << RVM.run('bundle update').stderr
23
+
24
+ result = RVM.perform_set_operation(:rake)
25
+ STDERR << result.stderr
26
+ end
27
+ end
28
+
29
+ desc "Show rubies"
30
+ task :rubies => :setup do
31
+ puts rvm_rubies.join(",")
32
+ end
33
+
34
+ namespace :install do
35
+ task :rubies => :setup do
36
+ installed_rubies = RVM.list_strings
37
+ RVM_RUBIES.each do |rubie|
38
+ if installed_rubies.include?(rubie)
39
+ puts "info: Rubie #{rubie} already installed."
40
+ else
41
+ good_msg = "info: Rubie #{rubie} installed."
42
+ bad_msg = "Failed #{rubie} install! Check RVM logs here: #{RVM.path}/log/#{rubie}"
43
+ puts "info: Rubie #{rubie} installation inprogress. This could take awhile..."
44
+ if RVM.install(rubie,{})
45
+ puts(good_msg)
46
+ RVM.use(rubie)
47
+ RVM.perform_set_operation(:gem, 'install', 'bundler')
48
+ RVM.reset_current!
49
+ else
50
+ abort(bad_msg)
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+
57
+ task :remove => :setup do
58
+ rvm_rubies.each { |rubie| RVM.remove(rubie) }
59
+ end
60
+ end
61
+
62
+
63
+ # RVM Helper Methods
64
+
65
+ def rvm_each_rubie
66
+ rvm_rubies.each do |rubie|
67
+ RVM.use(rubie)
68
+ puts "Using #{rubie}"
69
+ yield
70
+ end
71
+ ensure
72
+ RVM.reset_current!
73
+ end
74
+
75
+ def rvm_rubies(options={})
76
+ RVM_RUBIES.map{ |rubie| "#{rubie}@#{RVM_GEMSET_NAME}" }
77
+ end
78
+
@@ -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 ADDED
@@ -0,0 +1,166 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: RedCloth
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 4
7
+ - 2
8
+ - 4
9
+ version: 4.2.4
10
+ platform: java
11
+ authors:
12
+ - Jason Garber
13
+ - why the lucky stiff
14
+ - Ola Bini
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2011-02-07 00:00:00 -06:00
20
+ default_executable: redcloth
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: rake
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 8
31
+ - 7
32
+ version: 0.8.7
33
+ requirement: *id001
34
+ prerelease: false
35
+ type: :development
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 2
44
+ - 4
45
+ version: "2.4"
46
+ requirement: *id002
47
+ prerelease: false
48
+ type: :development
49
+ - !ruby/object:Gem::Dependency
50
+ name: diff-lcs
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ requirement: *id003
59
+ prerelease: false
60
+ type: :development
61
+ description: Textile parser for Ruby.
62
+ email: redcloth-upwards@rubyforge.org
63
+ executables:
64
+ - redcloth
65
+ extensions: []
66
+
67
+ extra_rdoc_files:
68
+ - COPYING
69
+ - README
70
+ - CHANGELOG
71
+ files:
72
+ - .bundle/config
73
+ - .gemtest
74
+ - .gitignore
75
+ - .rspec
76
+ - CHANGELOG
77
+ - COPYING
78
+ - Gemfile
79
+ - README
80
+ - Rakefile
81
+ - bin/redcloth
82
+ - doc/textile_reference.html
83
+ - lib/case_sensitive_require/RedCloth.rb
84
+ - lib/redcloth.rb
85
+ - lib/redcloth/erb_extension.rb
86
+ - lib/redcloth/formatters/base.rb
87
+ - lib/redcloth/formatters/html.rb
88
+ - lib/redcloth/formatters/latex.rb
89
+ - lib/redcloth/formatters/latex_entities.yml
90
+ - lib/redcloth/textile_doc.rb
91
+ - lib/redcloth/version.rb
92
+ - lib/tasks/pureruby.rake
93
+ - redcloth.gemspec
94
+ - spec/benchmark_spec.rb
95
+ - spec/custom_tags_spec.rb
96
+ - spec/erb_spec.rb
97
+ - spec/extension_spec.rb
98
+ - spec/fixtures/basic.yml
99
+ - spec/fixtures/code.yml
100
+ - spec/fixtures/definitions.yml
101
+ - spec/fixtures/extra_whitespace.yml
102
+ - spec/fixtures/filter_html.yml
103
+ - spec/fixtures/filter_pba.yml
104
+ - spec/fixtures/html.yml
105
+ - spec/fixtures/images.yml
106
+ - spec/fixtures/instiki.yml
107
+ - spec/fixtures/links.yml
108
+ - spec/fixtures/lists.yml
109
+ - spec/fixtures/poignant.yml
110
+ - spec/fixtures/sanitize_html.yml
111
+ - spec/fixtures/table.yml
112
+ - spec/fixtures/textism.yml
113
+ - spec/fixtures/threshold.yml
114
+ - spec/formatters/class_filtered_html_spec.rb
115
+ - spec/formatters/filtered_html_spec.rb
116
+ - spec/formatters/html_no_breaks_spec.rb
117
+ - spec/formatters/html_spec.rb
118
+ - spec/formatters/id_filtered_html_spec.rb
119
+ - spec/formatters/latex_spec.rb
120
+ - spec/formatters/lite_mode_html_spec.rb
121
+ - spec/formatters/no_span_caps_html_spec.rb
122
+ - spec/formatters/sanitized_html_spec.rb
123
+ - spec/formatters/style_filtered_html_spec.rb
124
+ - spec/parser_spec.rb
125
+ - spec/spec_helper.rb
126
+ - tasks/compile.rake
127
+ - tasks/gems.rake
128
+ - tasks/ragel_extension_task.rb
129
+ - tasks/release.rake
130
+ - tasks/rspec.rake
131
+ - tasks/rvm.rake
132
+ - test/ragel_profiler.rb
133
+ - test/validate_fixtures.rb
134
+ - lib/redcloth_scan.jar
135
+ has_rdoc: true
136
+ homepage: http://redcloth.org
137
+ licenses: []
138
+
139
+ post_install_message:
140
+ rdoc_options:
141
+ - --charset=UTF-8
142
+ require_paths:
143
+ - lib
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ segments:
149
+ - 0
150
+ version: "0"
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ segments:
156
+ - 0
157
+ version: "0"
158
+ requirements: []
159
+
160
+ rubyforge_project: redcloth
161
+ rubygems_version: 1.3.6
162
+ signing_key:
163
+ specification_version: 3
164
+ summary: RedCloth-4.2.4
165
+ test_files: []
166
+