RedCloth 4.1.9 → 4.2.0

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 (70) hide show
  1. data/CHANGELOG +55 -0
  2. data/Manifest +34 -38
  3. data/README +17 -5
  4. data/Rakefile +79 -30
  5. data/RedCloth.gemspec +5 -6
  6. data/ext/redcloth_scan/redcloth.h +38 -13
  7. data/ext/redcloth_scan/redcloth_attributes.c +349 -383
  8. data/ext/redcloth_scan/redcloth_inline.c +4769 -16591
  9. data/ext/redcloth_scan/redcloth_scan.c +21592 -9540
  10. data/lib/redcloth.rb +9 -3
  11. data/lib/redcloth/formatters/html.rb +2 -2
  12. data/lib/redcloth/formatters/latex.rb +99 -54
  13. data/lib/redcloth/formatters/latex_entities.yml +2 -2
  14. data/lib/redcloth/version.rb +9 -4
  15. data/lib/tasks/pureruby.rake +12 -0
  16. data/spec/custom_tags_spec.rb +50 -0
  17. data/spec/differs/inline.rb +48 -0
  18. data/{test/test_erb.rb → spec/erb_spec.rb} +6 -9
  19. data/spec/extension_spec.rb +26 -0
  20. data/{test → spec/fixtures}/basic.yml +90 -4
  21. data/{test → spec/fixtures}/code.yml +29 -0
  22. data/{test → spec/fixtures}/definitions.yml +0 -0
  23. data/{test → spec/fixtures}/extra_whitespace.yml +0 -0
  24. data/{test → spec/fixtures}/filter_html.yml +0 -0
  25. data/{test → spec/fixtures}/filter_pba.yml +0 -0
  26. data/{test → spec/fixtures}/html.yml +15 -0
  27. data/{test → spec/fixtures}/images.yml +16 -6
  28. data/{test → spec/fixtures}/instiki.yml +0 -0
  29. data/{test → spec/fixtures}/links.yml +7 -1
  30. data/{test → spec/fixtures}/lists.yml +162 -1
  31. data/{test → spec/fixtures}/poignant.yml +0 -0
  32. data/{test → spec/fixtures}/sanitize_html.yml +0 -0
  33. data/{test → spec/fixtures}/table.yml +121 -23
  34. data/{test → spec/fixtures}/textism.yml +44 -15
  35. data/{test → spec/fixtures}/threshold.yml +6 -14
  36. data/spec/formatters/class_filtered_html_spec.rb +7 -0
  37. data/spec/formatters/filtered_html_spec.rb +7 -0
  38. data/spec/formatters/html_no_breaks_spec.rb +9 -0
  39. data/spec/formatters/html_spec.rb +13 -0
  40. data/spec/formatters/id_filtered_html_spec.rb +7 -0
  41. data/spec/formatters/latex_spec.rb +13 -0
  42. data/spec/formatters/lite_mode_html_spec.rb +7 -0
  43. data/spec/formatters/no_span_caps_html_spec.rb +7 -0
  44. data/spec/formatters/sanitized_html_spec.rb +7 -0
  45. data/spec/formatters/style_filtered_html_spec.rb +7 -0
  46. data/spec/parser_spec.rb +95 -0
  47. data/spec/spec.opts +3 -0
  48. data/spec/spec_helper.rb +42 -0
  49. metadata +40 -49
  50. data/ext/mingw-rbconfig.rb +0 -176
  51. data/ext/redcloth_scan/redcloth_attributes.c.rl +0 -55
  52. data/ext/redcloth_scan/redcloth_attributes.java.rl +0 -95
  53. data/ext/redcloth_scan/redcloth_attributes.rl +0 -33
  54. data/ext/redcloth_scan/redcloth_common.c.rl +0 -18
  55. data/ext/redcloth_scan/redcloth_common.java.rl +0 -18
  56. data/ext/redcloth_scan/redcloth_common.rl +0 -115
  57. data/ext/redcloth_scan/redcloth_inline.c.rl +0 -193
  58. data/ext/redcloth_scan/redcloth_inline.java.rl +0 -140
  59. data/ext/redcloth_scan/redcloth_inline.rl +0 -156
  60. data/ext/redcloth_scan/redcloth_scan.c.rl +0 -228
  61. data/ext/redcloth_scan/redcloth_scan.java.rl +0 -577
  62. data/ext/redcloth_scan/redcloth_scan.rl +0 -320
  63. data/extras/ragel_profiler.rb +0 -73
  64. data/test/helper.rb +0 -108
  65. data/test/test_custom_tags.rb +0 -58
  66. data/test/test_extensions.rb +0 -31
  67. data/test/test_formatters.rb +0 -24
  68. data/test/test_parser.rb +0 -73
  69. data/test/test_restrictions.rb +0 -41
  70. data/test/validate_fixtures.rb +0 -74
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe "style_filtered_html" do
4
+ examples_from_yaml do |doc|
5
+ RedCloth.new(doc['in'], [:filter_styles]).to_html
6
+ end
7
+ end
@@ -0,0 +1,95 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe RedCloth do
4
+
5
+ describe "#new" do
6
+ it "should accept options" do
7
+ lambda {
8
+ RedCloth.new("test", [:hard_breaks])
9
+ }.should_not raise_error(ArgumentError)
10
+ end
11
+ end
12
+
13
+ it "should have a VERSION" do
14
+ RedCloth.const_defined?("VERSION").should be_true
15
+ RedCloth::VERSION.const_defined?("STRING").should be_true
16
+ end
17
+
18
+ it "should show the version as a string" do
19
+ RedCloth::VERSION::STRING.should == RedCloth::VERSION.to_s
20
+ RedCloth::VERSION.should == RedCloth::VERSION::STRING
21
+ end
22
+
23
+ it "should have EXTENSION_LANGUAGE" do
24
+ RedCloth.const_defined?("EXTENSION_LANGUAGE").should be_true
25
+ RedCloth::EXTENSION_LANGUAGE.should_not be_empty
26
+ RedCloth::DESCRIPTION.should include(RedCloth::EXTENSION_LANGUAGE)
27
+ end
28
+
29
+ it "should not segfault on a badly formatted table" do
30
+ RedCloth.new(%Q{| one | two |\nthree | four |}).to_html.should =~ /td/
31
+ end
32
+
33
+ it "should not segfault on a table without a block end" do
34
+ RedCloth.new("| a | b |\n| c | d |\nh3. foo").to_html.should =~ /h3/
35
+ end
36
+
37
+ it "should not segfault on a table with empty cells" do
38
+ RedCloth.new(%Q{|one || |\nthree | four |}).to_html.should =~ /td/
39
+ end
40
+
41
+ it "should not segfault on an unfinished html block with filter_html" do
42
+ lambda { RedCloth.new(%Q{<hr> Some text}, [:filter_html]).to_html }.should_not raise_error
43
+ end
44
+
45
+ it "should parse RedCloth::VERSION in input" do
46
+ RedCloth.new("RedCloth::VERSION").to_html.should == "<p>#{RedCloth::VERSION::STRING}</p>"
47
+ end
48
+
49
+ it "should not parse RedCloth::VERSION if it's not on a line by itself" do
50
+ input = "RedCloth::VERSION won't output the RedCloth::VERSION unless it's on a line all by itself.\n\nRedCloth::VERSION"
51
+ html = "<p>RedCloth::<span class=\"caps\">VERSION</span> won&#8217;t output the RedCloth::<span class=\"caps\">VERSION</span> unless it&#8217;s on a line all by itself.</p>\n<p>#{RedCloth::VERSION::STRING}</p>"
52
+ RedCloth.new(input).to_html.should == html
53
+ end
54
+
55
+ it "should output the RedCloth::VERSION if it's labeled on a line by itself" do
56
+ input = "RedCloth::VERSION: RedCloth::VERSION"
57
+ html = "<p>RedCloth::VERSION: #{RedCloth::VERSION::STRING}</p>"
58
+ RedCloth.new(input).to_html.should == html
59
+ end
60
+
61
+ it "should output the RedCloth::VERSION if it's labeled in a sentence on a line by itself" do
62
+ input = "RedCloth version RedCloth::VERSION"
63
+ html = "<p>RedCloth version #{RedCloth::VERSION::STRING}</p>"
64
+ RedCloth.new(input).to_html.should == html
65
+ end
66
+
67
+ it "should output the RedCloth::VERSION in brackets" do
68
+ input = "The current RedCloth version is [RedCloth::VERSION]"
69
+ html = "<p>The current RedCloth version is #{RedCloth::VERSION::STRING}</p>"
70
+ RedCloth.new(input).to_html.should == html
71
+ end
72
+
73
+ it "should strip carriage returns" do
74
+ input = "This is a paragraph\r\n\r\nThis is a\r\nline break.\r\n\r\n<div>\r\ntest\r\n\r\n</div>"
75
+ html = "<p>This is a paragraph</p>\n<p>This is a<br />\nline break.</p>\n<div>\n<p>test</p>\n</div>"
76
+ RedCloth.new(input).to_html.should == html
77
+ end
78
+
79
+ if RUBY_VERSION > "1.9.0"
80
+ it "should preserve character encoding" do
81
+ input = "This is an ISO-8859-1 string"
82
+ input.force_encoding 'iso-8859-1'
83
+ output = RedCloth.new(input).to_html
84
+
85
+ output.should == "<p>This is an <span class=\"caps\">ISO</span>-8859-1 string</p>"
86
+ output.encoding.to_s.should == "ISO-8859-1"
87
+ end
88
+
89
+ it "should not raise ArgumentError: invalid byte sequence" do
90
+ s = "\xa3"
91
+ s.force_encoding 'iso-8859-1'
92
+ lambda { RedCloth.new(s).to_html }.should_not raise_error
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,3 @@
1
+ --color
2
+ --require=spec/differs/inline.rb
3
+ --diff=RedClothDiffers::Inline
@@ -0,0 +1,42 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
2
+ require 'redcloth'
3
+ require 'yaml'
4
+
5
+ class FormatterExampleGroup < Spec::Example::ExampleGroup
6
+
7
+ def self.examples_from_yaml(&block)
8
+ formatter = description.downcase
9
+ define_method("format_as_#{formatter}", &block)
10
+
11
+ fixtures.each do |name, doc|
12
+ if doc[formatter]
13
+ example("should output #{formatter} for #{name}") do
14
+ output = method("format_as_#{formatter}").call(doc)
15
+ output.should == doc[formatter]
16
+ end
17
+ else
18
+ example("should not raise errors when rendering #{formatter} for #{name}") do
19
+ lambda { method("format_as_#{formatter}").call(doc) }.should_not raise_error
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def self.fixtures
26
+ return @fixtures if @fixtures
27
+ @fixtures = {}
28
+ Dir[File.join(File.dirname(__FILE__), *%w[fixtures *.yml])].each do |testfile|
29
+ testgroup = File.basename(testfile, '.yml')
30
+ num = 0
31
+ YAML::load_documents(File.open(testfile)) do |doc|
32
+ name = doc['name'] || num
33
+ @fixtures["#{testgroup} #{name}"] = doc
34
+ num += 1
35
+ end
36
+ end
37
+ @fixtures
38
+ end
39
+
40
+ end
41
+
42
+ Spec::Example::ExampleGroupFactory.register(:formatter, FormatterExampleGroup)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RedCloth
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.9
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Garber
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-20 00:00:00 -05:00
12
+ date: 2009-06-10 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: RedCloth-4.1.9 - Textile parser for Ruby. http://redcloth.org/
16
+ description: RedCloth-4.2.0 - Textile parser for Ruby. http://redcloth.org/
17
17
  email: redcloth-upwards@rubyforge.org
18
18
  executables:
19
19
  - redcloth
@@ -34,22 +34,8 @@ files:
34
34
  - bin/redcloth
35
35
  - CHANGELOG
36
36
  - COPYING
37
- - ext/mingw-rbconfig.rb
38
37
  - ext/redcloth_scan/extconf.rb
39
38
  - ext/redcloth_scan/redcloth.h
40
- - ext/redcloth_scan/redcloth_attributes.c.rl
41
- - ext/redcloth_scan/redcloth_attributes.java.rl
42
- - ext/redcloth_scan/redcloth_attributes.rl
43
- - ext/redcloth_scan/redcloth_common.c.rl
44
- - ext/redcloth_scan/redcloth_common.java.rl
45
- - ext/redcloth_scan/redcloth_common.rl
46
- - ext/redcloth_scan/redcloth_inline.c.rl
47
- - ext/redcloth_scan/redcloth_inline.java.rl
48
- - ext/redcloth_scan/redcloth_inline.rl
49
- - ext/redcloth_scan/redcloth_scan.c.rl
50
- - ext/redcloth_scan/redcloth_scan.java.rl
51
- - ext/redcloth_scan/redcloth_scan.rl
52
- - extras/ragel_profiler.rb
53
39
  - lib/case_sensitive_require/RedCloth.rb
54
40
  - lib/redcloth/erb_extension.rb
55
41
  - lib/redcloth/formatters/base.rb
@@ -59,34 +45,44 @@ files:
59
45
  - lib/redcloth/textile_doc.rb
60
46
  - lib/redcloth/version.rb
61
47
  - lib/redcloth.rb
48
+ - lib/tasks/pureruby.rake
62
49
  - Manifest
63
50
  - Rakefile
64
51
  - README
65
52
  - setup.rb
66
- - test/basic.yml
67
- - test/code.yml
68
- - test/definitions.yml
69
- - test/extra_whitespace.yml
70
- - test/filter_html.yml
71
- - test/filter_pba.yml
72
- - test/helper.rb
73
- - test/html.yml
74
- - test/images.yml
75
- - test/instiki.yml
76
- - test/links.yml
77
- - test/lists.yml
78
- - test/poignant.yml
79
- - test/sanitize_html.yml
80
- - test/table.yml
81
- - test/test_custom_tags.rb
82
- - test/test_erb.rb
83
- - test/test_extensions.rb
84
- - test/test_formatters.rb
85
- - test/test_parser.rb
86
- - test/test_restrictions.rb
87
- - test/textism.yml
88
- - test/threshold.yml
89
- - test/validate_fixtures.rb
53
+ - spec/custom_tags_spec.rb
54
+ - spec/differs/inline.rb
55
+ - spec/erb_spec.rb
56
+ - spec/extension_spec.rb
57
+ - spec/fixtures/basic.yml
58
+ - spec/fixtures/code.yml
59
+ - spec/fixtures/definitions.yml
60
+ - spec/fixtures/extra_whitespace.yml
61
+ - spec/fixtures/filter_html.yml
62
+ - spec/fixtures/filter_pba.yml
63
+ - spec/fixtures/html.yml
64
+ - spec/fixtures/images.yml
65
+ - spec/fixtures/instiki.yml
66
+ - spec/fixtures/links.yml
67
+ - spec/fixtures/lists.yml
68
+ - spec/fixtures/poignant.yml
69
+ - spec/fixtures/sanitize_html.yml
70
+ - spec/fixtures/table.yml
71
+ - spec/fixtures/textism.yml
72
+ - spec/fixtures/threshold.yml
73
+ - spec/formatters/class_filtered_html_spec.rb
74
+ - spec/formatters/filtered_html_spec.rb
75
+ - spec/formatters/html_no_breaks_spec.rb
76
+ - spec/formatters/html_spec.rb
77
+ - spec/formatters/id_filtered_html_spec.rb
78
+ - spec/formatters/latex_spec.rb
79
+ - spec/formatters/lite_mode_html_spec.rb
80
+ - spec/formatters/no_span_caps_html_spec.rb
81
+ - spec/formatters/sanitized_html_spec.rb
82
+ - spec/formatters/style_filtered_html_spec.rb
83
+ - spec/parser_spec.rb
84
+ - spec/spec.opts
85
+ - spec/spec_helper.rb
90
86
  - RedCloth.gemspec
91
87
  - ext/redcloth_scan/redcloth_attributes.c
92
88
  - ext/redcloth_scan/redcloth_inline.c
@@ -123,11 +119,6 @@ rubyforge_project: redcloth
123
119
  rubygems_version: 1.3.1
124
120
  signing_key:
125
121
  specification_version: 2
126
- summary: RedCloth-4.1.9 - Textile parser for Ruby. http://redcloth.org/
127
- test_files:
128
- - test/test_custom_tags.rb
129
- - test/test_erb.rb
130
- - test/test_extensions.rb
131
- - test/test_formatters.rb
132
- - test/test_parser.rb
133
- - test/test_restrictions.rb
122
+ summary: RedCloth-4.2.0 - Textile parser for Ruby. http://redcloth.org/
123
+ test_files: []
124
+
@@ -1,176 +0,0 @@
1
-
2
- # This rbconfig.rb corresponds to a Ruby installation for win32 cross-compiled
3
- # with mingw under i686-linux. It can be used to cross-compile extensions for
4
- # win32 using said toolchain.
5
- #
6
- # This file assumes that a cross-compiled mingw32 build (compatible with the
7
- # mswin32 builds) is installed under $HOME/ruby-mingw32.
8
-
9
- module Config
10
- #RUBY_VERSION == "1.8.5" or
11
- # raise "ruby lib version (1.8.5) doesn't match executable version (#{RUBY_VERSION})"
12
-
13
- mingw32 = ENV['MINGW32_RUBY'] || "#{ENV["HOME"]}/ruby-mingw32"
14
- mingwpre = ENV['MINGW32_PREFIX']
15
- TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/1.8/i386-mingw32")
16
- DESTDIR = '' unless defined? DESTDIR
17
- CONFIG = {}
18
- CONFIG["DESTDIR"] = DESTDIR
19
- CONFIG["INSTALL"] = "/usr/bin/install -c"
20
- CONFIG["prefix"] = (TOPDIR || DESTDIR + mingw32)
21
- CONFIG["EXEEXT"] = ".exe"
22
- CONFIG["ruby_install_name"] = "ruby"
23
- CONFIG["RUBY_INSTALL_NAME"] = "ruby"
24
- CONFIG["RUBY_SO_NAME"] = "msvcrt-ruby18"
25
- CONFIG["SHELL"] = "/bin/sh"
26
- CONFIG["PATH_SEPARATOR"] = ":"
27
- CONFIG["PACKAGE_NAME"] = ""
28
- CONFIG["PACKAGE_TARNAME"] = ""
29
- CONFIG["PACKAGE_VERSION"] = ""
30
- CONFIG["PACKAGE_STRING"] = ""
31
- CONFIG["PACKAGE_BUGREPORT"] = ""
32
- CONFIG["exec_prefix"] = "$(prefix)"
33
- CONFIG["bindir"] = "$(exec_prefix)/bin"
34
- CONFIG["sbindir"] = "$(exec_prefix)/sbin"
35
- CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
36
- CONFIG["datadir"] = "$(prefix)/share"
37
- CONFIG["sysconfdir"] = "$(prefix)/etc"
38
- CONFIG["sharedstatedir"] = "$(prefix)/com"
39
- CONFIG["localstatedir"] = "$(prefix)/var"
40
- CONFIG["libdir"] = "$(exec_prefix)/lib"
41
- CONFIG["includedir"] = "$(prefix)/include"
42
- CONFIG["oldincludedir"] = "/usr/include"
43
- CONFIG["infodir"] = "$(prefix)/info"
44
- CONFIG["mandir"] = "$(prefix)/man"
45
- CONFIG["build_alias"] = "i686-linux"
46
- CONFIG["host_alias"] = "#{mingwpre}"
47
- CONFIG["target_alias"] = "i386-mingw32"
48
- CONFIG["ECHO_C"] = ""
49
- CONFIG["ECHO_N"] = "-n"
50
- CONFIG["ECHO_T"] = ""
51
- CONFIG["LIBS"] = "-lwsock32 "
52
- CONFIG["MAJOR"] = "1"
53
- CONFIG["MINOR"] = "8"
54
- CONFIG["TEENY"] = "4"
55
- CONFIG["build"] = "i686-pc-linux"
56
- CONFIG["build_cpu"] = "i686"
57
- CONFIG["build_vendor"] = "pc"
58
- CONFIG["build_os"] = "linux"
59
- CONFIG["host"] = "i586-pc-mingw32msvc"
60
- CONFIG["host_cpu"] = "i586"
61
- CONFIG["host_vendor"] = "pc"
62
- CONFIG["host_os"] = "mingw32msvc"
63
- CONFIG["target"] = "i386-pc-mingw32"
64
- CONFIG["target_cpu"] = "i386"
65
- CONFIG["target_vendor"] = "pc"
66
- CONFIG["target_os"] = "mingw32"
67
- CONFIG["CC"] = "#{mingwpre}-gcc"
68
- CONFIG["CFLAGS"] = "-g "
69
- CONFIG["LDFLAGS"] = ""
70
- CONFIG["CPPFLAGS"] = ""
71
- CONFIG["OBJEXT"] = "o"
72
- CONFIG["CPP"] = "#{mingwpre}-gcc -E"
73
- CONFIG["EGREP"] = "grep -E"
74
- CONFIG["GNU_LD"] = "yes"
75
- CONFIG["CPPOUTFILE"] = "-o conftest.i"
76
- CONFIG["OUTFLAG"] = "-o "
77
- CONFIG["YACC"] = "bison -y"
78
- CONFIG["RANLIB"] = "#{mingwpre}-ranlib"
79
- CONFIG["AR"] = "#{mingwpre}-ar"
80
- CONFIG["NM"] = "#{mingwpre}-nm"
81
- CONFIG["WINDRES"] = "#{mingwpre}-windres"
82
- CONFIG["DLLWRAP"] = "#{mingwpre}-dllwrap"
83
- CONFIG["OBJDUMP"] = "#{mingwpre}-objdump"
84
- CONFIG["LN_S"] = "ln -s"
85
- CONFIG["SET_MAKE"] = ""
86
- CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
87
- CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
88
- CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
89
- CONFIG["RM"] = "rm -f"
90
- CONFIG["CP"] = "cp"
91
- CONFIG["MAKEDIRS"] = "mkdir -p"
92
- CONFIG["LIBOBJS"] = " fileblocks$(U).o crypt$(U).o flock$(U).o acosh$(U).o win32$(U).o"
93
- CONFIG["ALLOCA"] = ""
94
- CONFIG["DLDFLAGS"] = " -Wl,--enable-auto-import,--export-all"
95
- CONFIG["ARCH_FLAG"] = ""
96
- CONFIG["STATIC"] = ""
97
- CONFIG["CCDLFLAGS"] = ""
98
- CONFIG["LDSHARED"] = "#{mingwpre}-gcc -shared -s"
99
- CONFIG["DLEXT"] = "so"
100
- CONFIG["DLEXT2"] = "dll"
101
- CONFIG["LIBEXT"] = "a"
102
- CONFIG["LINK_SO"] = ""
103
- CONFIG["LIBPATHFLAG"] = " -L\"%s\""
104
- CONFIG["RPATHFLAG"] = ""
105
- CONFIG["LIBPATHENV"] = ""
106
- CONFIG["TRY_LINK"] = ""
107
- CONFIG["STRIP"] = "strip"
108
- CONFIG["EXTSTATIC"] = ""
109
- CONFIG["setup"] = "Setup"
110
- CONFIG["MINIRUBY"] = "ruby -rfake"
111
- CONFIG["PREP"] = "fake.rb"
112
- CONFIG["RUNRUBY"] = "$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`"
113
- CONFIG["EXTOUT"] = ".ext"
114
- CONFIG["ARCHFILE"] = ""
115
- CONFIG["RDOCTARGET"] = ""
116
- CONFIG["XCFLAGS"] = " -DRUBY_EXPORT"
117
- CONFIG["XLDFLAGS"] = " -Wl,--stack,0x02000000 -L."
118
- CONFIG["LIBRUBY_LDSHARED"] = "#{mingwpre}-gcc -shared -s"
119
- CONFIG["LIBRUBY_DLDFLAGS"] = " -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBRUBY)"
120
- CONFIG["rubyw_install_name"] = "rubyw"
121
- CONFIG["RUBYW_INSTALL_NAME"] = "rubyw"
122
- CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
123
- CONFIG["LIBRUBY_SO"] = "$(RUBY_SO_NAME).dll"
124
- CONFIG["LIBRUBY_ALIASES"] = ""
125
- CONFIG["LIBRUBY"] = "lib$(LIBRUBY_SO).a"
126
- CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
127
- CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static"
128
- CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME)"
129
- CONFIG["SOLIBS"] = "$(LIBS)"
130
- CONFIG["DLDLIBS"] = ""
131
- CONFIG["ENABLE_SHARED"] = "yes"
132
- CONFIG["MAINLIBS"] = ""
133
- CONFIG["COMMON_LIBS"] = "m"
134
- CONFIG["COMMON_MACROS"] = ""
135
- CONFIG["COMMON_HEADERS"] = "windows.h winsock.h"
136
- CONFIG["EXPORT_PREFIX"] = ""
137
- CONFIG["MINIOBJS"] = "dmydln.o"
138
- CONFIG["MAKEFILES"] = "Makefile GNUmakefile"
139
- CONFIG["arch"] = "i386-mingw32"
140
- CONFIG["sitearch"] = "i386-msvcrt"
141
- CONFIG["sitedir"] = "$(prefix)/lib/ruby/site_ruby"
142
- CONFIG["configure_args"] = "'--host=#{mingwpre}' '--target=i386-mingw32' '--build=i686-linux' '--prefix=#{mingw32}' 'build_alias=i686-linux' 'host_alias=#{mingwpre}' 'target_alias=i386-mingw32'"
143
- CONFIG["NROFF"] = "/usr/bin/nroff"
144
- CONFIG["MANTYPE"] = "doc"
145
- CONFIG["LTLIBOBJS"] = " fileblocks$(U).lo crypt$(U).lo flock$(U).lo acosh$(U).lo win32$(U).lo"
146
- CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
147
- CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
148
- CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
149
- CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
150
- CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
151
- CONFIG["topdir"] = File.dirname(__FILE__)
152
- MAKEFILE_CONFIG = {}
153
- CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
154
- def Config::expand(val, config = CONFIG)
155
- val.gsub!(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) do |var|
156
- if !(v = $1 || $2)
157
- '$'
158
- elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
159
- pat, sub = $1, $2
160
- config[v] = false
161
- Config::expand(key, config)
162
- config[v] = key
163
- key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
164
- key
165
- else
166
- var
167
- end
168
- end
169
- val
170
- end
171
- CONFIG.each_value do |val|
172
- Config::expand(val)
173
- end
174
- end
175
- RbConfig = Config # compatibility for ruby-1.9
176
- CROSS_COMPILING = nil unless defined? CROSS_COMPILING