Class: Phobos::CLI::Commands

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/phobos/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



56
57
58
# File 'lib/phobos/cli.rb', line 56

def self.source_root
  File.expand_path(File.join(File.dirname(__FILE__), '../..'))
end

Instance Method Details

#initObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/phobos/cli.rb', line 25

def init
  copy_file 'config/phobos.yml.example', 'config/phobos.yml'
  create_file 'phobos_boot.rb' do
    <<~EXAMPLE
      # Use this file to load your code
      puts <<~ART
        ______ _           _
        | ___ \\\\ |         | |
        | |_/ / |__   ___ | |__   ___  ___
        |  __/| '_ \\\\ / _ \\\\| '_ \\\\ / _ \\\\/ __|
        | |   | | | | (_) | |_) | (_) \\\\__ \\\\
        \\\\_|   |_| |_|\\\\___/|_.__/ \\\\___/|___/
      ART
      puts "\nphobos_boot.rb - find this file at \#{File.expand_path(__FILE__)}\n\n"
    EXAMPLE
  end
end

#startObject



52
53
54
# File 'lib/phobos/cli.rb', line 52

def start
  Phobos::CLI::Start.new(options).execute
end

#versionObject



20
21
22
# File 'lib/phobos/cli.rb', line 20

def version
  puts Phobos::VERSION
end