"Mongolian Vowel Separator" is not considered whitespace after Ruby 2.2 - #9
Merged
Merged
Conversation
Compiling generates "lib/fast_blank.bundle", which should not be checked in.
Contributor
Author
|
Ugh, apparently I lied about Rubinius. I assume it doesn't like the |
[Ruby Issue 9092](https://bugs.ruby-lang.org/issues/9092) updated Ruby from Unicode 6.1 to Unicode 7.0 ([commit here](ruby/ruby@64c81e4#diff-67d181a69374a75e4b8f706fa9b81fbc)). This patch was included in Ruby 2.2. From the [Unicode 6.3.0 release notes](http://www.unicode.org/versions/Unicode6.3.0/): The General_Category property value of U+180E MONGOLIAN VOWEL SEPARATOR has been changed from Zs to Cf. The values of other related properties such as Bidi_Class, White_Space, and Other_Default_Ignorable_Code_Point have been updated accordingly. After 2.2 shipped, Ruby's [[:space:]] Regexp expression [no longer matches U+180E](https://github.com/ruby/ruby/blob/9fefa6063797f94704c09663db13cea9e390eaba/enc/unicode/name2ctype.h#L2740-L2753). This updates fast_blank to treat U+180E properly in blank_as? Prior to this change, the tests fail on 2.2.2: 1) String provides a parity with active support function Failure/Error: expect("#{i.to_s(16)} #{c.blank_as?}").to eq("#{i.to_s(16)} #{c.blank2?}") - expected: "180e false" got: "180e true" - (compared using ==) # ./spec/fast_blank_spec.rb:22:in `block (3 levels) in <top (required)>' # ./spec/fast_blank_spec.rb:19:in `times' # ./spec/fast_blank_spec.rb:19:in `block (2 levels) in <top (required)>' It now passes on all the Rubies in the Travis matrix (RBX, 1.9, 2.0, 2.1, and 2.2).
tjschuck
force-pushed
the
mongolian_vowel_separator
branch
from
August 2, 2015 04:24
3e71e6b to
9cf94b4
Compare
Contributor
Author
|
Okay, after some rejiggering, this now also works on Rubinius. In hindsight, I suppose a better title for this PR is "Adds Support for Ruby 2.2.2". But now you know all about Mongolian vowel separators ¯\_(ツ)_/¯ |
Owner
|
awesome, thanks for your hard work! |
SamSaffron
added a commit
that referenced
this pull request
Aug 3, 2015
"Mongolian Vowel Separator" is not considered whitespace after Ruby 2.2
Owner
|
pushed a version 1.0.0 of fast_blank ... it deserves stable been in production for so long :) |
Merged
|
Woot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruby Issue 9092 updated Ruby from Unicode 6.1 to Unicode 7.0 (commit here). This patch was included in Ruby 2.2.
From the Unicode 6.3.0 release notes:
After 2.2 shipped, Ruby's
[[:space:]]Regexp expression no longer matches U+180E.This updates
fast_blankto treat U+180E properly inblank_as?.Prior to this change, the tests fail on 2.2.2:
It now passes on all the Rubies in the Travis matrix (RBX, 1.9, 2.0, 2.1, and 2.2).