lib/unicode/age.rb in unicode-age-2.0.1 vs lib/unicode/age.rb in unicode-age-2.1.0

- old
+ new

@@ -23,20 +23,22 @@ 7.0, 8.0, 9.0, 10.0, 11.0, + 12.0, + 12.1, ].freeze KNOWN_UNICODE_REGEXES = KNOWN_UNICODE_VERSIONS.map{ |uv| begin /\A\p{age=#{"%.1f" % uv}}*\z/ rescue RegexpError end }.compact.freeze def self.of(string) - 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/ + 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/ KNOWN_UNICODE_VERSIONS.find.with_index{ |uv, index| string =~ KNOWN_UNICODE_REGEXES[index] } end end