Class: Utopia::Command::Top

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

Overview

The top level utopia command.

Instance Method Summary collapse

Instance Method Details

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



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/utopia/command.rb', line 47

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

#rootObject

The root directory for the site.



43
44
45
# File 'lib/utopia/command.rb', line 43

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