diff options
author | lest <just.lest@gmail.com> | 2011-11-19 21:51:37 +0300 |
---|---|---|
committer | lest <just.lest@gmail.com> | 2011-11-19 21:58:30 +0300 |
commit | c220b4d833fcefb4f60fd021875c05e07dfff77d (patch) | |
tree | 84f69056ff16bb5c7bc2c14443ae8185fd75b8d4 /railties/lib | |
parent | 39d2251d8a3e50bf004b6361e0079679466b2280 (diff) | |
download | rails-c220b4d833fcefb4f60fd021875c05e07dfff77d.tar.gz rails-c220b4d833fcefb4f60fd021875c05e07dfff77d.tar.bz2 rails-c220b4d833fcefb4f60fd021875c05e07dfff77d.zip |
fix warning about instance variable in plugin generator
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index ff523fc26f..cd7d51e628 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -251,15 +251,15 @@ task :default => :test end def name - unless @name + @name ||= begin # same as ActiveSupport::Inflector#underscore except not replacing '-' - @name = original_name.dup - @name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') - @name.gsub!(/([a-z\d])([A-Z])/,'\1_\2') - @name.downcase! - end + underscored = original_name.dup + underscored.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') + underscored.gsub!(/([a-z\d])([A-Z])/,'\1_\2') + underscored.downcase! - @name + underscored + end end def camelized |