Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix warning about instance variable in plugin generator

  • Loading branch information...
commit c220b4d833fcefb4f60fd021875c05e07dfff77d 1 parent 39d2251
Sergey Nartimov lest authored
14 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
View
@@ -251,15 +251,15 @@ def original_name
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
Please sign in to comment.
Something went wrong with that request. Please try again.