From 4d8abbbecc5dbfe444dec23e66738f2f09e79529 Mon Sep 17 00:00:00 2001 From: Gant Laborde Date: Sun, 6 Apr 2014 14:30:31 -0500 Subject: [PATCH] updating regex for controller/stylesheet replace [Existing code](https://github.com/infinitered/rmq/blob/0fb018c2b447a7aa15dc2df184d258b7a5f2d73a/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. --- bin/rmq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/rmq b/bin/rmq index 107fe8d..7f4baab 100755 --- a/bin/rmq +++ b/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|