Sha256: 9a2b6e25590cced92e1c83d9c311a02df0351ef7b4b3f895c829aee16202080f

Contents?: true

Size: 917 Bytes

Versions: 2

Compression:

Stored size: 917 Bytes

Contents

# frozen_string_literal: true

usage 'live'
summary 'auto-recompile and serve'
description <<~EOS
  Starts the live recompiler along with the static web server. Unless specified,
  the web server will run on port 3000 and listen on all IP addresses. Running
  this static web server requires `adsf` (not `asdf`!).
EOS

required :H, :handler, 'specify the handler to use (webrick/mongrel/...)'
required :o, :host,    'specify the host to listen on (default: 127.0.0.1)'
required :p, :port,    'specify the port to listen on (default: 3000)'

module Nanoc::CLI::Commands
  class Live < ::Nanoc::CLI::CommandRunner
    def run
      self.class.enter_site_dir

      Thread.new do
        Thread.current.abort_on_exception = true
        Nanoc::CLI::Commands::View.new(options, [], self).run
      end

      Nanoc::Extra::LiveRecompiler.new(command_runner: self).run
    end
  end
end

runner Nanoc::CLI::Commands::Live

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-4.8.12 lib/nanoc/cli/commands/live.rb
nanoc-4.8.11 lib/nanoc/cli/commands/live.rb