unf 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +42 -0
- data/CHANGELOG.md +14 -0
- data/ext/mkrf_conf.rb +24 -0
- data/lib/unf/normalizer_cruby.rb +26 -1
- data/lib/unf/version.rb +1 -1
- data/lib/unf.rb +1 -1
- data/unf.gemspec +6 -10
- metadata +33 -39
- data/.gitignore +0 -17
- data/.travis.yml +0 -17
- data/Rakefile +0 -21
- data/test/helper.rb +0 -18
- data/test/normalization-test.txt +0 -108816
- data/test/test_unf.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3cd3437bbb5ef6ed11a0bf07ea1cfa036ae874b3adbf359a5d21732dc9829f2f
|
4
|
+
data.tar.gz: 71e0dd4ccfdfa25ce034289101c7f8043e25080192c0219c20fbd1aa9d7e24de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc7545ae4404bcc585fd011e330cba5ca00fdcf377b4aa464f06c93a4d4304f1338b8d84f9e2e85e07c6cb5ff931fb282c4435fcd51ac9cb4d2daf54725cb78
|
7
|
+
data.tar.gz: d923e127bc468d2795624ff03a9bf417c49ff204f618d372a8195bfc889d714b57b96b11ac09b84709c044874406f089f0b228617292903a7631fa411cf94cbf
|
@@ -0,0 +1,42 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on: [push, pull_request, workflow_dispatch]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
ruby-versions:
|
7
|
+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
|
8
|
+
with:
|
9
|
+
engine: cruby
|
10
|
+
min_version: 3.2
|
11
|
+
|
12
|
+
build:
|
13
|
+
needs: ruby-versions
|
14
|
+
name: build (${{ matrix.ruby_engine }} / ${{ matrix.ruby_version || 'latest' }} / ${{ matrix.os }})
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
os:
|
18
|
+
- ubuntu-latest
|
19
|
+
ruby_engine:
|
20
|
+
- ruby
|
21
|
+
ruby_version:
|
22
|
+
- '2.0'
|
23
|
+
- '2.7'
|
24
|
+
- '${{ fromJson(needs.ruby-versions.outputs.versions) }}'
|
25
|
+
include:
|
26
|
+
- { os: ubuntu-latest, ruby_engine: jruby, ruby_version: '' }
|
27
|
+
- { os: ubuntu-latest, ruby_engine: jruby, ruby_version: head }
|
28
|
+
- { os: macos-latest, ruby_engine: ruby, ruby_version: '' }
|
29
|
+
- { os: windows-latest, ruby_engine: ruby, ruby_version: ucrt }
|
30
|
+
- { os: windows-latest, ruby_engine: ruby, ruby_version: mswin }
|
31
|
+
runs-on: ${{ matrix.os }}
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v4
|
34
|
+
|
35
|
+
- name: Set up Ruby
|
36
|
+
uses: ruby/setup-ruby@v1
|
37
|
+
with:
|
38
|
+
ruby-version: ${{ matrix.ruby_engine }}-${{ matrix.ruby_version }}
|
39
|
+
bundler-cache: true
|
40
|
+
|
41
|
+
- name: Run test
|
42
|
+
run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 0.2.0 (2024-08-18)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Use String#unicode_normalize on Ruby >=2.2 unless unf_ext is already loaded.
|
6
|
+
|
7
|
+
- Reduce the gem size by removing unnecessary files. (GH #22)
|
8
|
+
|
9
|
+
## 0.1.4 (2014-04-04)
|
10
|
+
|
11
|
+
Bugfixes:
|
12
|
+
|
13
|
+
- Fix the gem platform name for JRuby.
|
14
|
+
|
1
15
|
## 0.1.3 (2013-10-25)
|
2
16
|
|
3
17
|
Features:
|
data/ext/mkrf_conf.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
extdir = File.dirname(__FILE__)
|
4
|
+
|
5
|
+
unless defined?(JRUBY_VERSION) || String.method_defined?(:unicode_normalize)
|
6
|
+
require 'fileutils'
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubygems/command.rb'
|
9
|
+
require 'rubygems/dependency_installer.rb'
|
10
|
+
|
11
|
+
Gem::Command.build_args = ARGV
|
12
|
+
|
13
|
+
gemsdir = File.expand_path('gems', extdir)
|
14
|
+
installer = Gem::DependencyInstaller.new(install_dir: gemsdir)
|
15
|
+
specs = installer.install('unf_ext', '>= 0')
|
16
|
+
|
17
|
+
unf_ext = specs.find { |spec| spec.name == 'unf_ext' }
|
18
|
+
FileUtils.cp_r(File.join(unf_ext.gem_dir, 'lib'), File.expand_path('..', extdir))
|
19
|
+
FileUtils.rm_rf(gemsdir)
|
20
|
+
end
|
21
|
+
|
22
|
+
File.write(File.expand_path('Rakefile', extdir), <<EOF)
|
23
|
+
task :default
|
24
|
+
EOF
|
data/lib/unf/normalizer_cruby.rb
CHANGED
@@ -1 +1,26 @@
|
|
1
|
-
|
1
|
+
case
|
2
|
+
when defined?(UNF::Normalizer)
|
3
|
+
# Probably unf_ext is preloaded.
|
4
|
+
when String.method_defined?(:unicode_normalize)
|
5
|
+
class String
|
6
|
+
[:nfc, :nfd, :nfkc, :nfkd].each { |form|
|
7
|
+
eval %{
|
8
|
+
remove_method :to_#{form} if method_defined?(:to_#{form})
|
9
|
+
|
10
|
+
def to_#{form}
|
11
|
+
unicode_normalize(#{form.inspect})
|
12
|
+
end
|
13
|
+
}
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
module UNF # :nodoc: all
|
18
|
+
class Normalizer
|
19
|
+
def normalize(string, normalization_form)
|
20
|
+
String.try_convert(string).unicode_normalize(normalization_form)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
else
|
25
|
+
require 'unf_ext'
|
26
|
+
end
|
data/lib/unf/version.rb
CHANGED
data/lib/unf.rb
CHANGED
data/unf.gemspec
CHANGED
@@ -13,23 +13,19 @@ to Ruby/JRuby.
|
|
13
13
|
gem.summary = %q{A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby}
|
14
14
|
gem.homepage = "https://github.com/knu/ruby-unf"
|
15
15
|
gem.platform = defined?(JRUBY_VERSION) ? 'java' : Gem::Platform::RUBY
|
16
|
-
gem.license = "2-
|
16
|
+
gem.license = "BSD-2-Clause"
|
17
17
|
|
18
|
-
gem.files = `git ls-files`.split("\
|
18
|
+
gem.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?(*%w[test/ Rakefile .gitignore .travis.yml]) }
|
19
19
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
20
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/.*\.rb})
|
21
20
|
gem.require_paths = ["lib"]
|
22
21
|
gem.extra_rdoc_files = ['README.md', 'LICENSE']
|
23
22
|
|
24
|
-
gem.
|
23
|
+
gem.required_ruby_version = '>= 1.9.3'
|
24
|
+
gem.extensions = 'ext/mkrf_conf.rb'
|
25
25
|
|
26
|
-
gem.add_development_dependency 'shoulda', [RUBY_VERSION < '1.9' ? '< 3.5.0' : '>= 0']
|
27
|
-
if RUBY_VERSION < '1.9'
|
28
|
-
# Cap dependency on activesupport with < 4.0 on behalf of
|
29
|
-
# shoulda-matchers to satisfy bundler.
|
30
|
-
gem.add_development_dependency 'activesupport', ['< 4.0']
|
31
|
-
end
|
32
26
|
gem.add_development_dependency 'bundler', '>= 1.2.0'
|
33
27
|
gem.add_development_dependency 'rake', '>= 0.9.2.2'
|
34
28
|
gem.add_development_dependency 'rdoc', '> 2.4.2'
|
29
|
+
gem.add_development_dependency 'test-unit'
|
30
|
+
gem.add_development_dependency 'unf_ext', '>= 0' unless defined?(JRUBY_VERSION)
|
35
31
|
end
|
metadata
CHANGED
@@ -1,117 +1,114 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 1.2.0
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.9.2.2
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.9.2.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 2.4.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 2.4.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: test-unit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: unf_ext
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '0'
|
83
83
|
description: |
|
84
84
|
This is a wrapper library to bring Unicode Normalization Form support
|
85
85
|
to Ruby/JRuby.
|
86
86
|
email:
|
87
87
|
- knu@idaemons.org
|
88
88
|
executables: []
|
89
|
-
extensions:
|
89
|
+
extensions:
|
90
|
+
- ext/mkrf_conf.rb
|
90
91
|
extra_rdoc_files:
|
91
92
|
- README.md
|
92
93
|
- LICENSE
|
93
94
|
files:
|
94
|
-
- ".
|
95
|
-
- ".travis.yml"
|
95
|
+
- ".github/workflows/test.yml"
|
96
96
|
- CHANGELOG.md
|
97
97
|
- Gemfile
|
98
98
|
- LICENSE
|
99
99
|
- README.md
|
100
|
-
-
|
100
|
+
- ext/mkrf_conf.rb
|
101
101
|
- lib/unf.rb
|
102
102
|
- lib/unf/normalizer.rb
|
103
103
|
- lib/unf/normalizer_cruby.rb
|
104
104
|
- lib/unf/normalizer_jruby.rb
|
105
105
|
- lib/unf/version.rb
|
106
|
-
- test/helper.rb
|
107
|
-
- test/normalization-test.txt
|
108
|
-
- test/test_unf.rb
|
109
106
|
- unf.gemspec
|
110
107
|
homepage: https://github.com/knu/ruby-unf
|
111
108
|
licenses:
|
112
|
-
- 2-
|
109
|
+
- BSD-2-Clause
|
113
110
|
metadata: {}
|
114
|
-
post_install_message:
|
111
|
+
post_install_message:
|
115
112
|
rdoc_options: []
|
116
113
|
require_paths:
|
117
114
|
- lib
|
@@ -119,18 +116,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
116
|
requirements:
|
120
117
|
- - ">="
|
121
118
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
119
|
+
version: 1.9.3
|
123
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
121
|
requirements:
|
125
122
|
- - ">="
|
126
123
|
- !ruby/object:Gem::Version
|
127
124
|
version: '0'
|
128
125
|
requirements: []
|
129
|
-
|
130
|
-
|
131
|
-
signing_key:
|
126
|
+
rubygems_version: 3.5.17
|
127
|
+
signing_key:
|
132
128
|
specification_version: 4
|
133
129
|
summary: A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
|
134
|
-
test_files:
|
135
|
-
- test/helper.rb
|
136
|
-
- test/test_unf.rb
|
130
|
+
test_files: []
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.8.7
|
4
|
-
- ree
|
5
|
-
- 1.9.3
|
6
|
-
- 2.0.0
|
7
|
-
- ruby-head
|
8
|
-
- jruby-18mode
|
9
|
-
- jruby-19mode
|
10
|
-
- jruby-head
|
11
|
-
- rbx-18mode
|
12
|
-
- rbx-19mode
|
13
|
-
matrix:
|
14
|
-
allow_failures:
|
15
|
-
- rvm: ruby-head
|
16
|
-
- rvm: rbx-18mode
|
17
|
-
- rvm: rbx-19mode
|
data/Rakefile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
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/test/helper.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'test/unit'
|
11
|
-
require 'shoulda'
|
12
|
-
|
13
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
-
require 'unf'
|
16
|
-
|
17
|
-
class Test::Unit::TestCase
|
18
|
-
end
|