Skip to content

Make all pin* methods behave conventionally the same #72

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

Closed
wants to merge 2 commits into from

Conversation

radiantshaw
Copy link
Contributor

@radiantshaw radiantshaw commented Nov 21, 2021

Please read #66 and #67 to know the background behind why this PR is raised.

This PR replaces pin_all_from with pin_under which has the same thinking behind it as the pin method. Moreover, the pin_under method utilizes the Rails.application.config.assets.paths to figure out the files needed to be pinned, so that one does not have to specify the folder name from the Rails' root.

There's one thing which is remaining, that is when you specify just the folder name to pin_all_from:

pin_all_from "app/assets/javascripts"

it will pin all the files inside the app/assets/javascripts folder automatically, which I'm not sure how to do so with pin_under; so any and all suggestions are welcome. My idea was to have another method called pin_all which will only take one parameter, e.g. "app/assets/javascript" (from the Rails' root), and will do the job of pinning everything under that folder.

Also, feel free to suggest any changes and I'll be more than happy to do so.

@dhh
Copy link
Member

dhh commented Feb 19, 2022

Appreciate the work on this, but we're not going to change the API now. But I would take a PR that more clearly explained how what we have now works, based on your understanding 👍

@dhh dhh closed this Feb 19, 2022
@radiantshaw
Copy link
Contributor Author

@dhh Sure. I can work on updating the documentation. But just out of curiosity, is there any plan for updating the API in future versions? Maybe we can keep the pin_all_from method and just do an addition to the existing API with pin_under?

Please note that this is in no way an intention to force merge code which you don't want to do. But I'm just curious about the roadmap and how the package should evolve.

@dhh
Copy link
Member

dhh commented Feb 19, 2022

No worries. I didn't find the proposed API simpler, tbh. Possible I'm just thinking of it a different way. But I don't see us changing this going forward at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants