datacite / omniauth-orcid

ORCID Strategy for OmniAuth
MIT License
9 stars 9 forks source link

Using Hash#dig only works in Ruby 2.3.x or later #11

Closed sfisher closed 6 years ago

sfisher commented 7 years ago

We ended up having to upgrade Ruby to use this gem because the method #dig is not present until the Ruby 2.3 series and later. We were running Ruby 2.2.x. Dig forced an upgrade to Ruby (which then forced an upgrade to Rails because of an Integer bug in the version of Rails on a newer Ruby version).

The documentation even shows the use of Ruby 1.9.3 (where Hash#dig doesn't work).

== Sinatra/1.3.2 has taken the stage on 4567 for development with backup from WEBrick
[2012-11-26 21:41:08] INFO  WEBrick::HTTPServer#start: pid=8383 port=4567

You may want to rethink using this new Hash core library feature if you want better compatibility with other versions of Ruby or else declare Ruby 2.3+ as a dependency for people looking to use the gem.

mfenner commented 7 years ago

Thank you. Looking at https://www.ruby-lang.org/en/downloads/branches/, it seems reasonable to require Ruby 2.2, but not 2.3. It is easy to revert that change. And I need to update the documentation (which is from 2012).

sfisher commented 7 years ago

Thanks, Martin.

nicolasfranck commented 6 years ago

I added the gem ruby_dig to make this method work.

nicolasfranck commented 6 years ago

https://github.com/datacite/omniauth-orcid/pull/13

mfenner commented 6 years ago

Closed via #13.