Class: Sitepress::CLI
- Inherits:
-
Thor
- Object
- Thor
- Sitepress::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/sitepress/cli.rb
Overview
Command line interface for compiling Sitepress sites.
Instance Method Summary collapse
Instance Method Details
#compile ⇒ Object
23 24 25 |
# File 'lib/sitepress/cli.rb', line 23 def compile project.compiler.compile target_path: .fetch("output_path") end |
#console ⇒ Object
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 |
#server ⇒ Object
15 16 17 18 |
# File 'lib/sitepress/cli.rb', line 15 def server PreviewServer.new(project: project).run port: .fetch("port"), bind_address: .fetch("bind_address") end |
#version ⇒ Object
42 43 44 |
# File 'lib/sitepress/cli.rb', line 42 def version say "Sitepress #{Sitepress::VERSION}" end |