lib/webhook_handler/cli.rb in webhook_handler-0.3.1 vs lib/webhook_handler/cli.rb in webhook_handler-0.4.0
- old
+ new
@@ -3,18 +3,18 @@
require 'webhook_handler/version'
module WebhookHandler
class CLI < Thor
include Thor::Actions
- desc "new NAME", "create a new app called NAME"
+ desc 'new NAME', 'create a new app called NAME'
def self.source_root
File.dirname(__FILE__)
end
def new(name)
# @see http://git.io/vBqrp
- @constant_name = name.tr('-', '_').gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
+ @constant_name = name.tr('-', '_').gsub(/-[_-]*(?![_-]|$)/) { '::' }.gsub(/([_-]+|(::)|^)(.|$)/) { Regexp.last_match(2).to_s + Regexp.last_match(3).upcase }
FileUtils.mkdir_p(name)
puts "Creating app '#{name}'..."
templates = {
'Gemfile.tt' => 'Gemfile',