unf 0.2.0.beta1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: eed3d742a59f55821ce74d0e8f96073f3479b999
4
- data.tar.gz: d7d1e8e1350c0322dfbe9e8b4bee7924ae03358c
2
+ SHA256:
3
+ metadata.gz: 3cd3437bbb5ef6ed11a0bf07ea1cfa036ae874b3adbf359a5d21732dc9829f2f
4
+ data.tar.gz: 71e0dd4ccfdfa25ce034289101c7f8043e25080192c0219c20fbd1aa9d7e24de
5
5
  SHA512:
6
- metadata.gz: 9f172d71e972352b19a6bdb7730e8927075d033bbd5952094e11d88e63e81ff6855551c4f187aff1e6f1f6dcfb33ef20868843f0abc982fe1d3f2a75334b79bd
7
- data.tar.gz: d3d0d5555d3cc08f63ebcd22f70f93af20bb7de1f811893d35ced0c135001bb91f61c74c2e647d8fcebd513fb737e721f5744951e9e9e1694ffd986787585c51
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,11 @@
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
+
1
9
  ## 0.1.4 (2014-04-04)
2
10
 
3
11
  Bugfixes:
@@ -1,12 +1,13 @@
1
- begin
2
- require 'unf_ext'
3
- rescue LoadError
4
- String.method_defined?(:unicode_normalize) or raise
5
-
1
+ case
2
+ when defined?(UNF::Normalizer)
3
+ # Probably unf_ext is preloaded.
4
+ when String.method_defined?(:unicode_normalize)
6
5
  class String
7
6
  [:nfc, :nfd, :nfkc, :nfkd].each { |form|
8
7
  eval %{
9
- def to_#{form.to_s}
8
+ remove_method :to_#{form} if method_defined?(:to_#{form})
9
+
10
+ def to_#{form}
10
11
  unicode_normalize(#{form.inspect})
11
12
  end
12
13
  }
@@ -20,4 +21,6 @@ rescue LoadError
20
21
  end
21
22
  end
22
23
  end
24
+ else
25
+ require 'unf_ext'
23
26
  end
data/lib/unf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module UNF
2
- VERSION = '0.2.0.beta1'
2
+ VERSION = '0.2.0'
3
3
  end
data/unf.gemspec CHANGED
@@ -13,11 +13,10 @@ 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-clause BSDL"
16
+ gem.license = "BSD-2-Clause"
17
17
 
18
- gem.files = `git ls-files`.split("\n")
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
 
@@ -28,4 +27,5 @@ to Ruby/JRuby.
28
27
  gem.add_development_dependency 'rake', '>= 0.9.2.2'
29
28
  gem.add_development_dependency 'rdoc', '> 2.4.2'
30
29
  gem.add_development_dependency 'test-unit'
30
+ gem.add_development_dependency 'unf_ext', '>= 0' unless defined?(JRUBY_VERSION)
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta1
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: 2015-04-16 00:00:00.000000000 Z
11
+ date: 2024-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: unf_ext
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: |
70
84
  This is a wrapper library to bring Unicode Normalization Form support
71
85
  to Ruby/JRuby.
@@ -78,28 +92,23 @@ extra_rdoc_files:
78
92
  - README.md
79
93
  - LICENSE
80
94
  files:
81
- - ".gitignore"
82
- - ".travis.yml"
95
+ - ".github/workflows/test.yml"
83
96
  - CHANGELOG.md
84
97
  - Gemfile
85
98
  - LICENSE
86
99
  - README.md
87
- - Rakefile
88
100
  - ext/mkrf_conf.rb
89
101
  - lib/unf.rb
90
102
  - lib/unf/normalizer.rb
91
103
  - lib/unf/normalizer_cruby.rb
92
104
  - lib/unf/normalizer_jruby.rb
93
105
  - lib/unf/version.rb
94
- - test/helper.rb
95
- - test/normalization-test.txt
96
- - test/test_unf.rb
97
106
  - unf.gemspec
98
107
  homepage: https://github.com/knu/ruby-unf
99
108
  licenses:
100
- - 2-clause BSDL
109
+ - BSD-2-Clause
101
110
  metadata: {}
102
- post_install_message:
111
+ post_install_message:
103
112
  rdoc_options: []
104
113
  require_paths:
105
114
  - lib
@@ -110,15 +119,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
119
  version: 1.9.3
111
120
  required_rubygems_version: !ruby/object:Gem::Requirement
112
121
  requirements:
113
- - - ">"
122
+ - - ">="
114
123
  - !ruby/object:Gem::Version
115
- version: 1.3.1
124
+ version: '0'
116
125
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.4.5
119
- signing_key:
126
+ rubygems_version: 3.5.17
127
+ signing_key:
120
128
  specification_version: 4
121
129
  summary: A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
122
- test_files:
123
- - test/helper.rb
124
- - test/test_unf.rb
130
+ test_files: []
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
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,17 +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
-
12
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
13
- $LOAD_PATH.unshift(File.dirname(__FILE__))
14
- require 'unf'
15
-
16
- class Test::Unit::TestCase
17
- end