Class: Utopia::Command::Top
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Utopia::Command::Top
- Defined in:
- lib/utopia/command.rb
Overview
The top level utopia command.
Instance Method Summary collapse
- #invoke(program_name: File.basename($0)) ⇒ Object
-
#root ⇒ Object
The root directory for the site.
Instance Method Details
#invoke(program_name: File.basename($0)) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/utopia/command.rb', line 53 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 @command.invoke(self) end end |
#root ⇒ Object
The root directory for the site.
49 50 51 |
# File 'lib/utopia/command.rb', line 49 def root File.(@options.fetch(:root, ''), Dir.getwd) end |