unf 0.0.5-jruby → 0.1.1-jruby
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +17 -0
- data/Rakefile +19 -0
- data/lib/unf.rb +12 -0
- data/lib/unf/normalizer.rb +19 -0
- data/lib/unf/normalizer_jruby.rb +1 -1
- data/lib/unf/version.rb +1 -1
- data/unf.gemspec +7 -6
- metadata +119 -99
data/.travis.yml
ADDED
data/Rakefile
CHANGED
@@ -1,2 +1,21 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
gemspec = Bundler::GemHelper.gemspec
|
5
|
+
|
6
|
+
require 'rake/testtask'
|
7
|
+
Rake::TestTask.new(:test) do |test|
|
8
|
+
test.libs << 'test'
|
9
|
+
test.test_files = gemspec.test_files
|
10
|
+
test.verbose = true
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'rdoc/task'
|
14
|
+
Rake::RDocTask.new do |rdoc|
|
15
|
+
rdoc.rdoc_dir = 'rdoc'
|
16
|
+
rdoc.title = "#{gemspec.name} #{gemspec.version}"
|
17
|
+
rdoc.rdoc_files.include(gemspec.extra_rdoc_files)
|
18
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
19
|
+
end
|
20
|
+
|
21
|
+
task :default => :test
|
data/lib/unf.rb
CHANGED
@@ -12,6 +12,18 @@ class String
|
|
12
12
|
'/[^\x00-\x7f]/ !~ self'
|
13
13
|
end
|
14
14
|
|
15
|
+
# :method: to_nfc
|
16
|
+
# Converts the string to NFC.
|
17
|
+
|
18
|
+
# :method: to_nfd
|
19
|
+
# Converts the string to NFD.
|
20
|
+
|
21
|
+
# :method: to_nfkc
|
22
|
+
# Converts the string to NFKC.
|
23
|
+
|
24
|
+
# :method: to_nfkd
|
25
|
+
# Converts the string to NFKD.
|
26
|
+
|
15
27
|
[:nfc, :nfd, :nfkc, :nfkd].each { |form|
|
16
28
|
eval %{
|
17
29
|
def to_#{form.to_s}
|
data/lib/unf/normalizer.rb
CHANGED
@@ -4,14 +4,33 @@ else
|
|
4
4
|
require 'unf/normalizer_cruby'
|
5
5
|
end
|
6
6
|
|
7
|
+
# UTF-8 string normalizer class. Implementations may vary depending
|
8
|
+
# on the platform.
|
7
9
|
class UNF::Normalizer
|
8
10
|
class << self
|
11
|
+
# :singleton-method: new
|
12
|
+
# :call-seq:
|
13
|
+
# new
|
14
|
+
# instance
|
15
|
+
#
|
16
|
+
# Returns a normalizer instance.
|
17
|
+
|
18
|
+
# :stopdoc:
|
9
19
|
def instance
|
10
20
|
@@normalizer ||= new
|
11
21
|
end
|
22
|
+
# :startdoc:
|
12
23
|
|
24
|
+
# A shortcut for new.normalize(string, form).
|
13
25
|
def normalize(string, form)
|
14
26
|
instance.normalize(string, form)
|
15
27
|
end
|
16
28
|
end
|
29
|
+
|
30
|
+
# :method: normalize
|
31
|
+
# :call-seq:
|
32
|
+
# normalize(string, form)
|
33
|
+
#
|
34
|
+
# Normalizes a UTF-8 string into a given form (:nfc, :nfd, :nfkc or
|
35
|
+
# :nfkd).
|
17
36
|
end
|
data/lib/unf/normalizer_jruby.rb
CHANGED
data/lib/unf/version.rb
CHANGED
data/unf.gemspec
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
require File.expand_path('../lib/unf/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "unf"
|
6
|
+
gem.version = UNF::VERSION
|
5
7
|
gem.authors = ["Akinori MUSHA"]
|
6
8
|
gem.email = ["knu@idaemons.org"]
|
7
9
|
gem.description = <<-'EOS'
|
@@ -14,15 +16,14 @@ to Ruby/JRuby.
|
|
14
16
|
|
15
17
|
gem.files = `git ls-files`.split("\n")
|
16
18
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)
|
18
|
-
gem.name = "unf"
|
19
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/.*\.rb})
|
19
20
|
gem.require_paths = ["lib"]
|
20
|
-
gem.
|
21
|
+
gem.extra_rdoc_files = ['README.md', 'LICENSE']
|
21
22
|
|
22
23
|
gem.add_dependency 'unf_ext', '>= 0' unless defined?(JRUBY_VERSION)
|
23
24
|
|
24
25
|
gem.add_development_dependency 'shoulda', '>= 0'
|
25
|
-
gem.add_development_dependency 'bundler', '
|
26
|
-
gem.add_development_dependency '
|
27
|
-
gem.add_development_dependency '
|
26
|
+
gem.add_development_dependency 'bundler', '>= 1.2.0'
|
27
|
+
gem.add_development_dependency 'rake', '>= 0.9.2.2'
|
28
|
+
gem.add_development_dependency 'rdoc', '> 2.4.2'
|
28
29
|
end
|
metadata
CHANGED
@@ -1,116 +1,136 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: unf
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
6
6
|
platform: jruby
|
7
|
-
authors:
|
8
|
-
|
9
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Akinori MUSHA
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
12
|
+
date: 2013-03-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: shoulda
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: !binary |-
|
21
|
+
MA==
|
22
|
+
none: false
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: !binary |-
|
28
|
+
MA==
|
29
|
+
none: false
|
30
|
+
prerelease: false
|
31
|
+
type: :development
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: bundler
|
34
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 1.2.0
|
39
|
+
none: false
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.2.0
|
45
|
+
none: false
|
46
|
+
prerelease: false
|
47
|
+
type: :development
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.2.2
|
55
|
+
none: false
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.9.2.2
|
61
|
+
none: false
|
62
|
+
prerelease: false
|
63
|
+
type: :development
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: rdoc
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - !binary |-
|
69
|
+
Pg==
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 2.4.2
|
72
|
+
none: false
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - !binary |-
|
76
|
+
Pg==
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.4.2
|
79
|
+
none: false
|
80
|
+
prerelease: false
|
81
|
+
type: :development
|
59
82
|
description: |
|
60
83
|
This is a wrapper library to bring Unicode Normalization Form support
|
61
84
|
to Ruby/JRuby.
|
62
|
-
|
63
|
-
|
64
|
-
- knu@idaemons.org
|
85
|
+
email:
|
86
|
+
- knu@idaemons.org
|
65
87
|
executables: []
|
66
|
-
|
67
88
|
extensions: []
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
files:
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
89
|
+
extra_rdoc_files:
|
90
|
+
- README.md
|
91
|
+
- LICENSE
|
92
|
+
files:
|
93
|
+
- ".gitignore"
|
94
|
+
- ".travis.yml"
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- lib/unf.rb
|
100
|
+
- lib/unf/normalizer.rb
|
101
|
+
- lib/unf/normalizer_cruby.rb
|
102
|
+
- lib/unf/normalizer_jruby.rb
|
103
|
+
- lib/unf/version.rb
|
104
|
+
- test/helper.rb
|
105
|
+
- test/normalization-test.txt
|
106
|
+
- test/test_unf.rb
|
107
|
+
- unf.gemspec
|
86
108
|
homepage: https://github.com/knu/ruby-unf
|
87
109
|
licenses: []
|
88
|
-
|
89
|
-
post_install_message:
|
110
|
+
post_install_message:
|
90
111
|
rdoc_options: []
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: !binary |-
|
119
|
+
MA==
|
95
120
|
none: false
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: !binary |-
|
126
|
+
MA==
|
101
127
|
none: false
|
102
|
-
requirements:
|
103
|
-
- - ">="
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: "0"
|
106
128
|
requirements: []
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
signing_key:
|
129
|
+
rubyforge_project:
|
130
|
+
rubygems_version: 1.8.24
|
131
|
+
signing_key:
|
111
132
|
specification_version: 3
|
112
133
|
summary: A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
|
113
|
-
test_files:
|
114
|
-
|
115
|
-
|
116
|
-
- test/test_unf.rb
|
134
|
+
test_files:
|
135
|
+
- test/helper.rb
|
136
|
+
- test/test_unf.rb
|