Class: Sitepress::CLI

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

Overview

Command line interface for compiling Sitepress sites.

Instance Method Summary collapse

Instance Method Details

#compileObject



23
24
25
# File 'lib/sitepress/cli.rb', line 23

def compile
  project.compiler.compile target_path: options.fetch("output_path")
end

#consoleObject



29
30
31
# File 'lib/sitepress/cli.rb', line 29

def console
  REPL.new(context: project).start
end

#new(target) ⇒ Object



34
35
36
37
38
39
# File 'lib/sitepress/cli.rb', line 34

def new(target)
  inside target do
    directory self.class.source_root, "."
    run "bundle install"
  end
end

#serverObject



15
16
17
18
# File 'lib/sitepress/cli.rb', line 15

def server
  PreviewServer.new(project: project).run port: options.fetch("port"),
    bind_address: options.fetch("bind_address")
end

#versionObject



42
43
44
# File 'lib/sitepress/cli.rb', line 42

def version
  say "Sitepress #{Sitepress::VERSION}"
end