Ruby 1.9 case Statements
nickmabry opened this issue · comments
Nick Mabry commented
It looks like mongo3 runs perfectly under ruby 1.9, but won't parse out-of-the-box. A few case statements in the collection, database, explore, and paths helpers are using the deprecated colon syntax, as in:
case( value.to_i )
when Mongo::ASCENDING : "asc"
when Mongo::DESCENDING : "desc"
else "n/a"
end
In 1.9, the colon has been eliminated, but the then
keyword still works:
case( value.to_i )
when Mongo::ASCENDING then "asc"
when Mongo::DESCENDING then "desc"
else "n/a"
end
I would fork or submit a patch, but I'm brand new to git and github and will need some time to learn how to use them. Thanks for the awesome work!
Nick Mabry commented
Now works.
Fernand Galiana commented
Thanks for looking into this Nick!
I'll take a look at your changes and will merge with the latest base.
Fernand Galiana commented
Closed