Class: RevealCK::Commands::StartWebServer
- Inherits:
-
Object
- Object
- RevealCK::Commands::StartWebServer
- 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
-
#doc_root ⇒ Object
readonly
Returns the value of attribute doc_root.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(doc_root, port, host) ⇒ StartWebServer
constructor
A new instance of StartWebServer.
- #run ⇒ Object
Constructor Details
#initialize(doc_root, port, host) ⇒ StartWebServer
Returns a new instance of StartWebServer.
10 11 12 13 14 |
# File 'lib/reveal-ck/commands/start_web_server.rb', line 10 def initialize(doc_root, port, host) @doc_root = doc_root @port = port @host = host end |
Instance Attribute Details
#doc_root ⇒ Object (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 |
#host ⇒ Object (readonly)
Returns the value of attribute host.
9 10 11 |
# File 'lib/reveal-ck/commands/start_web_server.rb', line 9 def host @host end |
#port ⇒ Object (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
#run ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/reveal-ck/commands/start_web_server.rb', line 16 def run Rack::Server.new(app: build_rack_app(doc_root), Host: host, Port: port, Logger: server_log, DoNotReverseLookup: true, AccessLog: access_log).start end |