diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-01-16 07:58:29 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-01-16 08:34:46 +0900 |
commit | 26b5cbf47b65f5312616ac01f9e10166e4701298 (patch) | |
tree | b7a0d0133567d752b78ccc9d31ac61e8c27772f6 /railties/lib | |
parent | fc3de9118e90c6deaba88a9a68325d3c1ce41c25 (diff) | |
download | rails-26b5cbf47b65f5312616ac01f9e10166e4701298.tar.gz rails-26b5cbf47b65f5312616ac01f9e10166e4701298.tar.bz2 rails-26b5cbf47b65f5312616ac01f9e10166e4701298.zip |
allow symbol to end of string in `wrap_in_modules`
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 7d7477de75..0c7a73a54e 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -337,7 +337,7 @@ task default: :test end def wrap_in_modules(unwrapped_code) - unwrapped_code = "#{unwrapped_code}".strip.gsub(/\W$\n/, '') + unwrapped_code = "#{unwrapped_code}".strip.gsub(/\s$\n/, '') modules.reverse.inject(unwrapped_code) do |content, mod| str = "module #{mod}\n" str += content.lines.map { |line| " #{line}" }.join |