diff options
Diffstat (limited to 'railties/lib/rails_generator/generators')
| -rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 2 | ||||
| -rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index 795a0d7653..2c31d89538 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -151,7 +151,7 @@ class AppGenerator < Rails::Generator::Base def create_script_files(m) %w( about console dbconsole destroy generate runner server plugin - performance/benchmarker performance/profiler performance/request + performance/benchmarker performance/profiler ).each do |file| m.file "bin/#{file}", "script/#{file}", { :chmod => 0755, 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 |
