-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue #47] CLI naming clash when run under Bundler #48
[Issue #47] CLI naming clash when run under Bundler #48
Conversation
Fixes a load_path naming clash when `bin/approvals` is run under Bundler. Looks like it's picking up a different `CLI` lib from Thor instead of the `Approvals::CLI`. Verified by renaming `cli.rb` to something else & updating the `require` statement to avoid naming clash.
Feel free to choose a different name for the file, but expanding it out to Also, 👍 for this gem. Saved me a fair bit of effort w/ a hairy logic-filled Rails view refactor. |
Thanks for noticing :) This PR seems to shift the problem though. If someone has a commandline gem, this will break, right? I think the proper way would be to require 'approvals/cli' or 'approvals/commandline'. Since that's scoped within approvals it won't collide with anything (except perhaps hypothetical approval-plugins) |
Heh, cool. You discovered this gem to solve almost exactly the same usecase as I had to solve when I discovered it :) |
@markijbema This is true (re shifting problem). In retrospect, it was a I'll submit an updated PR :) |
Yeah, we should probably namespace it, but I want it to not live underneath the Everything under
|
…undler [Issue #47] CLI naming clash when run under Bundler
Thanks for fixing this! ❤️ |
I've released v0.0.14 |
😻 thanks for the super helpful gem! |
But isn't everything in lib/ 'global' over all gems? I was under the assumption that after loading a gem, everything there is requir-able. Therefore, lib/approvals is the only place where you can put files without conflicting with other gems. All this to the best of my understanding of ruby gems, please correct me if I'm wrong. |
It hadn't occurred to me, but when thinking about it, you're probably right. |
Based on what I saw w/ Bundler, it looks like anything in 'lib/*' is in the global path namespace. So to make sure to namespace reliably, it ought to be under I'll submit 2nd PR that puts it in |
The
Where there's a top-level How about just |
Fixes a load_path naming clash [#47] when
bin/approvals
is run under Bundler.Looks like it's picking up a different
CLI
lib from Thor instead of theApprovals::CLI
.Verified by renaming
cli.rb
to something else & updating therequire
statement to avoid naming clash.