We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b6dd0c4 + 39af02a commit 300631eCopy full SHA for 300631e
railties/lib/rails/generators/rails/plugin/plugin_generator.rb
@@ -317,9 +317,9 @@ def modules
317
@modules ||= namespaced_name.camelize.split("::")
318
end
319
320
- def wrap_in_modules(content)
321
- content = "#{content}".strip.gsub(/\W$\n/, '')
322
- 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|
323
str = "module #{mod}\n"
324
str += content.lines.map { |line| " #{line}" }.join
325
str += content.present? ? "\nend" : "end"
0 commit comments