-
Notifications
You must be signed in to change notification settings - Fork 0
/
tb-cli.rb
47 lines (37 loc) · 1.22 KB
/
tb-cli.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$: << File.expand_path(File.dirname(__FILE__) + "/../lib")
require 'rubygems'
require 'thor'
require 'thor/group'
module Tbox
# Base Command Line interface. Registers the two major Thor tasks (Rack and
# Add).
class Cli < Thor
require 'tb-cli/camel_case'
require 'tb-cli/descriptions'
require 'tb-cli/cli/add'
require 'tb-cli/cli/rack'
require 'tb-cli/config_file'
register Tbox::Add, "add", "add [component]", ADD
register Tbox::Rack, "rack", "rack [project_name]", RACK
# Default help message when nothing is passed in
def help(meth=nil)
puts BANNER
super
end
# override the Basic shell with the colorized one in Thor
def self.start(*)
Thor::Base.shell = Thor::Shell::Color
super
end
# Default Help Message banner.
BANNER = <<-BAN
Torquebox CLI
tb [action] [options] # See below for more details on actions
Use this template generator to make quick Rack applications. If you want a
rails app, please use the application template provided by Torquebox
(http://torquebox.org/documentation/DEV/rails.html#using-the-rails-application-template):
rails new my_app -m $TORQUEBOX_HOME/share/rails/template.rb
BAN
end
end
Tbox::Cli.start