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

#callObject



56
57
58
59
60
61
62
63
64
# File 'lib/utopia/command.rb', line 56

def call
  if @options[:version]
    puts "#{self.name} v#{VERSION}"
  elsif @options[:help]
    print_usage(output: $stdout)
  else
    @command.call
  end
end

#rootObject

The root directory for the site.



52
53
54
# File 'lib/utopia/command.rb', line 52

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