unicode 0.4.4.3-x86-mswin32-60 → 0.4.4.4-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
2
  SHA1:
3
- metadata.gz: 6dc4260c1faf3541738bffdb68f3a085eb5c1683
4
- data.tar.gz: db4b8eae7c550f30e2be17a7e5d57fc0501648de
3
+ metadata.gz: e86609894809932caa96c562d6e31f15efb07f69
4
+ data.tar.gz: 2839ea175c888bd758d0ec0b9d463719f3c18c32
5
5
  SHA512:
6
- metadata.gz: f85c408d652cc5ec7e9e85e9d677a2b1c26e14d6e8806a92a636ce755d0fa7df26d5550214eb4f19bc7c5ed54c69d6adf78106e88a56c2481fe339fdc3972012
7
- data.tar.gz: 3decdf848839e61149a706f8e20cc3ea3518ef8d5736d808eec2325312331c659f5d327c047bebf0acbfbefdf703972879d782430c4b6981f6d986b71279519c
6
+ metadata.gz: dca79df102fd2b7715e07c6e85ba83c5847484272b35d855e8c5d57c6776bf3ad84cbbd6a01098b7805a5c4a0ca3334d83ffa329d006cd6b984d02622aaf5b1e
7
+ data.tar.gz: 86469984239101be79b85e64a8edc86bc210e447d58982f0aa24ee2708f74d85a0c9e44d3f86f028c1f4fad912e8e100759ce0e98963dee903ef29f7fd8963fd
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ end
20
20
  namespace :gem do
21
21
 
22
22
  desc 'Build all gem files'
23
- task :all => %w[clean gem gem:java gem:windows]
23
+ task all: %w[clean gem gem:java gem:windows]
24
24
 
25
25
  java_gem_spec = gem_spec.dup
26
26
  java_gem_spec.platform = 'java'
@@ -33,7 +33,7 @@ namespace :gem do
33
33
  java_gem_path = File.join(java_gem_dir, java_gem_file)
34
34
 
35
35
  desc "Build the gem file #{java_gem_file}"
36
- task :java => java_gem_path
36
+ task java: java_gem_path
37
37
 
38
38
  file java_gem_path => [java_gem_dir] + java_gem_spec.files do
39
39
  lib_file = 'lib/unicode.rb'
@@ -54,7 +54,7 @@ namespace :gem do
54
54
 
55
55
  desc 'Build native gems for Windows'
56
56
  task :windows do
57
- ENV['RUBY_CC_VERSION'] = '1.9.3:2.0.0:2.1.5:2.2.0'
57
+ ENV['RUBY_CC_VERSION'] = '1.9.3:2.0.0:2.1.5:2.2.2:2.3.0'
58
58
  sh 'rake cross compile'
59
59
  sh 'rake cross native gem'
60
60
  end
data/lib/unicode.rb CHANGED
@@ -1,6 +1,117 @@
1
- begin
2
- require "unicode/#{RUBY_VERSION[/\d+.\d+/]}/unicode_native"
3
- rescue LoadError => err
4
- raise if err.respond_to?(:path) && !err.path
5
- require 'unicode/unicode_native'
1
+ module Unicode
2
+
3
+ extend self
4
+
5
+ VERSION = '0.4.3'
6
+
7
+ Normalizer = Java::JavaText::Normalizer
8
+
9
+ def strcmp(str1, str2)
10
+ decompose(str1).to_java.compare_to(decompose(str2))
11
+ end
12
+
13
+ def strcmp_compat(str1, str2)
14
+ decompose_compat(str1).to_java.compare_to(decompose_compat(str2))
15
+ end
16
+
17
+ def decompose(str)
18
+ Normalizer.normalize(str, Normalizer::Form::NFD)
19
+ end
20
+
21
+ alias_method :normalize_D, :decompose
22
+ alias_method :nfd, :decompose
23
+
24
+ # Decompose Unicode string with a non-standard mapping.
25
+ #
26
+ # It does not decompose the characters in CompositionExclusions.txt.
27
+ def decompose_safe(str)
28
+ raise NotImplementedError
29
+ end
30
+
31
+ alias_method :normalize_D_safe, :decompose_safe
32
+ alias_method :nfd_safe, :decompose_safe
33
+
34
+ def decompose_compat(str)
35
+ Normalizer.normalize(str, Normalizer::Form::NFKD)
36
+ end
37
+
38
+ alias_method :normalize_KD, :decompose_compat
39
+ alias_method :nfkd, :decompose_compat
40
+
41
+ # Compose Unicode string. Before composing, the trailing
42
+ # characters are sorted in canonical order.
43
+ #
44
+ # The parameter must be decomposed.
45
+ #
46
+ # The composition is based on the reverse of the
47
+ # character decomposition mapping in UnicodeData.txt,
48
+ # CompositionExclusions.txt and the Hangul composition
49
+ # algorithm.
50
+ def compose(str)
51
+ raise NotImplementedError
52
+ end
53
+
54
+ def normalize_C(str)
55
+ Normalizer.normalize(str, Normalizer::Form::NFC)
56
+ end
57
+
58
+ alias_method :nfc, :normalize_C
59
+
60
+ def normalize_KC(str)
61
+ Normalizer.normalize(str, Normalizer::Form::NFKC)
62
+ end
63
+
64
+ alias_method :nfkc, :normalize_KC
65
+
66
+ def normalize_C_safe(str)
67
+ compose(decompose_safe(str))
68
+ end
69
+
70
+ alias_method :nfc_safe, :normalize_C_safe
71
+
72
+ def upcase(str)
73
+ str.to_java.to_upper_case
74
+ end
75
+
76
+ def downcase(str)
77
+ str.to_java.to_lower_case
78
+ end
79
+
80
+ def capitalize(str)
81
+ downcase(str).tap { |s| s[0] = upcase(s[0]) }
82
+ end
83
+
84
+ # Get an array of general category names of the string.
85
+ #
86
+ # Can be called with a block.
87
+ def categories(str)
88
+ raise NotImplementedError
89
+ end
90
+
91
+ # Get an array of abbreviated category names of the string.
92
+ #
93
+ # Can be called with a block.
94
+ def abbr_categories(str)
95
+ raise NotImplementedError
96
+ end
97
+
98
+ # Get an array of text elements.
99
+ #
100
+ # A text element is a unit that is displayed as a single character.
101
+ #
102
+ # Can be called with a block.
103
+ def text_elements(str)
104
+ raise NotImplementedError
105
+ end
106
+
107
+ # Estimate the display width on the fixed pitch text terminal.
108
+ #
109
+ # It based on Markus Kuhn's mk_wcwidth.
110
+ #
111
+ # If the optional argument 'cjk' is true, East Asian
112
+ # Ambiguous characters are treated as wide characters.
113
+ def width(str, cjk = false)
114
+ raise NotImplementedError
115
+ end
116
+
6
117
  end
data/unicode.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{unicode}
5
- s.version = "0.4.4.3"
5
+ s.version = "0.4.4.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = [%q{Yoshida Masato}]
metadata CHANGED
@@ -1,13 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4.3
5
- platform: x86-mswin32-60
4
+ version: 0.4.4.4
5
+ platform: java
6
6
  authors:
7
7
  - Yoshida Masato
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MQswCQYDVQQDDAJ3dzEb
14
+ MBkGCgmSJomT8ixkARkWC2JsYWNrd2ludGVyMRIwEAYKCZImiZPyLGQBGRYCZGUw
15
+ HhcNMTMwMTMxMDkyMjIyWhcNMTQwMTMxMDkyMjIyWjA+MQswCQYDVQQDDAJ3dzEb
16
+ MBkGCgmSJomT8ixkARkWC2JsYWNrd2ludGVyMRIwEAYKCZImiZPyLGQBGRYCZGUw
17
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVXmfa6rbTwKOvtuGoROc1
18
+ I4qZjgLX0BA4WecYB97PjwLJmJ1hRvf9JulVCJYYmt5ZEPPXbgi9xLbcp6ofGmnC
19
+ i68/kbhcz20/fRUtIJ2phU3ypQTEd2pFddpL7SR2FxLkzvvg5E6nslGn7o2erDpO
20
+ 8sm610A3xsgT/eNIr9QA7k4pHh18X1KvZKmmQR4/AjVyKmKawzauKUoHHepjvjVs
21
+ s0pVoM7UmOmrS4SafQ3OwUo37f19CVdN2/FW7z3e5+iYhKxdIFdhniX9iDWtA3Jn
22
+ 7oUOtiolhCRK4P/c30UjTCDkRkOldsWciFUasROJ5VAV2SVv7FtGHoQLDZ/++tRr
23
+ AgMBAAGjOTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFIAPWU4BEoYUe82hY/0EkoGd
24
+ Oo/WMAsGA1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAf2YnB0mj42of22dA
25
+ MimgJCAEgB3H5aHbZ6B5WVnFvrC2UUnhP+/kLj/6UgOfqcasy4Xh62NVGuNrf7rF
26
+ 7NMN87XwexGuU2GCpIMUd6VCTA7zMP2OWuXEcba7jT5OtiI55buO0J4CRtyeX1XF
27
+ qwlGgx4ItcGhMTlDFXj3IkpeVtjD8O7yWE21bHf9lLURmqK/r9KjoxrrVi7+cESJ
28
+ H19TDW3R9p594jCl1ykPs3dz/0Bk+r1HTd35Yw+yBbyprSJb4S7OcRRHCryuo09l
29
+ NBGyZvOBuqUp0xostWSk0dfxyn/YQ7eqvQRGBhK1VGa7Tg/KYqnemDE57+VOXrua
30
+ 59wzaA==
31
+ -----END CERTIFICATE-----
11
32
  date: 2013-02-07 00:00:00.000000000 Z
12
33
  dependencies: []
13
34
  description: Unicode normalization library.
@@ -19,18 +40,7 @@ extra_rdoc_files:
19
40
  files:
20
41
  - README
21
42
  - Rakefile
22
- - ext/unicode/extconf.rb
23
- - ext/unicode/unicode.c
24
- - ext/unicode/unidata.map
25
- - ext/unicode/ustring.c
26
- - ext/unicode/ustring.h
27
- - ext/unicode/wstring.c
28
- - ext/unicode/wstring.h
29
43
  - lib/unicode.rb
30
- - lib/unicode/1.9/unicode_native.so
31
- - lib/unicode/2.0/unicode_native.so
32
- - lib/unicode/2.1/unicode_native.so
33
- - lib/unicode/2.2/unicode_native.so
34
44
  - test/test.rb
35
45
  - tools/README
36
46
  - tools/mkunidata.rb
@@ -56,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
66
  version: '0'
57
67
  requirements: []
58
68
  rubyforge_project:
59
- rubygems_version: 2.4.5
69
+ rubygems_version: 2.6.8
60
70
  signing_key:
61
71
  specification_version: 3
62
72
  summary: Unicode normalization library.
@@ -1,3 +0,0 @@
1
- require 'mkmf'
2
-
3
- create_makefile("unicode/unicode_native")