unf 0.1.4 → 0.2.0.beta1

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
2
  SHA1:
3
- metadata.gz: 3524dc58d3575e1f05725af1ad24dbd338ca6e5e
4
- data.tar.gz: a1c587d572c5ec2eb56e641fdefb3c7891b89ae8
3
+ metadata.gz: eed3d742a59f55821ce74d0e8f96073f3479b999
4
+ data.tar.gz: d7d1e8e1350c0322dfbe9e8b4bee7924ae03358c
5
5
  SHA512:
6
- metadata.gz: cba56bc2480fe1d68a28bacc3ed2ff53d38530db8b3cca06f33b0f5de39c0cf4f67f9c01dfb7b37605b23fe2fac91bbaee2188be424c8cd8717e5455b72277da
7
- data.tar.gz: 5e641987179703915581effa487da34ca28c39b879c26424979ea4a9e8bdede7726e61531612f689b943ee3b0f6b893c72453602a007d90271c4b414aec48450
6
+ metadata.gz: 9f172d71e972352b19a6bdb7730e8927075d033bbd5952094e11d88e63e81ff6855551c4f187aff1e6f1f6dcfb33ef20868843f0abc982fe1d3f2a75334b79bd
7
+ data.tar.gz: d3d0d5555d3cc08f63ebcd22f70f93af20bb7de1f811893d35ced0c135001bb91f61c74c2e647d8fcebd513fb737e721f5744951e9e9e1694ffd986787585c51
@@ -1,3 +1,9 @@
1
+ ## 0.1.4 (2014-04-04)
2
+
3
+ Bugfixes:
4
+
5
+ - Fix the gem platform name for JRuby.
6
+
1
7
  ## 0.1.3 (2013-10-25)
2
8
 
3
9
  Features:
@@ -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.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)
@@ -1 +1,23 @@
1
- require 'unf_ext'
1
+ begin
2
+ require 'unf_ext'
3
+ rescue LoadError
4
+ String.method_defined?(:unicode_normalize) or raise
5
+
6
+ class String
7
+ [:nfc, :nfd, :nfkc, :nfkd].each { |form|
8
+ eval %{
9
+ def to_#{form.to_s}
10
+ unicode_normalize(#{form.inspect})
11
+ end
12
+ }
13
+ }
14
+ end
15
+
16
+ module UNF # :nodoc: all
17
+ class Normalizer
18
+ def normalize(string, normalization_form)
19
+ String.try_convert(string).unicode_normalize(normalization_form)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module UNF
2
- VERSION = '0.1.4'
2
+ VERSION = '0.2.0.beta1'
3
3
  end
@@ -8,7 +8,6 @@ rescue Bundler::BundlerError => e
8
8
  exit e.status_code
9
9
  end
10
10
  require 'test/unit'
11
- require 'shoulda'
12
11
 
13
12
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
13
  $LOAD_PATH.unshift(File.dirname(__FILE__))
@@ -3,12 +3,12 @@ require 'helper'
3
3
  require 'pathname'
4
4
 
5
5
  class TestUNF < Test::Unit::TestCase
6
- should "raise ArgumentError if an unknown normalization form is given" do
6
+ test "raise ArgumentError if an unknown normalization form is given" do
7
7
  normalizer = UNF::Normalizer.instance
8
8
  assert_raises(ArgumentError) { normalizer.normalize("が", :nfck) }
9
9
  end
10
10
 
11
- should "pass all tests bundled with the original unf" do
11
+ test "pass all tests bundled with the original unf" do
12
12
  normalizer = UNF::Normalizer.instance
13
13
  open(Pathname(__FILE__).dirname + 'normalization-test.txt', 'r:utf-8').each_slice(6) { |lines|
14
14
  flunk "broken test file" if lines.size != 6 || lines.pop !~ /^$/
@@ -21,15 +21,11 @@ to Ruby/JRuby.
21
21
  gem.require_paths = ["lib"]
22
22
  gem.extra_rdoc_files = ['README.md', 'LICENSE']
23
23
 
24
- gem.add_dependency 'unf_ext', '>= 0' unless defined?(JRUBY_VERSION)
24
+ gem.required_ruby_version = '>= 1.9.3'
25
+ gem.extensions = 'ext/mkrf_conf.rb'
25
26
 
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
27
  gem.add_development_dependency 'bundler', '>= 1.2.0'
33
28
  gem.add_development_dependency 'rake', '>= 0.9.2.2'
34
29
  gem.add_development_dependency 'rdoc', '> 2.4.2'
30
+ gem.add_development_dependency 'test-unit'
35
31
  end
metadata CHANGED
@@ -1,43 +1,15 @@
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.beta1
5
5
  platform: ruby
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: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: unf_ext
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: shoulda
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: bundler
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -80,13 +52,28 @@ dependencies:
80
52
  - - ">"
81
53
  - !ruby/object:Gem::Version
82
54
  version: 2.4.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
83
69
  description: |
84
70
  This is a wrapper library to bring Unicode Normalization Form support
85
71
  to Ruby/JRuby.
86
72
  email:
87
73
  - knu@idaemons.org
88
74
  executables: []
89
- extensions: []
75
+ extensions:
76
+ - ext/mkrf_conf.rb
90
77
  extra_rdoc_files:
91
78
  - README.md
92
79
  - LICENSE
@@ -98,6 +85,7 @@ files:
98
85
  - LICENSE
99
86
  - README.md
100
87
  - Rakefile
88
+ - ext/mkrf_conf.rb
101
89
  - lib/unf.rb
102
90
  - lib/unf/normalizer.rb
103
91
  - lib/unf/normalizer_cruby.rb
@@ -119,15 +107,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
107
  requirements:
120
108
  - - ">="
121
109
  - !ruby/object:Gem::Version
122
- version: '0'
110
+ version: 1.9.3
123
111
  required_rubygems_version: !ruby/object:Gem::Requirement
124
112
  requirements:
125
- - - ">="
113
+ - - ">"
126
114
  - !ruby/object:Gem::Version
127
- version: '0'
115
+ version: 1.3.1
128
116
  requirements: []
129
117
  rubyforge_project:
130
- rubygems_version: 2.2.0
118
+ rubygems_version: 2.4.5
131
119
  signing_key:
132
120
  specification_version: 4
133
121
  summary: A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby