aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-02-09 10:33:49 +0100
committerYves Senn <yves.senn@gmail.com>2015-02-09 10:33:49 +0100
commit300631e08f27ea65d93bc20a3eb55d75ed6a2405 (patch)
tree498516a117acf971f6f62d0390cadcf0b976d0c6 /railties/lib/rails/generators
parentb6dd0c4ddebf5e7aab0a669915cb349ec65e5b88 (diff)
parent39af02aa3c07ccb3c1872790741c16defd8d5c48 (diff)
downloadrails-300631e08f27ea65d93bc20a3eb55d75ed6a2405.tar.gz
rails-300631e08f27ea65d93bc20a3eb55d75ed6a2405.tar.bz2
rails-300631e08f27ea65d93bc20a3eb55d75ed6a2405.zip
Merge pull request #18840 from yuki24/remove-warning-from-plugin-generator
Remove warning from Plugin Generator
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/rails/plugin/plugin_generator.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
index ab050fc246..68c3829515 100644
--- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
+++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
@@ -317,9 +317,9 @@ task default: :test
@modules ||= namespaced_name.camelize.split("::")
end
- def wrap_in_modules(content)
- content = "#{content}".strip.gsub(/\W$\n/, '')
- modules.reverse.inject(content) do |content, mod|
+ def wrap_in_modules(unwrapped_code)
+ unwrapped_code = "#{unwrapped_code}".strip.gsub(/\W$\n/, '')
+ modules.reverse.inject(unwrapped_code) do |content, mod|
str = "module #{mod}\n"
str += content.lines.map { |line| " #{line}" }.join
str += content.present? ? "\nend" : "end"