updating regex for controller/stylesheet replace

[Existing code](0fb018c2b4/bin/rmq (L109)) was replacing the word controller, but not fixing the extra underscore.  E.g.

`rmq create controller neat_cool_controller` would generate files with double underscores from the replace: ergo `neat_cool__controller`

Updated the regex to pick it up.
This commit is contained in:
Gant Laborde
2014-04-06 14:30:31 -05:00
parent 0fb018c2b4
commit 4d8abbbecc

View File

@@ -106,7 +106,7 @@ class RmqCommandLine
return unless (@template_path = template_path(template_name))
files = Dir["#{@template_path}**/*"].select {|f| !File.directory? f}
@name = name.gsub(/(controller|stylesheet)/,'')
@name = name.gsub(/_*(controller|stylesheet)/,'')
@name_camel_case = @name.split('_').map{|word| word.capitalize}.join
files.each do |template_file_path_and_name|