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



64
65
66
# File 'lib/phobos/cli.rb', line 64

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

Instance Method Details

#initObject



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

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



60
61
62
# File 'lib/phobos/cli.rb', line 60

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

#versionObject



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

def version
  puts Phobos::VERSION
end