Class: Teapot::Command::Top
- Inherits:
-
Samovar::Command
- Object
- Samovar::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
179 180 181 |
# File 'lib/teapot/command.rb', line 179 def controller(root = nil, **) Teapot::Controller.new(root || self.root || Dir.getwd, @options) end |
#invoke(program_name: File.basename($0)) ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/teapot/command.rb', line 183 def invoke(program_name: File.basename($0)) if @options[:version] puts "teapot v#{Teapot::VERSION}" elsif @options[:help] or @command.nil? print_usage(program_name) else track_time do @command.invoke(self) end end end |
#root ⇒ Object
175 176 177 |
# File 'lib/teapot/command.rb', line 175 def root @options[:root] end |