Class: CovLoupe::Scripts::StartDocServer

Inherits:
Object
  • Object
show all
Includes:
CommandExecution
Defined in:
lib/cov_loupe/scripts/start_doc_server.rb

Constant Summary collapse

VENV_DIR =
'.docs-venv'

Instance Method Summary collapse

Methods included from CommandExecution

#abort_with, #command_exists?, #run_command, #run_command_with_status

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cov_loupe/scripts/start_doc_server.rb', line 13

def call
  mkdocs_path = resolve_mkdocs_path

  unless command_exists?(mkdocs_path)
    warn "Error: mkdocs not found. Please run 'bin/set-up-python-for-doc-server' or " \
         "'rake docs:setup' first."
    exit 1
  end

  puts 'Starting documentation server...'
  $stdout.flush
  exec(mkdocs_path, 'serve')
end