ffi-icu 0.1.10 → 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
2
  SHA1:
3
- metadata.gz: d8e1f27ccf739beabc4c5b53d56fb1196a12d63e
4
- data.tar.gz: a79eb9e7668ae49a2f59b90954ad09b1b79ee803
3
+ metadata.gz: 0a7c36403ec9b6c70045c537a2f31cc9fc62f065
4
+ data.tar.gz: dce1b25080ad24cd6325a4d4b50e81b7938fc4f6
5
5
  SHA512:
6
- metadata.gz: 42bf92305860a6c868d654d4b15e1e975847b145958e3bdd329ea0fb7da42bd0165714f4cffeebc5f082e24b87e44231fd620a0da8d878f5ba94accb48fdfc12
7
- data.tar.gz: c587cd93aeb0a3fe5bc2dfe15903c950fa2acbead36c68d27d64235bfe135d9a4321ba8326acbf78918da069a6e2ecd202650129b3ae0c6aec5915f0c8b7e518
6
+ metadata.gz: 01a065f767fba3fcc658838d2891782538f244246c912c9f483f440b896d7e52620128097b00bbe92f1edf6e0a26a205010ac6b02b3c15923d37903c613ff5f5
7
+ data.tar.gz: 941fd743b77fbbabd24254f3f23f0d18093c7614877b0a50d532211cae728f3173b2f7d744943e7e6364950ecc9f12a0770fddda150732d0a96c85880053df56
@@ -1,7 +1,7 @@
1
1
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.0
2
+ - 2.4.6
3
+ - 2.5.5
4
+ - 2.6.3
5
5
  - ruby-head
6
6
  before_script:
7
- - sudo apt-get install -y libicu48
7
+ - sudo apt-get install -y libicu-dev
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  ffi-icu
2
2
  =======
3
3
 
4
- Simple FFI wrappers for things I need from ICU. For the full thing, check out [ICU4R](http://icu4r.rubyforge.org/) instead.
5
-
6
- [![Build Status](https://secure.travis-ci.org/jarib/ffi-icu.png)](http://travis-ci.org/jarib/ffi-icu)
4
+ Simple FFI wrappers for ICU. Checkout the renovated [ICU gem](https://github.com/fantasticfears/icu4r) instead which supports various of encoding and distributed with packaged source. FFI-ICU needs some love with ICU gem's transcoding method.
7
5
 
8
6
  Gem
9
7
  ---
@@ -132,10 +130,10 @@ Platforms:
132
130
 
133
131
  Rubies:
134
132
 
135
- * 1.9.3
136
- * 2.0.0
137
- * 2.1.0
138
- * ruby-head
133
+ - 2.4.6
134
+ - 2.5.5
135
+ - 2.6.3
136
+ - ruby-head
139
137
 
140
138
  TODO:
141
139
  =====
@@ -6,7 +6,8 @@ Gem::Specification.new do |s|
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jari Bakken"]
9
- s.date = %q{2010-08-23}
9
+ s.date = %q{2019-10-15}
10
+ s.licenses = ['MIT']
10
11
  s.description = %q{Provides charset detection, locale sensitive collation and more. Depends on libicu.}
11
12
  s.email = %q{jari.bakken@gmail.com}
12
13
  s.extra_rdoc_files = ["LICENSE", "README.md"]
@@ -20,7 +21,7 @@ Gem::Specification.new do |s|
20
21
  s.summary = %q{Simple Ruby FFI wrappers for things I need from ICU.}
21
22
 
22
23
  s.add_runtime_dependency "ffi", "~> 1.0", ">= 1.0.9"
23
- s.add_development_dependency "rspec", ["~> 2.5.0"]
24
+ s.add_development_dependency 'rspec', '~> 2.5', '>= 2.5.0'
24
25
  s.add_development_dependency "rake", ["~> 0.9.2"]
25
26
  end
26
27
 
@@ -75,7 +75,7 @@ module ICU
75
75
  def display_country(locale = nil)
76
76
  locale = locale.to_s unless locale.nil?
77
77
 
78
- Lib::Util.read_uchar_buffer(64) do |buffer, status|
78
+ Lib::Util.read_uchar_buffer(256) do |buffer, status|
79
79
  Lib.uloc_getDisplayCountry(@id, locale, buffer, buffer.size, status)
80
80
  end
81
81
  end
@@ -83,7 +83,7 @@ module ICU
83
83
  def display_language(locale = nil)
84
84
  locale = locale.to_s unless locale.nil?
85
85
 
86
- Lib::Util.read_uchar_buffer(64) do |buffer, status|
86
+ Lib::Util.read_uchar_buffer(192) do |buffer, status|
87
87
  Lib.uloc_getDisplayLanguage(@id, locale, buffer, buffer.size, status)
88
88
  end
89
89
  end
@@ -91,7 +91,7 @@ module ICU
91
91
  def display_name(locale = nil)
92
92
  locale = locale.to_s unless locale.nil?
93
93
 
94
- Lib::Util.read_uchar_buffer(64) do |buffer, status|
94
+ Lib::Util.read_uchar_buffer(256) do |buffer, status|
95
95
  Lib.uloc_getDisplayName(@id, locale, buffer, buffer.size, status)
96
96
  end
97
97
  end
@@ -99,7 +99,7 @@ module ICU
99
99
  def display_script(locale = nil)
100
100
  locale = locale.to_s unless locale.nil?
101
101
 
102
- Lib::Util.read_uchar_buffer(64) do |buffer, status|
102
+ Lib::Util.read_uchar_buffer(128) do |buffer, status|
103
103
  Lib.uloc_getDisplayScript(@id, locale, buffer, buffer.size, status)
104
104
  end
105
105
  end
@@ -1,3 +1,4 @@
1
+ require 'date'
1
2
 
2
3
  module ICU
3
4
  module TimeFormatting
@@ -1,3 +1,3 @@
1
1
  module ICU
2
- VERSION = "0.1.10"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -93,6 +93,8 @@ module ICU
93
93
  end
94
94
 
95
95
  describe 'display' do
96
+ let(:locale_ids) { Locale.available.map(&:id) }
97
+
96
98
  context 'in a specific locale' do
97
99
  it 'returns the country' do
98
100
  Locale.new('de_DE').display_country('en').should == 'Germany'
@@ -111,13 +113,24 @@ module ICU
111
113
 
112
114
  it 'returns the script' do
113
115
  Locale.new('ja_Hira_JP').display_script('en').should == 'Hiragana'
114
- Locale.new('ja_Hira_JP').display_script('ru').should == 'Хирагана'
116
+ Locale.new('ja_Hira_JP').display_script('ru').should == 'хирагана'
115
117
  end
116
118
 
117
119
  it 'returns the variant' do
118
120
  Locale.new('be_BY_TARASK').display_variant('de').should == 'Taraskievica-Orthographie'
119
121
  Locale.new('zh_CH_POSIX').display_variant('en').should == 'Computer'
120
122
  end
123
+
124
+ # If memory set for 'read_uchar_buffer' is set too low it will throw an out
125
+ # of bounds memory error, which results in a Segmentation fault error.
126
+ it 'insures memory sizes is set correctly' do
127
+ # Currently, testing the longest known locales. May need to be update in the future.
128
+ Locale.new('en_VI').display_country('ccp').should_not be_nil
129
+ Locale.new('yue_Hant').display_language('ccp').should_not be_nil
130
+ Locale.new('en_VI').display_name('ccp').should_not be_nil
131
+ Locale.new('yue_Hant').display_script('ccp').should_not be_nil
132
+ Locale.new('en_US_POSIX').display_variant('sl').should_not be_nil
133
+ end
121
134
  end
122
135
 
123
136
  context 'in the default locale' do
metadata CHANGED
@@ -1,61 +1,67 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-icu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jari Bakken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2010-08-23 00:00:00.000000000 Z
11
+ date: 2019-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
- - - '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.9
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.0'
30
- - - '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.9
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.5'
40
+ - - ">="
38
41
  - !ruby/object:Gem::Version
39
42
  version: 2.5.0
40
43
  type: :development
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - ~>
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '2.5'
50
+ - - ">="
45
51
  - !ruby/object:Gem::Version
46
52
  version: 2.5.0
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: rake
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
51
- - - ~>
57
+ - - "~>"
52
58
  - !ruby/object:Gem::Version
53
59
  version: 0.9.2
54
60
  type: :development
55
61
  prerelease: false
56
62
  version_requirements: !ruby/object:Gem::Requirement
57
63
  requirements:
58
- - - ~>
64
+ - - "~>"
59
65
  - !ruby/object:Gem::Version
60
66
  version: 0.9.2
61
67
  description: Provides charset detection, locale sensitive collation and more. Depends
@@ -67,9 +73,9 @@ extra_rdoc_files:
67
73
  - LICENSE
68
74
  - README.md
69
75
  files:
70
- - .document
71
- - .gitignore
72
- - .travis.yml
76
+ - ".document"
77
+ - ".gitignore"
78
+ - ".travis.yml"
73
79
  - Gemfile
74
80
  - LICENSE
75
81
  - README.md
@@ -108,26 +114,27 @@ files:
108
114
  - spec/uchar_spec.rb
109
115
  - test.c
110
116
  homepage: http://github.com/jarib/ffi-icu
111
- licenses: []
117
+ licenses:
118
+ - MIT
112
119
  metadata: {}
113
120
  post_install_message:
114
121
  rdoc_options:
115
- - --charset=UTF-8
122
+ - "--charset=UTF-8"
116
123
  require_paths:
117
124
  - lib
118
125
  required_ruby_version: !ruby/object:Gem::Requirement
119
126
  requirements:
120
- - - '>='
127
+ - - ">="
121
128
  - !ruby/object:Gem::Version
122
129
  version: '0'
123
130
  required_rubygems_version: !ruby/object:Gem::Requirement
124
131
  requirements:
125
- - - '>='
132
+ - - ">="
126
133
  - !ruby/object:Gem::Version
127
134
  version: '0'
128
135
  requirements: []
129
136
  rubyforge_project:
130
- rubygems_version: 2.0.14
137
+ rubygems_version: 2.5.2.3
131
138
  signing_key:
132
139
  specification_version: 4
133
140
  summary: Simple Ruby FFI wrappers for things I need from ICU.