-
Notifications
You must be signed in to change notification settings - Fork 34
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
Shim of the mime-types gem #6
Comments
I am totally comfortable documentation for this in the readme 👍 but feel like the "ninja" redirection belongs in a "ninja" redirection gem. Also we got to apply pressure on rest-client and capybara, mail have already accepted the change. Strongly recommend getting actual PRs going for capybara and rest-client to move this along. At the moment rest-client/rest-client#557 needs some love to get it working again, but it did sit in the queue forever, not sure what the state is for capybara? and updates about it? |
I agree, but the problem is, I don't think it can be done. The reason is, some random gem's gemspec will have |
I follow, I just mean put all the hacks into one gem (that is not this gem) that way as time passes by and people fix stuff we don't need to carry around and maintain the redirector code. |
just opened the PR on capybara: teamcapybara/capybara#1884 |
And it's merged. @SamSaffron, do you want help rebasing rest-client/rest-client#557 ? |
Absolutely @Fryguy that would be awesome! |
This is a good idea but the problem really lies with how Gemfiles works. It would be far superiour to be able to alias gems so that you could force a specific name to redirect to another gem transparently. This is discussed here: rubygems/rubygems#1746 |
Oh thanks for the bump...I totally forgot I offered to update the rest-client PR 😂 So the "hack" didn't work 100%, though I can't remember the edge case issue, and that's why we haven't moved forward on making it a real gem...not to mention that it got lower priority than other things we've been working on. @NickLaMuro, do you remember the details on what the issue was with our shim? |
Part of it was actually a Which was particular to our setup with multiple git branch based plugins and those plugins in turn symlinking/sourcing the main repo in the plugin repos when working on them in development. I think we got that ironed out at this point, and I am not sure of any other issues that have come about because of it. Might have been something else, but I forget.
@ioquatix Indeed, but has the problem of also requiring another feature be added to rubygems just for that solution to work. Not saying it isn't more elegant, but requires more hoops to jump through for that to come to fruition. Been a bit since I worked on this, but I also think the API from |
I understand where you are coming from. It's just my style of software engineering to solve the core problems elegantly rather than hacks, because over time accumulation of elegant solutions is far preferable to accumulation of hacks. IMHO :) |
FWIW, we've moved the code into a dedicated repo, if anyone is interested. In our app, we've built this as a replacement mime-types gem and host it on our custom gem server. https://github.com/ManageIQ/mime-types-redirector |
In ManageIQ, we've found a way to "stub" out any mime-types gem references, and redirect through to mini_mime. This gives us the savings from mini_mime, even for gems that don't yet directly use it (in our case,
rest-client
,mail
, andcapybara
).The PR that does this is in our app is here: https://github.com/ManageIQ/manageiq/pull/14525/files . Essentially what we've done is create a "fake" mime-types gem, then in our Gemfile point to the fake .gemspec file. The "fake" mime-types gem is basically a thin wrapper around mini_mime with the interface of mime_types.
Is this something you'd be interested in for the mini_mime gem? I know we can't actually publish the fake mime-types gem, but my thought is that it's possible to put the .gemspec and the fake class in mini_mime, and then give instructions in the README on how a user might go about changing their Gemfile to point to the .gemspec file provided. Something roughly like:
README
If you would like all references to mime-types to instead be redirected though mini_mime, include the following in your Gemfile:
The text was updated successfully, but these errors were encountered: