Class: Teapot::Command::Top
- Inherits:
-
Flopp::Command
- Object
- Flopp::Command
- Teapot::Command::Top
- Defined in:
- lib/teapot/command.rb
Instance Method Summary collapse
- #controller(root = nil, **options) ⇒ Object
- #invoke(program_name: File.basename($0)) ⇒ Object
- #root ⇒ Object
Instance Method Details
#controller(root = nil, **options) ⇒ Object
161 162 163 |
# File 'lib/teapot/command.rb', line 161 def controller(root = nil, **) Teapot::Controller.new(root || self.root, @options) end |
#invoke(program_name: File.basename($0)) ⇒ Object
165 166 167 168 169 170 171 172 173 |
# File 'lib/teapot/command.rb', line 165 def invoke(program_name: File.basename($0)) if @command.nil? or @options[:help] print_usage(program_name) elsif @options[:version] puts "teapot v#{Teapot::VERSION}" else @command.invoke(self) end end |
#root ⇒ Object
157 158 159 |
# File 'lib/teapot/command.rb', line 157 def root @options[:root] || Dir.getwd end |