mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 22:51:53 +08:00
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:
2
bin/rmq
2
bin/rmq
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user