aetherknight / recursive-open-struct

OpenStruct subclass that returns nested hash attributes as RecursiveOpenStructs
Other
276 stars 54 forks source link

Use modifiable? (thanks to Ben Langfeld) #64

Closed pravi closed 4 years ago

pravi commented 4 years ago

This fixes #62 and brings ruby 2.7 compatibility

benlangfeld commented 4 years ago

See also https://github.com/aetherknight/recursive-open-struct/pull/63

benlangfeld commented 4 years ago

@pravi You'll need to alias if the method doesn't exist for backward compatibility with old rubies, unless @aetherknight is happy to drop support for EOL rubies (< 2.4).

cben commented 4 years ago

For others looking: This is an internal OpenStruct method, was renamed and made private in https://github.com/ruby/ruby/commit/7c89ca5431c370496e0f1ee3761781e6d74e57b4 since 2.4.0.
But that commit still aliased to old names. Those aliases were removed in https://github.com/ruby/ruby/commit/dbcc224f3883c810049ef620fac8a1b59bde2e69 since 2.7.0.

If you want to support both, could test respond_to?(:modifiable?, true).

matti commented 4 years ago

how could we get this moving? the best k8s client 2.7 support depends on this

aetherknight commented 4 years ago

I'm happy to drop support for unsupported versions of Ruby/JRuby. It looks like this change works fine on 2.4 and later, so I'll get this merged and get a release out soon.

aetherknight commented 4 years ago

I just released v1.1.1 which incorporates this PR, plus continues to support older Ruby versions. (JRuby's stable release still tracks 2.3.x features)