unicode-age 2.0.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2f4e83750edf8eb6f6ad414129d80b5b0af87fee
4
- data.tar.gz: 302e96a3019e6ebfe70552b3a16360f60abe589d
2
+ SHA256:
3
+ metadata.gz: 41dfa269310c6a6aeae245e24a6d13da8da678817ab138536a9cda89384b4cbd
4
+ data.tar.gz: 952907518f0e9aac1f6a60055327faa09d1709acb5efcd87c4fd9f5b72f5030c
5
5
  SHA512:
6
- metadata.gz: 2a719aeccd95f190234a7deb1099a610af069138bdc789a6f8b6c20add5085a1d4f5e662d669384d502409ead15953aeacdab3bad50bed71375da00b31147151
7
- data.tar.gz: b1a935e4bfd73e0af3651e8ec0e9e3b344735f889956cd1d4c5d38c9ce438d71142e4db8bccb85efd31bec8f9601000c91d460db8d6530bbaa7ebaa9cd676265
6
+ metadata.gz: ca2180ea50b01348befc40a5e24c4d3d6c46667942b29cf32e9fd8d5ede874e41cf56c5ed84c317dc288a197bd58dd2605fdb6e1e316270e9b545e3b28b59f43
7
+ data.tar.gz: bae1c10d360d1897566382251be813720a8aef9bd1b1ff4f0dcdafd6661bc43c194e13fe37a64749c73275b6cb0293431f1ad8b637ac25429b158d1bfed52126
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 2.3.0
4
+
5
+ * Support Unicode 13 (Ruby 3.1)
6
+
7
+ ### 2.2.0
8
+
9
+ * Support Ruby 3.0
10
+
11
+ ### 2.1.0
12
+
13
+ * Support Unicode 12.0 (Ruby 2.6.2), Unicode 12.1 (Ruby 2.6.3)
14
+
15
+ ### 2.0.1
16
+
17
+ * Support Unicode 11 (Ruby 2.6.1, 2.6.0)
18
+
3
19
  ### 2.0.0
4
20
 
5
21
  #### Breaking change
data/MIT-LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016-2017 Jan Lelis, mail@janlelis.de
1
+ Copyright (c) 2016-2021 Jan Lelis, https://janlelis.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Unicode::Age [![[version]](https://badge.fury.io/rb/unicode-age.svg)](http://badge.fury.io/rb/unicode-age) [![[travis]](https://travis-ci.org/janlelis/unicode-age.svg)](https://travis-ci.org/janlelis/unicode-age)
1
+ # Unicode::Age [![[version]](https://badge.fury.io/rb/unicode-age.svg)](https://badge.fury.io/rb/unicode-age) [![[ci]](https://github.com/janlelis/unicode-age/workflows/Test/badge.svg)](https://github.com/janlelis/unicode-age/actions?query=workflow%3ATest)
2
2
 
3
3
  A micromodule to detect which Unicode version is required to display a string.
4
4
 
@@ -10,23 +10,17 @@ Unicode::Age.of "🚡" # => 6.0
10
10
  Unicode::Age.of "🛲" # => 7.0
11
11
  Unicode::Age.of "🌮 " # => 8.0
12
12
  Unicode::Age.of "🛒" # => 9.0
13
+ Unicode::Age.of "🛷" # => 10.0
13
14
  Unicode::Age.of "\u{10FFFF}" # => nil
14
15
  Unicode::Age.of "\u{10FFFD}" # => 2.0
15
16
  ```
16
17
 
17
18
  Characters of status "Unassigned" (Unicode General Category of **Cn**) will raise a `Unicode::Age::UnknownAge` exception.
18
19
 
19
- **This is a breaking change:** In the current non-*pre* version of the gem on rubygems.org, unassigned characters will just return `nil`
20
-
21
20
  ## Supported Ruby/Unicode versions
22
21
 
23
- Ruby version | Unicode version
24
- -------------|----------------
25
- **2.4** | **9.0.0**
26
- **2.3** | **8.0.0**
27
- **2.2** | **7.0.0**
28
- **2.1** | **6.1.0**
22
+ See the [Unicode — Ruby version table at Idiosyncratic Ruby](https://idiosyncratic-ruby.com/73-unicode-version-mapping.html)
29
23
 
30
24
  ## MIT License
31
25
 
32
- Copyright (C) 2016-2017 Jan Lelis <http://janlelis.com>. Released under the MIT license.
26
+ Copyright (C) 2016-2021 Jan Lelis <https://janlelis.com>. Released under the MIT license.
data/Rakefile CHANGED
@@ -34,7 +34,11 @@ end
34
34
 
35
35
  desc "#{gemspec.name} | Spec"
36
36
  task :spec do
37
- sh "for file in spec/*.rb; do ruby $file; done"
37
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
38
+ sh "for %f in (spec/\*.rb) do ruby spec/%f"
39
+ else
40
+ sh "for file in spec/*.rb; do ruby $file; done"
41
+ end
38
42
  end
39
43
  task default: :spec
40
44
 
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Unicode
2
4
  module Age
3
- VERSION = "2.0.0".freeze
4
- UNICODE_VERSION = "10.0.0".freeze
5
+ VERSION = "2.3.0"
6
+ UNICODE_VERSION = "13.0.0"
5
7
  end
6
8
  end
7
9
 
data/lib/unicode/age.rb CHANGED
@@ -23,7 +23,11 @@ module Unicode
23
23
  7.0,
24
24
  8.0,
25
25
  9.0,
26
- 10.0
26
+ 10.0,
27
+ 11.0,
28
+ 12.0,
29
+ 12.1,
30
+ 13.0,
27
31
  ].freeze
28
32
 
29
33
  KNOWN_UNICODE_REGEXES = KNOWN_UNICODE_VERSIONS.map{ |uv|
@@ -34,7 +38,7 @@ module Unicode
34
38
  }.compact.freeze
35
39
 
36
40
  def self.of(string)
37
- raise(UnknownAge, "The string containts unassigned codepoints, so the Unicode version required cannot be determined. Your Ruby version supports Unicode #{UNICODE_VERSION}.") if string =~ /\A\p{Unassigned}*\z/
41
+ raise(UnknownAge, "The string contains unassigned codepoints, so the Unicode version required cannot be determined. This gem version supports Unicode upto version #{UNICODE_VERSION}.") if string =~ /\A\p{Unassigned}*\z/
38
42
  KNOWN_UNICODE_VERSIONS.find.with_index{ |uv, index|
39
43
  string =~ KNOWN_UNICODE_REGEXES[index]
40
44
  }
@@ -11,6 +11,7 @@ describe Unicode::Age do
11
11
  assert_equal 7.0, Unicode::Age.of("🛲 ") if RUBY_VERSION >= "2.2.0"
12
12
  assert_equal 8.0, Unicode::Age.of("🌮 ") if RUBY_VERSION >= "2.3.0"
13
13
  assert_equal 9.0, Unicode::Age.of("🛒 ") if RUBY_VERSION >= "2.4.0"
14
+ assert_equal 10.0, Unicode::Age.of("🛷 ") if RUBY_VERSION >= "2.5.0"
14
15
  end
15
16
 
16
17
  it "will raise Unicode::Age::UnknownAge exception for unassigned characters" do
data/unicode-age.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.summary = "Determine required Unicode version of a string."
9
9
  gem.description = "[Unicode #{Unicode::Age::UNICODE_VERSION}] A micromodule to detect which Unicode version is required to display a string."
10
10
  gem.authors = ["Jan Lelis"]
11
- gem.email = ["mail@janlelis.de"]
11
+ gem.email = ["hi@ruby.consulting"]
12
12
  gem.homepage = "https://github.com/janlelis/unicode-age"
13
13
  gem.license = "MIT"
14
14
 
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
+ gem.metadata = { "rubygems_mfa_required" => "true" }
19
20
 
20
- gem.required_ruby_version = "~> 2.0"
21
+ gem.required_ruby_version = ">= 2.0", "< 4.0"
21
22
  end
metadata CHANGED
@@ -1,25 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-age
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-19 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: "[Unicode 10.0.0] A micromodule to detect which Unicode version is required
13
+ description: "[Unicode 13.0.0] A micromodule to detect which Unicode version is required
14
14
  to display a string."
15
15
  email:
16
- - mail@janlelis.de
16
+ - hi@ruby.consulting
17
17
  executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - ".gitignore"
22
- - ".travis.yml"
23
22
  - CHANGELOG.md
24
23
  - CODE_OF_CONDUCT.md
25
24
  - Gemfile
@@ -35,24 +34,27 @@ files:
35
34
  homepage: https://github.com/janlelis/unicode-age
36
35
  licenses:
37
36
  - MIT
38
- metadata: {}
37
+ metadata:
38
+ rubygems_mfa_required: 'true'
39
39
  post_install_message:
40
40
  rdoc_options: []
41
41
  require_paths:
42
42
  - lib
43
43
  required_ruby_version: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.0'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '4.0'
48
51
  required_rubygems_version: !ruby/object:Gem::Requirement
49
52
  requirements:
50
53
  - - ">="
51
54
  - !ruby/object:Gem::Version
52
55
  version: '0'
53
56
  requirements: []
54
- rubyforge_project:
55
- rubygems_version: 2.6.11
57
+ rubygems_version: 3.2.22
56
58
  signing_key:
57
59
  specification_version: 4
58
60
  summary: Determine required Unicode version of a string.
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- sudo: false
2
- language: ruby
3
-
4
- script: bundle exec ruby spec/unicode_age_spec.rb
5
-
6
- rvm:
7
- - 2.4.0
8
- - 2.3.3
9
- - 2.2
10
- - 2.1
11
- - ruby-head
12
- - jruby-head
13
- - jruby-9.1.7.0
14
-
15
- cache:
16
- - bundler
17
-
18
- matrix:
19
- allow_failures:
20
- - rvm: jruby-head
21
- - rvm: jruby-9.1.7.0