ruby - How can I remove a line in one file on Rails? -
i trying remove line in 1 file on rails. found method gsub_file, undefined method in rails 4. it's reverse method of insert_into_file of thor.
e.g.) app/assets/stylesheets/application.css
before
*= require_tree . <- needs removed! *= require_self
after
*= require_self
this should performed in rails application template.
if implementing application template (for use rails new myapp -m
option), try using thor gsub_file
, this:
gsub_file 'app/assets/stylesheets/application.css', /*= require_tree .\n/, ""
take @ rails_apps_composer gem if you'd see lots of file manipulation using thor.
Comments
Post a Comment