htmlentitties 4.2.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/COPYING.txt +21 -0
- data/History.txt +66 -0
- data/README.rdoc +44 -0
- data/lib/htmlentities.rb +76 -0
- data/lib/htmlentities/decoder.rb +29 -0
- data/lib/htmlentities/encoder.rb +107 -0
- data/lib/htmlentities/flavors.rb +9 -0
- data/lib/htmlentities/legacy.rb +31 -0
- data/lib/htmlentities/mappings/expanded.rb +1050 -0
- data/lib/htmlentities/mappings/html4.rb +257 -0
- data/lib/htmlentities/mappings/xhtml1.rb +258 -0
- data/lib/htmlentities/version.rb +9 -0
- data/perf/benchmark.rb +13 -0
- data/perf/performance.rb +31 -0
- data/perf/profile.rb +17 -0
- data/setup.rb +1596 -0
- data/test/entities_test.rb +219 -0
- data/test/expanded_test.rb +112 -0
- data/test/html4_test.rb +29 -0
- data/test/legacy_test.rb +35 -0
- data/test/roundtrip_test.rb +93 -0
- data/test/test_all.rb +4 -0
- data/test/xhtml1_test.rb +29 -0
- metadata +91 -0
data/test/test_all.rb
ADDED
data/test/xhtml1_test.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
|
3
|
+
require 'test/unit'
|
|
4
|
+
require 'htmlentities'
|
|
5
|
+
|
|
6
|
+
$KCODE = 'u' unless "1.9".respond_to?(:encoding)
|
|
7
|
+
|
|
8
|
+
class HTMLEntities::XHTML1Test < Test::Unit::TestCase
|
|
9
|
+
|
|
10
|
+
attr_reader :html_entities
|
|
11
|
+
|
|
12
|
+
def setup
|
|
13
|
+
@html_entities = HTMLEntities.new('xhtml1')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def test_should_encode_apos_entity
|
|
17
|
+
assert_equal "'", html_entities.encode("'", :basic)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_should_decode_apos_entity
|
|
21
|
+
assert_equal "é'", html_entities.decode("é'")
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def test_should_not_decode_dotted_entity
|
|
25
|
+
assert_equal "&b.Theta;", html_entities.decode("&b.Theta;")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: htmlentitties
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 53
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 4
|
|
8
|
+
- 2
|
|
9
|
+
- 1
|
|
10
|
+
version: 4.2.1
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- Paul Battley
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2010-06-02 00:00:00 -07:00
|
|
19
|
+
default_executable:
|
|
20
|
+
dependencies: []
|
|
21
|
+
|
|
22
|
+
description:
|
|
23
|
+
email: pbattley@gmail.com
|
|
24
|
+
executables: []
|
|
25
|
+
|
|
26
|
+
extensions: []
|
|
27
|
+
|
|
28
|
+
extra_rdoc_files:
|
|
29
|
+
- README.rdoc
|
|
30
|
+
- History.txt
|
|
31
|
+
- COPYING.txt
|
|
32
|
+
files:
|
|
33
|
+
- lib/htmlentities/decoder.rb
|
|
34
|
+
- lib/htmlentities/encoder.rb
|
|
35
|
+
- lib/htmlentities/flavors.rb
|
|
36
|
+
- lib/htmlentities/legacy.rb
|
|
37
|
+
- lib/htmlentities/mappings/expanded.rb
|
|
38
|
+
- lib/htmlentities/mappings/html4.rb
|
|
39
|
+
- lib/htmlentities/mappings/xhtml1.rb
|
|
40
|
+
- lib/htmlentities/version.rb
|
|
41
|
+
- lib/htmlentities.rb
|
|
42
|
+
- test/entities_test.rb
|
|
43
|
+
- test/expanded_test.rb
|
|
44
|
+
- test/html4_test.rb
|
|
45
|
+
- test/legacy_test.rb
|
|
46
|
+
- test/roundtrip_test.rb
|
|
47
|
+
- test/test_all.rb
|
|
48
|
+
- test/xhtml1_test.rb
|
|
49
|
+
- perf/benchmark.rb
|
|
50
|
+
- perf/performance.rb
|
|
51
|
+
- perf/profile.rb
|
|
52
|
+
- setup.rb
|
|
53
|
+
- README.rdoc
|
|
54
|
+
- History.txt
|
|
55
|
+
- COPYING.txt
|
|
56
|
+
has_rdoc: true
|
|
57
|
+
homepage: http://htmlentities.rubyforge.org/
|
|
58
|
+
licenses: []
|
|
59
|
+
|
|
60
|
+
post_install_message:
|
|
61
|
+
rdoc_options: []
|
|
62
|
+
|
|
63
|
+
require_paths:
|
|
64
|
+
- lib
|
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
|
+
none: false
|
|
67
|
+
requirements:
|
|
68
|
+
- - ">="
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
hash: 3
|
|
71
|
+
segments:
|
|
72
|
+
- 0
|
|
73
|
+
version: "0"
|
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
|
+
none: false
|
|
76
|
+
requirements:
|
|
77
|
+
- - ">="
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
hash: 3
|
|
80
|
+
segments:
|
|
81
|
+
- 0
|
|
82
|
+
version: "0"
|
|
83
|
+
requirements: []
|
|
84
|
+
|
|
85
|
+
rubyforge_project:
|
|
86
|
+
rubygems_version: 1.3.7
|
|
87
|
+
signing_key:
|
|
88
|
+
specification_version: 3
|
|
89
|
+
summary: A module for encoding and decoding (X)HTML entities.
|
|
90
|
+
test_files:
|
|
91
|
+
- test/test_all.rb
|