unicode-age 2.0.0 → 2.0.1
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 +5 -5
- data/.travis.yml +8 -7
- data/CHANGELOG.md +4 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +5 -2
- data/lib/unicode/age.rb +3 -2
- data/lib/unicode/age/version.rb +4 -2
- data/spec/unicode_age_spec.rb +1 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 504a0269e6357104b6ac5ec61ec78cb647b87a0549e3b02cddc31f171a5357d9
|
4
|
+
data.tar.gz: 68c0f40814a0de9401942cf17d4bc31d880f2e7c993a5ceced24a5f368441a8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b153714b4eb5af0aa8f88ee1fbd46f6b732c1feedba06def94edf05f9541c93fa59a165a0f8ebb0e18237e97418310cccd71efb731516fa2aec917d16dfd5d1
|
7
|
+
data.tar.gz: 91f14e6910f70101bf6b152c54ecbe7846981aeda91ef4d01b21c2812038052143b31df1342486f537b319d6872268876461ce54b566eca22ddc816ecffea286
|
data/.travis.yml
CHANGED
@@ -4,18 +4,19 @@ language: ruby
|
|
4
4
|
script: bundle exec ruby spec/unicode_age_spec.rb
|
5
5
|
|
6
6
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
7
|
+
- 2.6.0
|
8
|
+
- 2.5.3
|
9
|
+
- 2.4.5
|
10
|
+
- 2.3.8
|
9
11
|
- 2.2
|
10
12
|
- 2.1
|
11
13
|
- ruby-head
|
12
14
|
- jruby-head
|
13
|
-
- jruby-9.
|
14
|
-
|
15
|
-
cache:
|
16
|
-
- bundler
|
15
|
+
- jruby-9.2.5.0
|
17
16
|
|
18
17
|
matrix:
|
19
18
|
allow_failures:
|
19
|
+
- rvm: 2.2
|
20
|
+
- rvm: 2.1
|
20
21
|
- rvm: jruby-head
|
21
|
-
- rvm: jruby-9.
|
22
|
+
- rvm: jruby-9.2.5.0
|
data/CHANGELOG.md
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Unicode::Age [![[version]](https://badge.fury.io/rb/unicode-age.svg)](
|
1
|
+
# Unicode::Age [![[version]](https://badge.fury.io/rb/unicode-age.svg)](https://badge.fury.io/rb/unicode-age) [![[travis]](https://travis-ci.org/janlelis/unicode-age.svg)](https://travis-ci.org/janlelis/unicode-age)
|
2
2
|
|
3
3
|
A micromodule to detect which Unicode version is required to display a string.
|
4
4
|
|
@@ -10,6 +10,7 @@ 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
|
```
|
@@ -22,6 +23,8 @@ Characters of status "Unassigned" (Unicode General Category of **Cn**) will rais
|
|
22
23
|
|
23
24
|
Ruby version | Unicode version
|
24
25
|
-------------|----------------
|
26
|
+
**2.6** | **11.0.0**
|
27
|
+
**2.5** | **10.0.0**
|
25
28
|
**2.4** | **9.0.0**
|
26
29
|
**2.3** | **8.0.0**
|
27
30
|
**2.2** | **7.0.0**
|
@@ -29,4 +32,4 @@ Ruby version | Unicode version
|
|
29
32
|
|
30
33
|
## MIT License
|
31
34
|
|
32
|
-
Copyright (C) 2016-
|
35
|
+
Copyright (C) 2016-2018 Jan Lelis <http://janlelis.com>. Released under the MIT license.
|
data/lib/unicode/age.rb
CHANGED
@@ -23,7 +23,8 @@ module Unicode
|
|
23
23
|
7.0,
|
24
24
|
8.0,
|
25
25
|
9.0,
|
26
|
-
10.0
|
26
|
+
10.0,
|
27
|
+
11.0,
|
27
28
|
].freeze
|
28
29
|
|
29
30
|
KNOWN_UNICODE_REGEXES = KNOWN_UNICODE_VERSIONS.map{ |uv|
|
@@ -34,7 +35,7 @@ module Unicode
|
|
34
35
|
}.compact.freeze
|
35
36
|
|
36
37
|
def self.of(string)
|
37
|
-
raise(UnknownAge, "The string
|
38
|
+
raise(UnknownAge, "The string contains unassigned codepoints, so the Unicode version required cannot be determined. Your Ruby version supports Unicode #{UNICODE_VERSION}.") if string =~ /\A\p{Unassigned}*\z/
|
38
39
|
KNOWN_UNICODE_VERSIONS.find.with_index{ |uv, index|
|
39
40
|
string =~ KNOWN_UNICODE_REGEXES[index]
|
40
41
|
}
|
data/lib/unicode/age/version.rb
CHANGED
data/spec/unicode_age_spec.rb
CHANGED
@@ -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
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-age
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: "[Unicode
|
13
|
+
description: "[Unicode 11.0.0] A micromodule to detect which Unicode version is required
|
14
14
|
to display a string."
|
15
15
|
email:
|
16
16
|
- mail@janlelis.de
|
@@ -51,8 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '0'
|
53
53
|
requirements: []
|
54
|
-
|
55
|
-
rubygems_version: 2.6.11
|
54
|
+
rubygems_version: 3.0.1
|
56
55
|
signing_key:
|
57
56
|
specification_version: 4
|
58
57
|
summary: Determine required Unicode version of a string.
|