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.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(doc_root, port) ⇒ StartWebServer
constructor
A new instance of StartWebServer.
- #run ⇒ Object
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_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 |
#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
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 |