I want to comment a line from a file (spec_helper.rb) using thor in my Rails 3 template?
from:
config.fixture_path = "#{::Rails.root}/spec/fixtures"
to
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
I know I can inject a line to a file using inject_into_file, but I would like to comment a line from the specified file.
Thanks!
You could use the Thor Action gsub_file
Example from the documentation
You have to adapt the regex and replacement string on your needs, but this should be possible.