Skip to content

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Jul 21, 2025

🌈


Following on from #877, this adds a bang version of insert_into_file and its alias

@@ -2,6 +2,38 @@

class Thor
module Actions
WARNINGS = {unchanged_no_flag: "File unchanged! Either the supplied flag value not found or the content has already been inserted!"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: moving this is good anyway because it was the subject of the method comment intended for insert_into_file 😅

@@ -20,6 +20,10 @@ def invoke!(*args, &block)
capture(:stdout) { invoker.insert_into_file(*args, &block) }
end

def invoke_with_a_bang!(*args, &block)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this seemed like the most straightforward, if a little whimsical, way of handling the tests

Happy to go with an alternative structure though if desired

@rafaelfranca rafaelfranca merged commit c049fb6 into rails:main Jul 21, 2025
9 checks passed
@G-Rath G-Rath deleted the new-inject-into-file-helper branch July 21, 2025 20:16
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