Method: Rails::Generators::PluginGenerator#name
- Defined in:
- railties/lib/rails/generators/rails/plugin/plugin_generator.rb
#name ⇒ Object
306 307 308 309 310 311 312 313 314 315 316 |
# File 'railties/lib/rails/generators/rails/plugin/plugin_generator.rb', line 306 def name @name ||= begin # same as ActiveSupport::Inflector#underscore except not replacing '-' 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! underscored end end |