unf_ext 0.0.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,41 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+ require 'pathname'
4
+
5
+ class TestUnf < Test::Unit::TestCase
6
+ should "raise ArgumentError if an unknown normalization form is given" do
7
+ normalizer = UNF::Normalizer.new
8
+ assert_raises(ArgumentError) { normalizer.normalize("が", :nfck) }
9
+ end
10
+
11
+ should "pass all tests bundled with the original unf" do
12
+ normalizer = UNF::Normalizer.new
13
+ open(Pathname(__FILE__).dirname + 'normalization-test.txt', 'r:utf-8').each_slice(6) { |lines|
14
+ flunk "broken test file" if lines.size != 6 || lines.pop !~ /^$/
15
+ str, nfd, nfc, nfkd, nfkc = lines
16
+ assert nfd, normalizer.normalize(str, :nfd)
17
+ assert nfd, normalizer.normalize(nfd, :nfd)
18
+ assert nfd, normalizer.normalize(nfc, :nfd)
19
+ assert nfkd, normalizer.normalize(nfkc, :nfd)
20
+ assert nfkd, normalizer.normalize(nfkc, :nfd)
21
+
22
+ assert nfc, normalizer.normalize(str, :nfd)
23
+ assert nfc, normalizer.normalize(nfd, :nfc)
24
+ assert nfc, normalizer.normalize(nfc, :nfc)
25
+ assert nfkc, normalizer.normalize(nfkc, :nfc)
26
+ assert nfkc, normalizer.normalize(nfkd, :nfc)
27
+
28
+ assert nfkd, normalizer.normalize(str, :nfkd)
29
+ assert nfkd, normalizer.normalize(nfd, :nfkd)
30
+ assert nfkd, normalizer.normalize(nfc, :nfkd)
31
+ assert nfkd, normalizer.normalize(nfkc, :nfkd)
32
+ assert nfkd, normalizer.normalize(nfkd, :nfkd)
33
+
34
+ assert nfkc, normalizer.normalize(str, :nfkc)
35
+ assert nfkc, normalizer.normalize(nfd, :nfkc)
36
+ assert nfkc, normalizer.normalize(nfc, :nfkc)
37
+ assert nfkc, normalizer.normalize(nfkc, :nfkc)
38
+ assert nfkc, normalizer.normalize(nfkd, :nfkc)
39
+ }
40
+ end
41
+ end
@@ -0,0 +1,71 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{unf_ext}
8
+ s.version = "0.0.4"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{Takeru Ohta}, %q{Akinori MUSHA}]
12
+ s.date = %q{2011-12-08}
13
+ s.description = %q{Unicode Normalization Form support library for CRuby}
14
+ s.email = %q{knu@idaemons.org}
15
+ s.extensions = [%q{ext/unf_ext/extconf.rb}]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "LICENSE.txt",
24
+ "README.md",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "ext/unf_ext/extconf.rb",
28
+ "ext/unf_ext/unf.cc",
29
+ "ext/unf_ext/unf/normalizer.hh",
30
+ "ext/unf_ext/unf/table.hh",
31
+ "ext/unf_ext/unf/trie/char_stream.hh",
32
+ "ext/unf_ext/unf/trie/node.hh",
33
+ "ext/unf_ext/unf/trie/searcher.hh",
34
+ "ext/unf_ext/unf/util.hh",
35
+ "lib/unf_ext.rb",
36
+ "test/helper.rb",
37
+ "test/normalization-test.txt",
38
+ "test/test_unf_ext.rb",
39
+ "unf_ext.gemspec"
40
+ ]
41
+ s.homepage = %q{http://github.com/knu/ruby-unf_ext}
42
+ s.licenses = [%q{MIT}]
43
+ s.require_paths = [%q{lib}]
44
+ s.rubygems_version = %q{1.8.5}
45
+ s.summary = %q{Unicode Normalization Form support library for CRuby}
46
+
47
+ if s.respond_to? :specification_version then
48
+ s.specification_version = 3
49
+
50
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
52
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
53
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
54
+ s.add_development_dependency(%q<rcov>, [">= 0"])
55
+ s.add_development_dependency(%q<rake-compiler>, [">= 0.7.9"])
56
+ else
57
+ s.add_dependency(%q<shoulda>, [">= 0"])
58
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
59
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
60
+ s.add_dependency(%q<rcov>, [">= 0"])
61
+ s.add_dependency(%q<rake-compiler>, [">= 0.7.9"])
62
+ end
63
+ else
64
+ s.add_dependency(%q<shoulda>, [">= 0"])
65
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
66
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
67
+ s.add_dependency(%q<rcov>, [">= 0"])
68
+ s.add_dependency(%q<rake-compiler>, [">= 0.7.9"])
69
+ end
70
+ end
71
+
metadata ADDED
@@ -0,0 +1,162 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unf_ext
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 4
10
+ version: 0.0.4
11
+ platform: x86-mingw32
12
+ authors:
13
+ - Takeru Ohta
14
+ - Akinori MUSHA
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2011-12-08 00:00:00 Z
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: shoulda
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :development
33
+ requirement: *id001
34
+ prerelease: false
35
+ - !ruby/object:Gem::Dependency
36
+ name: bundler
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ hash: 23
43
+ segments:
44
+ - 1
45
+ - 0
46
+ - 0
47
+ version: 1.0.0
48
+ type: :development
49
+ requirement: *id002
50
+ prerelease: false
51
+ - !ruby/object:Gem::Dependency
52
+ name: jeweler
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ hash: 7
59
+ segments:
60
+ - 1
61
+ - 6
62
+ - 4
63
+ version: 1.6.4
64
+ type: :development
65
+ requirement: *id003
66
+ prerelease: false
67
+ - !ruby/object:Gem::Dependency
68
+ name: rcov
69
+ version_requirements: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ type: :development
79
+ requirement: *id004
80
+ prerelease: false
81
+ - !ruby/object:Gem::Dependency
82
+ name: rake-compiler
83
+ version_requirements: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 17
89
+ segments:
90
+ - 0
91
+ - 7
92
+ - 9
93
+ version: 0.7.9
94
+ type: :development
95
+ requirement: *id005
96
+ prerelease: false
97
+ description: Unicode Normalization Form support library for CRuby
98
+ email: knu@idaemons.org
99
+ executables: []
100
+
101
+ extensions: []
102
+
103
+ extra_rdoc_files:
104
+ - LICENSE.txt
105
+ - README.md
106
+ files:
107
+ - .document
108
+ - Gemfile
109
+ - LICENSE.txt
110
+ - README.md
111
+ - Rakefile
112
+ - VERSION
113
+ - ext/unf_ext/extconf.rb
114
+ - ext/unf_ext/unf.cc
115
+ - ext/unf_ext/unf/normalizer.hh
116
+ - ext/unf_ext/unf/table.hh
117
+ - ext/unf_ext/unf/trie/char_stream.hh
118
+ - ext/unf_ext/unf/trie/node.hh
119
+ - ext/unf_ext/unf/trie/searcher.hh
120
+ - ext/unf_ext/unf/util.hh
121
+ - lib/unf_ext.rb
122
+ - test/helper.rb
123
+ - test/normalization-test.txt
124
+ - test/test_unf_ext.rb
125
+ - unf_ext.gemspec
126
+ - lib/1.8/unf_ext.so
127
+ - lib/1.9/unf_ext.so
128
+ homepage: http://github.com/knu/ruby-unf_ext
129
+ licenses:
130
+ - MIT
131
+ post_install_message:
132
+ rdoc_options: []
133
+
134
+ require_paths:
135
+ - lib
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
153
+ version: "0"
154
+ requirements: []
155
+
156
+ rubyforge_project:
157
+ rubygems_version: 1.8.5
158
+ signing_key:
159
+ specification_version: 3
160
+ summary: Unicode Normalization Form support library for CRuby
161
+ test_files: []
162
+