Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Since v3.5.4 it is no longer possible to call Hashie::Mash= more than once with the same key #413
Since 3.5.4 it is no longer possible to assign a value to a key more than once:
require 'hashie' foo = Hashie::Mash.new foo['foobar'] = Array.new foo['foobar'] = Array.new
The issue is that fc4f6e2 changed the code that logs warnings to use
The documentation for
When the warning logger is invoked it calls
I think the previous version of this worked because
Sorry I didn't submit one with this issue, I was a bit tired after investigating this!
I might be able to, but I might be missing a bit of context about this feature. Is this only supposed to warn about methods that are defined on the mash or it's subclasses? If the performance overhead was coming from the overhead of
Yeah, it's supposed to throw a warning when you set a key that collides with a built-in method. I think the cache is probably going to be the way to go. I have a failing test and will try to carve out some time to work on it tonight. Otherwise I'll look before I head in to work in the morning.
added a commit
Feb 24, 2017
referenced this issue
Feb 24, 2017
I tried using a Set to memoize the method set on initialization. Hashie performance stayed the same, but it caused a 50% performance regression in OmniAuth. I ended up going a different way, as seen in #415.
Here are the benchmark results with the Set change, for reference: