You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The symbolize_keys method in lib/core_ext.rb is also defined with exactly the same name in the ActiveSupport gem in lib/active_support/core_ext/hash/keys.rb
Both add the method to Hash
If both gems are used, this can result in warnings like this:
....rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/core_ext/hash/keys.rb:54:
warning: method redefined; discarding old symbolize_keys
....rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-graphviz-1.2.2/lib/graphviz/core_ext.rb:28:
warning: previous definition of symbolize_keys was here
To avoid collisions, this method should only be defined if it doesn't already exist in Hash,
or consider naming it something else. (preferably with a namespace or at least starting with graphviz_ so it's unlikely to collide with any other gems.
The text was updated successfully, but these errors were encountered:
I came across this for a different angle. I've been running memory_profiler on a slow spec, and ruby-graphviz came up as one of the top gems allocating memory, and it came down to the symbolize_keys implementation.
The
symbolize_keys
method inlib/core_ext.rb
is also defined with exactly the same name in the ActiveSupport gem inlib/active_support/core_ext/hash/keys.rb
Both add the method to
Hash
If both gems are used, this can result in warnings like this:
To avoid collisions, this method should only be defined if it doesn't already exist in Hash,
or consider naming it something else. (preferably with a namespace or at least starting with
graphviz_
so it's unlikely to collide with any other gems.The text was updated successfully, but these errors were encountered: