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
I'm adding Skylight.io to a Hanami app. It uses stuff from ActiveSupport, but they avoid using Core Extensions (monkey patches). So, ActiveSupport is available, but the Inflector isn't used for the normal application. (It is used for their CLI, but that's not being loaded here.)
By itself, this should be fine, but Dry::Core::Inflector attempts to load 3 different back-end engines, in this order: ActiveSupport::Inflector, Dry::Inflector, Inflecto.
It first tries to require ActiveSupport::Inflector, which in this case succeeds, since activesupport is loaded. But, I don't actually want to load that :)
One way I was able to fix this was to change the order so dry-inflector is first, and add that to my Gemfile. This solves my problem, but I don't think we should be loading ActiveSupport::Inflector automatically. Some people use ActiveSupport without monkey patching, and we should encourage that. Maybe we could leverage it if it's already loaded, but not require it automatically here?
Happy to open a PR for this, just want to get everyone's thoughts before I move forward. I know this is an issue with ROM 3, since ROM 4 uses rom-support's Inflector, which is actually the apparent predecessor to the dry-core version I'm talking about now.
The text was updated successfully, but these errors were encountered:
cllns
changed the title
Dry::Core::Inflector requires ActiveSupport::Inflector
Dry::Core::Inflector requires ActiveSupport::Inflector
May 25, 2018
cllns
changed the title
Dry::Core::Inflector requires ActiveSupport::Inflector
Dry::Core::Inflector loads ActiveSupport::Inflector
May 25, 2018
In the title I meant that it requires ActiveSupport::Inflector, but that ticks don't show up in the title so I changed it to "loads", since that's more of what I mean (even though it's the require keyword haha).
I'm adding Skylight.io to a Hanami app. It uses stuff from ActiveSupport, but they avoid using Core Extensions (monkey patches). So, ActiveSupport is available, but the Inflector isn't used for the normal application. (It is used for their CLI, but that's not being loaded here.)
The trouble is that, when Hanami uses a repository, it calls
Dry::Core::Inflector.camelize(name)
through ROM.By itself, this should be fine, but
Dry::Core::Inflector
attempts to load 3 different back-end engines, in this order:ActiveSupport::Inflector
,Dry::Inflector
,Inflecto
.It first tries to require
ActiveSupport::Inflector
, which in this case succeeds, sinceactivesupport
is loaded. But, I don't actually want to load that :)One way I was able to fix this was to change the order so
dry-inflector
is first, and add that to myGemfile
. This solves my problem, but I don't think we should be loadingActiveSupport::Inflector
automatically. Some people useActiveSupport
without monkey patching, and we should encourage that. Maybe we could leverage it if it's already loaded, but not require it automatically here?Related:
Add Dry::Core::Inflector #8
Change inflector to one that doesn't monkey patch skylightio/skylight-ruby#121 I originally thought this was a bug in
skylight-ruby
, but it's a bug indry-core
.Happy to open a PR for this, just want to get everyone's thoughts before I move forward. I know this is an issue with ROM 3, since ROM 4 uses
rom-support
'sInflector
, which is actually the apparent predecessor to thedry-core
version I'm talking about now.The text was updated successfully, but these errors were encountered: