XPath function translate converted to support characters
Comparing indexed strings against numbers was changed to compare slices against strings.
Encoding specific tests were changed as necessary to specify the encoding expected.
Other language changes:
{"a","b"} no longer supported, converted to {"a"=>"b"}
Array.to_s now contains square brackets, quotes, and commas. Array.join used instead when join semantics is required.
Colon is no longer accepted as an alternative to then in when statements.
Renamed variables when necessary to prevent warning message when a block variable shadowed a local variable. The idiom var = array.find {|var| ...} now requires the block variable to be named differently than the local variable. REXML also has a few places where block variables were set to nil immediately outside of the block “for performance reasons”. In a few cases, for node in nodeset was replaced with nodeset.each do |node|
An instance variable which previously wasn’t initialized now explicitly initialized to false
Added a sleep in a threaded sax/socket test to prevent a race condition.
REXML changes:
Substitution of entities was done in a single pass, this meant that entity values whose value referenced other entities would only get fully expanded if the order of the hash matched the order of evaluation.
get_attribute_ns('','a') previously matched both an attribute named a, and xmlns:a. Which one returned depended on the order of a hash. Changed the method to only select a.
One regular expression which had explicitly specified /u for unicode changed to not be unicode: this was the regular expression matching the xml prolog declaration itself which must be matched against bytes.
Added a unit test for 110 and tests and fixes for 123, 127.
Renamed variables when necessary to prevent warning message when a block variable shadowed a
local variable. The idiom var = array.find {|var| ...} now requires the block variable to be
named differently than the local variable.
A good trick is to prefix the inner variable with the “_” character. It goes fast and is informative. So in that example, it would give: var = array.find {|_var| ...}
I refer to Sam Ruby’s massive patch to make REXML work properly with the latest Ruby. I’ve long disliked REXML (see here and here ), but it’s here and it works. Only the way it works changed in 1.9, and there were some horrible regressions, and it...
In Getting Code Ready for Ruby 1.9, James Edward Gray II is attempting to put together a comprehensive blog post on the various things you need to do to migrate your Ruby 1.8 code over to working on Ruby 1.9. So far, James only looks at a handful of...
Tor Norbye: Ruby Screenshot of the Week #26: Ruby 1.9 Changes - hashes and case statements
Ruby 1.9 has been released . It’s a “development” version meaning that you wouldn’t want to use it in production, but now is a good time to learn the new ways of doing things such that migrating to Ruby 2.0 will be easier. Via Ruby Inside...
We’ve been here before. So here’s the scenario: You’re feeding medium-to-large chunks of XML out of one Rails app, to be consumed by another via ActiveResource . Maybe those chunks have embedded HTML, or maybe they’re an...
formal argument cannot be an instance variable: In ruby1.8 it’s possible to use an instance variable as a block argument: class Foo attr_accessor :bar def test [1,2,3].each {|@bar| } # @bar will be 3 here end end This no longer...
Ruby 1.9.1 Preview Released: Why This Is A Big Deal
In an understated post on the official Ruby blog last night, Yugui (Yuki Sonoda) announced the release of Ruby 1.9.1-preview 1. Why To Get Excited A preview release? Why is this a big deal? A few reasons why Ruby 1.9.1 is significant, even as a...