Class: Blogdown::Cli::CommandLine

Inherits:
Thor
  • Object
show all
Defined in:
lib/blogdown/cli.rb

Overview

Commandline app for blogdown

Instance Method Summary collapse

Instance Method Details

#buildObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/blogdown/cli.rb', line 7

def build
  # Builds html files from markdown files, located in output
  # and posts folders respectively
  begin
    publisher=Blogdown::Publisher.new(Dir.pwd)
    publisher.compose
  rescue Exception=>e
    puts e.message
  end
end

#serverObject



19
20
21
22
23
24
# File 'lib/blogdown/cli.rb', line 19

def server
  # Runs Sinatra built in server on the project root drectory
  ENV['BD']=Dir.pwd
  build
  Blogdown::PreviewApp.run!
end