talentbox-unidecoder 1.1.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a9867025d3ae41e6891829ae32288906f3ea885a2ccc08786f6586e1baedc94a
4
+ data.tar.gz: 4df0e90535d4212742b659ad4d701e85c8d05223400718b1fa0fbb4174652337
5
+ SHA512:
6
+ metadata.gz: 15089687cab6315c9210b0b0bd53421f94dc3e388e44807c3af6b3a0b301b818476c1ebf35c362bef8c485c27dec51bf79b8265e4a34d15b3b4e838ded80bcc5
7
+ data.tar.gz: 1d420ae996592028c0c9014f7e83c4d4ca8b404eb9ccda77384c39e3435a9b5e5f3f3291b3ce8a8066ae5aabadc9b9954183a294348647a14d3fce3e3518e64c
data/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unidecoder Changelog
2
2
 
3
+ ## 2.0.0 2021-10-19
4
+
5
+ * Drop usage of unicode/activesupport normalize in favor of Ruby's String#unicode_normalize
6
+
3
7
  ## 1.1.1 2010-08-11
4
8
 
5
9
  * Added some missing transliterations.
data/README.md CHANGED
@@ -25,10 +25,12 @@ Perl module.
25
25
 
26
26
  ## Extra stuff
27
27
 
28
- If you also install either the [Unicode](http://github.com/blackwinter/unicode)
28
+ ~If you also install either the [Unicode](http://github.com/blackwinter/unicode)
29
29
  **or** [Active Support](http://github.com/rails/rails) gems, Unidecoder will
30
30
  also perform Unicode normalization before attempting to transliterate strings
31
- to ASCII.
31
+ to ASCII.~
32
+
33
+ Starting with version 2.0.0 this gem requires >= 2.6 as it depends on Ruby's `String#unicode_normalize`.
32
34
 
33
35
  ## Warnings
34
36
 
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
1
  require "rake"
2
2
  require "rake/testtask"
3
- require "rake/gempackagetask"
3
+ require 'rubygems/package_task'
4
4
  require "rake/clean"
5
5
 
6
6
  task :default => :test
7
7
 
8
8
  CLEAN << "pkg" << "doc" << "coverage" << ".yardoc"
9
- Rake::GemPackageTask.new(eval(File.read("unidecoder.gemspec"))) { |pkg| }
9
+ Gem::PackageTask.new(eval(File.read("unidecoder.gemspec"))) { |pkg| }
10
10
  Rake::TestTask.new(:test) { |t| t.pattern = "test/**/*_test.rb" }
11
11
 
12
12
  begin
@@ -1,8 +1,8 @@
1
1
  module Unidecoder
2
2
  module Version
3
- MAJOR = 1
4
- MINOR = 1
5
- TINY = 2
3
+ MAJOR = 2
4
+ MINOR = 0
5
+ TINY = 0
6
6
  BUILD = nil
7
7
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
8
8
  end
data/lib/unidecoder.rb CHANGED
@@ -60,19 +60,10 @@ module Unidecoder
60
60
  "#{code_group(unpacked)}.yml (line #{grouped_point(unpacked) + 2})"
61
61
  end
62
62
 
63
- def define_normalize(library = nil, &block)
64
- return if method_defined? :normalize
65
- begin
66
- require library if library
67
- define_method(:normalize, &block)
68
- rescue LoadError
69
- end
63
+ def normalize(str)
64
+ str.unicode_normalize(:nfc)
70
65
  end
71
66
 
72
- define_normalize("unicode") {|str| Unicode.normalize_C(str)}
73
- define_normalize("active_support") {|str| ActiveSupport::Multibyte::Chars.new(str).normalize(:c).to_s}
74
- define_normalize {|str| str}
75
-
76
67
  def decode_char(char)
77
68
  unpacked = char.unpack("U")[0]
78
69
  CODEPOINTS[code_group(unpacked)][grouped_point(unpacked)]
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talentbox-unidecoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
5
- prerelease:
4
+ version: 2.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Russell Norris
@@ -10,7 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2011-11-09 00:00:00.000000000 Z
12
+ date: 2021-10-19 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: A port of Perl's Unidecoder to Ruby. Transliterates Unicode strings to
16
15
  an ASCII approximation.
@@ -21,14 +20,10 @@ executables: []
21
20
  extensions: []
22
21
  extra_rdoc_files: []
23
22
  files:
24
- - lib/unidecoder/version.rb
25
- - lib/unidecoder.rb
26
23
  - Changelog.md
27
24
  - README.md
28
25
  - Rakefile
29
- - test/unicode_point_suite/basic_latin_test.rb
30
- - test/unicode_point_suite/codepoint_test_helper.rb
31
- - test/unidecoder_test.rb
26
+ - lib/unidecoder.rb
32
27
  - lib/unidecoder/data/x00.yml
33
28
  - lib/unidecoder/data/x01.yml
34
29
  - lib/unidecoder/data/x02.yml
@@ -209,30 +204,33 @@ files:
209
204
  - lib/unidecoder/data/xfd.yml
210
205
  - lib/unidecoder/data/xfe.yml
211
206
  - lib/unidecoder/data/xff.yml
212
- homepage: http://github.com/norman/unidecoder
213
- licenses: []
207
+ - lib/unidecoder/version.rb
208
+ - test/unicode_point_suite/basic_latin_test.rb
209
+ - test/unicode_point_suite/codepoint_test_helper.rb
210
+ - test/unidecoder_test.rb
211
+ homepage: http://github.com/TalentBox/unidecoder
212
+ licenses:
213
+ - MIT
214
+ metadata: {}
214
215
  post_install_message:
215
216
  rdoc_options: []
216
217
  require_paths:
217
218
  - lib
218
219
  required_ruby_version: !ruby/object:Gem::Requirement
219
- none: false
220
220
  requirements:
221
- - - ! '>='
221
+ - - ">="
222
222
  - !ruby/object:Gem::Version
223
- version: '0'
223
+ version: '2.6'
224
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
- none: false
226
225
  requirements:
227
- - - ! '>='
226
+ - - ">="
228
227
  - !ruby/object:Gem::Version
229
228
  version: '0'
230
229
  requirements: []
231
- rubyforge_project: ! '[none]'
232
- rubygems_version: 1.8.10
230
+ rubygems_version: 3.2.16
233
231
  signing_key:
234
- specification_version: 3
232
+ specification_version: 4
235
233
  summary: Transliterates Unicode strings to an ASCII approximation.
236
234
  test_files:
237
- - test/unicode_point_suite/basic_latin_test.rb
238
235
  - test/unidecoder_test.rb
236
+ - test/unicode_point_suite/basic_latin_test.rb