unf 0.1.4-java → 0.2.0-java

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: e417746cf6a688522cc49bc21f30cafc5436e678
4
- data.tar.gz: b5fb2d9ce27500781393010d9e67f6735a06e660
2
+ SHA256:
3
+ metadata.gz: 10d0698cefd3750be84645cf122e1c64ed49c0103bb5979f7a738856e8c89caa
4
+ data.tar.gz: 8f0f89de6b81d8476830df18eca7b006708ab1bdf506a8869da7fe511f6d64bb
5
5
  SHA512:
6
- metadata.gz: b7621405634df50ae323d040eba54ad8ad88342376060ef7711df596e5b6160dc012a56584da598631ba5dd9506301e775958a7aeb3c66b62e004d4464580649
7
- data.tar.gz: 06f46545c274c7495f7166e436d75b8db792ecfcc2e8be330ffb454f354fc61e64ccfb76c16bfb40518d87ed0daaa09516f8286c74c49fcd29d0b4df1f5fbae4
6
+ metadata.gz: 7078c2105487f188a23d8d192f854e27d9e7c4cce49f16ff58c36452b5ece4bb1527226f9f44566501c0059e12131416317c74609dbc38445153c00231f25bb3
7
+ data.tar.gz: d3f3e489fa7abfce2ecc0d5f771c89caab0cb79c3cd9533c4d3d3da4760f8960162e59a8150b7f5d06799981ca75856b73828e9175fc4c1c9be55c8a89ce63a9
@@ -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
@@ -1 +1,26 @@
1
- require 'unf_ext'
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
@@ -1,3 +1,3 @@
1
1
  module UNF
2
- VERSION = '0.1.4'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/unf.rb CHANGED
@@ -35,4 +35,4 @@ class String
35
35
  end
36
36
  }
37
37
  }
38
- end
38
+ end unless String.method_defined?(:to_nfc)
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-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
 
24
- gem.add_dependency 'unf_ext', '>= 0' unless defined?(JRUBY_VERSION)
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,101 +1,98 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Akinori MUSHA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-04 00:00:00.000000000 Z
11
+ date: 2024-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: shoulda
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
- - - '>='
16
+ - - ">="
23
17
  - !ruby/object:Gem::Version
24
- version: '0'
25
- prerelease: false
26
- type: :development
27
- - !ruby/object:Gem::Dependency
18
+ version: 1.2.0
28
19
  name: bundler
20
+ type: :development
21
+ prerelease: false
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - '>='
24
+ - - ">="
32
25
  - !ruby/object:Gem::Version
33
26
  version: 1.2.0
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
- - - '>='
30
+ - - ">="
37
31
  - !ruby/object:Gem::Version
38
- version: 1.2.0
39
- prerelease: false
40
- type: :development
41
- - !ruby/object:Gem::Dependency
32
+ version: 0.9.2.2
42
33
  name: rake
34
+ type: :development
35
+ prerelease: false
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - '>='
38
+ - - ">="
46
39
  - !ruby/object:Gem::Version
47
40
  version: 0.9.2.2
41
+ - !ruby/object:Gem::Dependency
48
42
  requirement: !ruby/object:Gem::Requirement
49
43
  requirements:
50
- - - '>='
44
+ - - ">"
51
45
  - !ruby/object:Gem::Version
52
- version: 0.9.2.2
53
- prerelease: false
54
- type: :development
55
- - !ruby/object:Gem::Dependency
46
+ version: 2.4.2
56
47
  name: rdoc
48
+ type: :development
49
+ prerelease: false
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
51
  requirements:
59
- - - '>'
52
+ - - ">"
60
53
  - !ruby/object:Gem::Version
61
54
  version: 2.4.2
55
+ - !ruby/object:Gem::Dependency
62
56
  requirement: !ruby/object:Gem::Requirement
63
57
  requirements:
64
- - - '>'
58
+ - - ">="
65
59
  - !ruby/object:Gem::Version
66
- version: 2.4.2
67
- prerelease: false
60
+ version: '0'
61
+ name: test-unit
68
62
  type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
69
  description: |
70
70
  This is a wrapper library to bring Unicode Normalization Form support
71
71
  to Ruby/JRuby.
72
72
  email:
73
73
  - knu@idaemons.org
74
74
  executables: []
75
- extensions: []
75
+ extensions:
76
+ - ext/mkrf_conf.rb
76
77
  extra_rdoc_files:
77
78
  - README.md
78
79
  - LICENSE
79
80
  files:
80
- - .gitignore
81
- - .travis.yml
81
+ - ".github/workflows/test.yml"
82
82
  - CHANGELOG.md
83
83
  - Gemfile
84
84
  - LICENSE
85
85
  - README.md
86
- - Rakefile
86
+ - ext/mkrf_conf.rb
87
87
  - lib/unf.rb
88
88
  - lib/unf/normalizer.rb
89
89
  - lib/unf/normalizer_cruby.rb
90
90
  - lib/unf/normalizer_jruby.rb
91
91
  - lib/unf/version.rb
92
- - test/helper.rb
93
- - test/normalization-test.txt
94
- - test/test_unf.rb
95
92
  - unf.gemspec
96
93
  homepage: https://github.com/knu/ruby-unf
97
94
  licenses:
98
- - 2-clause BSDL
95
+ - BSD-2-Clause
99
96
  metadata: {}
100
97
  post_install_message:
101
98
  rdoc_options: []
@@ -103,20 +100,17 @@ require_paths:
103
100
  - lib
104
101
  required_ruby_version: !ruby/object:Gem::Requirement
105
102
  requirements:
106
- - - '>='
103
+ - - ">="
107
104
  - !ruby/object:Gem::Version
108
- version: '0'
105
+ version: 1.9.3
109
106
  required_rubygems_version: !ruby/object:Gem::Requirement
110
107
  requirements:
111
- - - '>='
108
+ - - ">="
112
109
  - !ruby/object:Gem::Version
113
110
  version: '0'
114
111
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.1.9
112
+ rubygems_version: 3.3.26
117
113
  signing_key:
118
114
  specification_version: 4
119
115
  summary: A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
120
- test_files:
121
- - test/helper.rb
122
- - test/test_unf.rb
116
+ 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,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