diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-01-18 18:10:58 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-01-18 18:10:58 +0000 |
commit | 39e1ac658efc80e4c54abef4f1c7679e4b3dc2ac (patch) | |
tree | 78cc8f3aaecf75ea1fde4229170027e840eb9cd3 /railties/lib/rails_generator | |
parent | 085991891e610ed0ab616ce434eabf42a9437039 (diff) | |
download | rails-39e1ac658efc80e4c54abef4f1c7679e4b3dc2ac.tar.gz rails-39e1ac658efc80e4c54abef4f1c7679e4b3dc2ac.tar.bz2 rails-39e1ac658efc80e4c54abef4f1c7679e4b3dc2ac.zip |
Merge docrails
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb index bb7bd0e6f4..84e36ecc1b 100644 --- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb +++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb @@ -338,6 +338,12 @@ module Rails !yes?(question) end + # Run a regular expression replacement on a file + # + # ==== Example + # + # gsub_file 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1' + # def gsub_file(relative_destination, regexp, *args, &block) path = destination_path(relative_destination) content = File.read(path).gsub(regexp, *args, &block) @@ -366,4 +372,4 @@ module Rails end end -end
\ No newline at end of file +end |