Class: Lita::Ext::CLI
- Inherits:
-
Thor
- Object
- Thor
- Lita::Ext::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/lita/ext/cli.rb
Class Method Summary collapse
-
.source_root ⇒ String
The root path for the templates directory.
Instance Method Summary collapse
Class Method Details
.source_root ⇒ String
Note:
This is a magic method required by Thor for file operations.
The root path for the templates directory.
14 15 16 |
# File 'lib/lita/ext/cli.rb', line 14 def self.source_root File.("../../../../templates", __FILE__) end |
Instance Method Details
#handler(name) ⇒ Object
24 25 26 27 28 29 |
# 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") ⇒ Object
19 20 21 |
# File 'lib/lita/ext/cli.rb', line 19 def new(name = "lita") directory "robot", name end |