Class: RevealCK::Commands::StartWebServer

Inherits:
Object
  • Object
show all
Defined in:
lib/reveal-ck/commands/start_web_server.rb

Overview

The idea of starting up a webserver to display slides locally.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc_root, port) ⇒ StartWebServer

Returns a new instance of StartWebServer.



10
11
12
# File 'lib/reveal-ck/commands/start_web_server.rb', line 10

def initialize(doc_root, port)
  @doc_root, @port = doc_root, port
end

Instance Attribute Details

#doc_rootObject (readonly)

Returns the value of attribute doc_root.



9
10
11
# File 'lib/reveal-ck/commands/start_web_server.rb', line 9

def doc_root
  @doc_root
end

#portObject (readonly)

Returns the value of attribute port.



9
10
11
# File 'lib/reveal-ck/commands/start_web_server.rb', line 9

def port
  @port
end

Instance Method Details

#runObject



14
15
16
17
18
19
# File 'lib/reveal-ck/commands/start_web_server.rb', line 14

def run
  Rack::Server.new(app: build_rack_app(doc_root),
                   Port: port,
                   Logger: server_log,
                   AccessLog: access_log).start
end