Skip to content

The String.to_camel_case patch collides with the patch from another gem #67

@eric-christian

Description

@eric-christian

Hello :)

Describe the bug
Today we encountered a situation where two gems are patching the same core class with the same method. badum-ching
They Adyen gem and the aquarium gem are both patching the method to_camel_case into String.
While both seem to have the same intention, the behavior varies slightly regarding the first character.
One gem wants it as upper-case, the other one as lower-case.

We end up with the current exception: aquarium/aspects/advice.rb:281:in const_get': wrong constant name noAdviceChainNode (NameError)`

Notice the lower-case 'n' in the name of a const.

Expected behavior
The expected behavior would be to not have the method to_camel_case in the core String class at all. It would be best not to patch core classes at all within a gem. You never know who else might come up with the same idea for a method name.

Desktop (please complete the following information):

  • ruby Version: 2.6.3
  • adyen gem Version: 4.1.0
  • aquarium gem Version: 0.7.1

Additional context
A quick search didn't reveal any usage of to_camel_case. Is it actually used? Can we simply remove it?
I'll also open an issue at the aquarium gem.

Best regards,
Eric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions