class Lita::Ext::CLI
Public Class Methods
source_root()
click to toggle source
The root path for the templates directory. @note This is a magic method required by Thor for file operations. @return [String] The path.
# File lib/lita/ext/cli.rb, line 14 def self.source_root File.expand_path("../../../../templates", __FILE__) end
Public Instance Methods
handler(name)
click to toggle source
# File lib/lita/ext/cli.rb, line 24 def handler(name) config = {} config[:handler_name] = name.split(/_/).map { |p| p.capitalize }.join target = File.join(Lita.root, "app/handlers/#{name}.rb") template("handler.tt", target, config) end
new(name = "lita")
click to toggle source
# File lib/lita/ext/cli.rb, line 19 def new(name = "lita") directory "robot", name end