Sha256: 59385feeaa3890bb2f56d4f738e62be3f90c9120653bdb2da43a9b4110c5c6bc

Contents?: true

Size: 995 Bytes

Versions: 4

Compression:

Stored size: 995 Bytes

Contents

require 'jekyll'
require File.expand_path('helpers', File.dirname(__FILE__))

module Octopress
  class Serve < Command
    def self.init_with_program(p)
      p.command(:serve) do |c|
        c.alias(:server)

        c.syntax 'jekyll serve [options]'
        c.description 'Serve your site locally'

        CommandHelpers.add_build_options(c)

        c.option 'detach', '-B', '--detach',      'Run the server in the background (detach)'
        c.option 'port',   '-P', '--port PORT',   'Port to listen on'
        c.option 'host',   '-H', '--host HOST',   'Host to bind to'
        c.option 'baseurl',      '--baseurl URL', 'Base URL'

        c.action do |args, options|
          options.default :serving => true
          options = CommandHelpers.normalize_options(options)
          options = ::Jekyll.configuration(options.to_symbol_keys)
          ::Jekyll::Commands::Build.process(options)
          ::Jekyll::Commands::Serve.process(options)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
octopress-3.0.0.alpha7 lib/octopress/commands/serve.rb
octopress-3.0.0.alpha6 lib/octopress/commands/serve.rb
octopress-3.0.0.alpha5 lib/octopress/commands/serve.rb
octopress-3.0.0.alpha4 lib/octopress/commands/serve.rb