Closed Kris-LIBIS closed 9 years ago
BTW I added a spec for the indifferent access behaviour, of course.
Hmm, your change doesn't work on MRI 1.9.3 or JRuby in 1.9 mode. Perhaps []= was added to OpenStruct in 2.0?
MRI 1.9.x support has ended, but the stable version of JRuby is still pretty entrenched in 1.9 mode in its stable branch (JRuby 9000 is not yet "stable").
Also, thank you for adding clear and concise specs, it is much appreciated. =)
OK, thanks for letting me know. I'll look into it, tomorrow.
I added the missing setter method. And as I was working, I also added the other methods that were introduced in Ruby 2.0's OpenStruct.
Thanks. When will you release a new version? I’d like to update my own gem, but it currently fails due to this issue.
From: William (B.J.) Snow Orvis [mailto:notifications@github.com] Sent: woensdag 20 mei 2015 05:50 To: aetherknight/recursive-open-struct Cc: Kris Dekeyser Subject: Re: [recursive-open-struct] Reinstates indifferent access behaviour (#33)
Merged #33https://github.com/aetherknight/recursive-open-struct/pull/33.
— Reply to this email directly or view it on GitHubhttps://github.com/aetherknight/recursive-open-struct/pull/33#event-309141483.
I was planning to cut a release last night, but I tried to fix #29 first. I thought i had a solution but I ran into some additional problems after I performed some exploratory testing late last night.
I will cut a release by tonight with your fix. Thanks. When will you release a new version? I’d like to update my own gem, but it currently fails due to this issue.
From: William (B.J.) Snow Orvis [mailto:notifications@github.com] Sent: woensdag 20 mei 2015 05:50 To: aetherknight/recursive-open-struct Cc: Kris Dekeyser Subject: Re: [recursive-open-struct] Reinstates indifferent access behaviour (#33)
Merged #33https://github.com/aetherknight/recursive-open-struct/pull/33.
— Reply to this email directly or view it on GitHub< https://github.com/aetherknight/recursive-open-struct/pull/33#event-309141483>.
— Reply to this email directly or view it on GitHub https://github.com/aetherknight/recursive-open-struct/pull/33#issuecomment-103917729 .
This fixes issue #32.
Note that indifferent access is implemented differently than Rails' version. My implementation may have a small performance hit, but it has the advantage that the hash keys are not all transformed into strings like in Rails. This prevents unnecessary diffs in roundtripping (e.g. loading from YAML file and saving back).