Skip to content
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

feat: support gsub_file erroring if gsub doesn't change anything, and add gsub_file! #877

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

G-Rath
Copy link

@G-Rath G-Rath commented Feb 23, 2024

🌈


This is a straw-person solution for #874 - overall I think it's not bad but expect changes to be requested; in particular, the option name is pretty verbose so happy if someone wants to suggest an alternative though to me really its about having gsub_file!.

A bonus to this is that anything using gsub_file also supports this behaviour such as comment_lines and uncomment_lines - I think it would be nice to have bang versions of such methods too but want to get the core behaviour/implementation nailed down first.

Resolves #874

@G-Rath
Copy link
Author

G-Rath commented Feb 29, 2024

@rafaelfranca can you let me know if you'd be interested in having bang methods for the other file manipulations? (either in this PR or another one)

@G-Rath G-Rath force-pushed the gsub_file-error-on-no-change branch from 8eae746 to 620b685 Compare February 29, 2024 19:10
@G-Rath
Copy link
Author

G-Rath commented May 3, 2024

@rafaelfranca could I get a re-review on this please?

@G-Rath
Copy link
Author

G-Rath commented Oct 8, 2024

@rafaelfranca would you mind re-reviewing this? we'd really like to get it landed and I think I've addressed your concerns 🙂

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

Successfully merging this pull request may close these issues.

Ability to have gsub_file error if it didn't gsub anything
2 participants