Class: Utopia::Command::Top

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/utopia/command.rb

Instance Method Summary collapse

Instance Method Details

#invoke(program_name: File.basename($0)) ⇒ Object



252
253
254
255
256
257
258
259
260
261
262
# File 'lib/utopia/command.rb', line 252

def invoke(program_name: File.basename($0))
  if @options[:version]
    puts "utopia v#{Teapot::VERSION}"
  elsif @options[:help] or @command.nil?
    print_usage(program_name)
  else
    track_time do
      @command.invoke(self)
    end
  end
end

#rootObject



248
249
250
# File 'lib/utopia/command.rb', line 248

def root
  File.expand_path(@options.fetch(:root, ''), Dir.getwd)
end