derailed / mongo3

Rule your mongoDB clusters!
http:///mongo3.com
443 stars 65 forks source link

Ruby 1.9 case Statements #1

Closed nickmabry closed 14 years ago

nickmabry commented 14 years ago

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!

nickmabry commented 14 years ago

Now works.

derailed commented 14 years ago

Thanks for looking into this Nick! I'll take a look at your changes and will merge with the latest base.

derailed commented 14 years ago

Closed