26 Nov '12, 2pm

The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists

The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists

The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists By Peter Cooper / November 26, 2012 That code is legal Ruby! If you ran it, you'd see 8 . How? There's a tale to tell.. The String with the Golden Space I was on IRC in #nwrug enjoying festive cheer with fellow Northern Rubyists when ysr23 presented a curious problem. He was using a Twitter library that returned a tweet, "@twellyme film" , in a string called reply . The problem was that despite calling reply.split , the string refused to split on whitespace. Yet if he did "@twellyme film".split in IRB, that was fine. International man of mystery Will Jessop suggested checking $; (it's a special global variable that defines the default separator for String#split ). It was OK. In an attempt to look smarter than I am, I suggested reply.method(:split).source_location to see if the String class had been monkey-p...

Full article: http://www.rubyinside.com/the-split-is-not-enough-whitesp...

Tweets

Unicode Whitespace Shenigans in Ruby

rubyflow.com 26 Nov '12, 3pm

Unicode Whitespace Shenigans in Ruby Posted by PeterCooper on November 26, 2012 — 1 comment It seems that sometimes.. the ...

Ruby5 Episode #325: Ruby Research, Async Airbra...

ruby5.envylabs.com 28 Nov '12, 12am

November 20, 2012 Crowd-funded door locks, cloud-hosted spreadsheets, fast key-value storage, faster tests, and lots of co...