unicode-age 1.0.0 → 1.0.1

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: a2c8e1e8416c898127a6082bbaf285368937ce3b
4
- data.tar.gz: 4efb62d71b009a46c7d9bd560725976b309195d3
3
+ metadata.gz: 5c5cc3c3abd30c8572e612824fa4eb2bafca0f09
4
+ data.tar.gz: 381569a79f4b1d08f51e3bafd8ecc86de9a8e19d
5
5
  SHA512:
6
- metadata.gz: b281c57aa5db7f8a718baabd968b0b513fb6970ee6a92d0f6d6976cb1fe68df32381a2dcdee6d8335efcbed3cf053881e7cfbbf7c76393a7d9e72ca2b9537755
7
- data.tar.gz: 3361b9267a41d94716ad80f166a187ba5fc21d6da47669c8dbbb2b5a76315347950aa1524b76bf113da5a8f3dc2cd23a3476966ce6acfc682bdbef0355353b29
6
+ metadata.gz: 172016091f8f1df92d4fc3f076aafc6d1ed7448d121082e4aec2a0175ee16a45eeefed552b68160f833f638210d4b3c5e743ef47033bf05f2747257abc1e6728
7
+ data.tar.gz: 4db8b392cd5dce76d1453a38b05f8f3815c78bc9d7f8ce444654871776bdc320b9cf49b38370b9264264e44b58d6dd8abe61e8e7844bf26ed33618b9a80556ff
@@ -15,5 +15,8 @@ rvm:
15
15
  cache:
16
16
  - bundler
17
17
 
18
- # matrix:
19
- # fast_finish: true
18
+ matrix:
19
+ allow_failures:
20
+ - rvm: jruby-head
21
+ - rvm: jruby-9.0.5.0
22
+ - rvm: rbx-2
@@ -1,5 +1,9 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.0.1
4
+
5
+ * Fix for Ruby 2.2, 2.1
6
+
3
7
  ### 1.0.0
4
8
 
5
9
  * Inital release
data/README.md CHANGED
@@ -15,7 +15,13 @@ Unicode::Age.of "\u{10FFFD}" # => 2.0
15
15
 
16
16
  Characters of status "Unassigned" (Unicode General Category of **Cn**) will return `nil`.
17
17
 
18
- Unicode version: **8.0.0**
18
+ ## Supported Ruby/Unicode versions
19
+
20
+ Ruby version | Unicode version
21
+ -------------|----------------
22
+ **2.3** | **8.0.0**
23
+ **2.2** | **7.0.0**
24
+ **2.1** | **6.1.0**
19
25
 
20
26
  ## MIT License
21
27
 
@@ -22,10 +22,17 @@ module Unicode
22
22
  8.0,
23
23
  ].freeze
24
24
 
25
+ KNOWN_UNICODE_REGEXES = KNOWN_UNICODE_VERSIONS.map{ |uv|
26
+ begin
27
+ /\A\p{age=#{"%.1f" % uv}}*\z/
28
+ rescue RegexpError
29
+ end
30
+ }.compact.freeze
31
+
25
32
  def self.of(string)
26
33
  return nil if string =~ /\A\p{Unassigned}*\z/
27
- KNOWN_UNICODE_VERSIONS.find{ |uv|
28
- string =~ Regexp.compile('\A\p{age=%.1f}*\z' % uv)
34
+ KNOWN_UNICODE_VERSIONS.find.with_index{ |uv, index|
35
+ string =~ KNOWN_UNICODE_REGEXES[index]
29
36
  }
30
37
  end
31
38
  end
@@ -1,6 +1,6 @@
1
1
  module Unicode
2
2
  module Age
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.0.1".freeze
4
4
  UNICODE_VERSION = "8.0.0".freeze
5
5
  end
6
6
  end
@@ -8,8 +8,8 @@ describe Unicode::Age do
8
8
  assert_equal 3.0, Unicode::Age.of("ℜսᖯʏ")
9
9
  assert_equal 3.1, Unicode::Age.of("ℜ𝘂ᖯʏ")
10
10
  assert_equal 6.0, Unicode::Age.of("🚡")
11
- assert_equal 7.0, Unicode::Age.of("🛲")
12
- assert_equal 8.0, Unicode::Age.of("🌮 ")
11
+ assert_equal 7.0, Unicode::Age.of("🛲") if RUBY_VERSION >= "2.2.0"
12
+ assert_equal 8.0, Unicode::Age.of("🌮 ") if RUBY_VERSION >= "2.3.0"
13
13
  end
14
14
 
15
15
  it "returns nil for unassigned codepoints" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-age
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.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: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A micromodule to detect which Unicode version is required to display
14
14
  a string.
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  version: '0'
52
52
  requirements: []
53
53
  rubyforge_project:
54
- rubygems_version: 2.5.1
54
+ rubygems_version: 2.6.3
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: Determine required Unicode version of a string.