fast_xs 0.7 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +11 -0
- data/GNUmakefile +28 -0
- data/History.txt +12 -0
- data/Manifest.txt +18 -0
- data/README.txt +72 -0
- data/Rakefile +13 -130
- data/ext/fast_xs/fast_xs.c +6 -2
- data/ext/fast_xs_extra/extconf.rb +1 -1
- data/ext/fast_xs_extra/fast_xs_extra.c +5 -2
- data/lib/fast_xs_monkey_patcher.rb +25 -18
- data/setup.rb +1585 -0
- data/test/test_cgi_class_overrides.rb +9 -1
- data/test/test_erb_util_module_overrides.rb +1 -1
- data/test/test_xml_escaping.rb +2 -2
- metadata +66 -34
- data/COPYING +0 -22
- data/README +0 -16
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'cgi'
|
3
|
-
|
3
|
+
require 'fast_xs_monkey_patcher'
|
4
4
|
|
5
5
|
class TestCgiClassOverrides < Test::Unit::TestCase
|
6
6
|
|
@@ -31,6 +31,14 @@ class TestCgiClassOverrides < Test::Unit::TestCase
|
|
31
31
|
assert_equal 'H3LL0+W0RLD', CGI::escape('H3LL0 W0RLD')
|
32
32
|
end
|
33
33
|
|
34
|
+
def test_escape_cgi_high
|
35
|
+
assert_equal '%C3%A8', CGI::escape('è')
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_unescape_cgi_high
|
39
|
+
assert_equal 'è', CGI::unescape('%C3%A8')
|
40
|
+
end
|
41
|
+
|
34
42
|
def test_unescape_cgi
|
35
43
|
assert_equal 'hello=world', CGI::unescape('hello%3Dworld')
|
36
44
|
assert_equal ' ', CGI::unescape('+')
|
data/test/test_xml_escaping.rb
CHANGED
@@ -39,8 +39,8 @@ class TestXmlEscaping < Test::Unit::TestCase
|
|
39
39
|
|
40
40
|
def test_large_document
|
41
41
|
if ENV['LARGE_STRING_TEST']
|
42
|
-
assert
|
43
|
-
assert
|
42
|
+
assert(('&' * (8192 * 1024)).fast_xs)
|
43
|
+
assert(('a' * (8192 * 1024)).fast_xs)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_xs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Wong
|
@@ -9,48 +9,78 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-30 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.3.2
|
24
|
+
version:
|
25
|
+
description: |-
|
26
|
+
fast_xs provides C extensions for escaping text.
|
27
|
+
|
28
|
+
The original String#fast_xs method is based on the xchar code by Sam Ruby:
|
29
|
+
|
30
|
+
* http://intertwingly.net/stories/2005/09/28/xchar.rb
|
31
|
+
* http://intertwingly.net/blog/2005/09/28/XML-Cleansing
|
32
|
+
|
33
|
+
_why also packages an older version with Hpricot (patches submitted).
|
34
|
+
The version here should be compatible with the latest version of Hpricot
|
35
|
+
code.
|
36
|
+
|
37
|
+
Ruby on Rails will automatically use String#fast_xs from either Hpricot
|
38
|
+
or this gem version with the bundled Builder package.
|
39
|
+
|
40
|
+
String#fast_xs is an almost exact translation of Sam Ruby's original
|
41
|
+
implementation (String#to_xs), but it does escape """ (which is an
|
42
|
+
optional, but all parsers are able ot handle it. XML::Builder as
|
43
|
+
packaged in Rails 2.0 will be automatically use String#fast_xs instead
|
44
|
+
of String#to_xs available.
|
45
|
+
email: fast-xs-general@rubyforge.org
|
18
46
|
executables: []
|
19
47
|
|
20
|
-
extensions:
|
21
|
-
|
22
|
-
- ext/fast_xs_extra/extconf.rb
|
48
|
+
extensions: []
|
49
|
+
|
23
50
|
extra_rdoc_files:
|
24
|
-
-
|
25
|
-
-
|
51
|
+
- History.txt
|
52
|
+
- Manifest.txt
|
53
|
+
- README.txt
|
26
54
|
files:
|
27
|
-
-
|
28
|
-
-
|
55
|
+
- .gitignore
|
56
|
+
- GNUmakefile
|
57
|
+
- History.txt
|
58
|
+
- Manifest.txt
|
59
|
+
- README.txt
|
29
60
|
- Rakefile
|
30
|
-
- test/test_cgi_class_overrides.rb
|
31
|
-
- test/test_xml_escaping.rb
|
32
|
-
- test/test_erb_util_module_overrides.rb
|
33
|
-
- lib/fast_xs_monkey_patcher.rb
|
34
|
-
- ext/fast_xs/fast_xs.c
|
35
|
-
- ext/fast_xs_extra/fast_xs_extra.c
|
36
61
|
- ext/fast_xs/extconf.rb
|
37
|
-
- ext/
|
62
|
+
- ext/fast_xs/fast_xs.c
|
63
|
+
- ext/fast_xs/fast_xs_type.h
|
38
64
|
- ext/fast_xs/gcc.h
|
39
65
|
- ext/fast_xs/ruby_1_9_compat.h
|
40
|
-
- ext/
|
66
|
+
- ext/fast_xs_extra/extconf.rb
|
67
|
+
- ext/fast_xs_extra/fast_xs_extra.c
|
68
|
+
- lib/fast_xs_monkey_patcher.rb
|
69
|
+
- setup.rb
|
70
|
+
- test/test_cgi_class_overrides.rb
|
71
|
+
- test/test_erb_util_module_overrides.rb
|
72
|
+
- test/test_xml_escaping.rb
|
41
73
|
has_rdoc: true
|
42
|
-
homepage: http://
|
74
|
+
homepage: http://fast-xs.rubyforge.org/
|
75
|
+
licenses: []
|
76
|
+
|
43
77
|
post_install_message:
|
44
78
|
rdoc_options:
|
45
|
-
- --quiet
|
46
|
-
- --title
|
47
|
-
- fast_xs notes
|
48
79
|
- --main
|
49
|
-
- README
|
50
|
-
- --inline-source
|
80
|
+
- README.txt
|
51
81
|
require_paths:
|
52
|
-
- lib/x86_64-linux
|
53
82
|
- lib
|
83
|
+
- ext
|
54
84
|
required_ruby_version: !ruby/object:Gem::Requirement
|
55
85
|
requirements:
|
56
86
|
- - ">="
|
@@ -65,10 +95,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
95
|
version:
|
66
96
|
requirements: []
|
67
97
|
|
68
|
-
rubyforge_project:
|
69
|
-
rubygems_version: 1.3.
|
98
|
+
rubyforge_project: fast-xs
|
99
|
+
rubygems_version: 1.3.4
|
70
100
|
signing_key:
|
71
|
-
specification_version:
|
72
|
-
summary:
|
73
|
-
test_files:
|
74
|
-
|
101
|
+
specification_version: 3
|
102
|
+
summary: fast_xs provides C extensions for escaping text
|
103
|
+
test_files:
|
104
|
+
- test/test_cgi_class_overrides.rb
|
105
|
+
- test/test_xml_escaping.rb
|
106
|
+
- test/test_erb_util_module_overrides.rb
|
data/COPYING
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2007 Eric Wong <normalperson@yhbt.net>
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person
|
4
|
-
obtaining a copy of this software and associated documentation
|
5
|
-
files (the "Software"), to deal in the Software without
|
6
|
-
restriction, including without limitation the rights to use,
|
7
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the
|
9
|
-
Software is furnished to do so, subject to the following
|
10
|
-
conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
data/README
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
= fast_xs, a fast C extension for cleaning XML
|
2
|
-
|
3
|
-
== Overview
|
4
|
-
|
5
|
-
The original fast_xs method is based on the xchar code by Sam Ruby:
|
6
|
-
|
7
|
-
http://intertwingly.net/stories/2005/09/28/xchar.rb
|
8
|
-
http://intertwingly.net/blog/2005/09/28/XML-Cleansing
|
9
|
-
|
10
|
-
_why also packages an older version with Hpricot (patch in progress).
|
11
|
-
It should be compatible with the latest version of this code.
|
12
|
-
|
13
|
-
This is an almost exact translation (to the best of my knowledge :) of
|
14
|
-
Sam's original implementation, but it does escape """.
|
15
|
-
XML::Builder as packaged in Rails 2.0 will be automatically use
|
16
|
-
fast_xs if available.
|