Class: Contentful::Bootstrap::Server
- Inherits:
-
Object
- Object
- Contentful::Bootstrap::Server
- Defined in:
- lib/contentful/bootstrap/server.rb
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
-
#initialize ⇒ Server
constructor
A new instance of Server.
- #running? ⇒ Boolean
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Server
Returns a new instance of Server.
77 78 79 80 81 82 |
# File 'lib/contentful/bootstrap/server.rb', line 77 def initialize @server = WEBrick::HTTPServer.new(:Port => 5123) @server.mount "/", IndexController @server.mount "/oauth_callback", OAuthCallbackController @server.mount "/save_token", SaveTokenController end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
76 77 78 |
# File 'lib/contentful/bootstrap/server.rb', line 76 def server @server end |
Instance Method Details
#running? ⇒ Boolean
92 93 94 |
# File 'lib/contentful/bootstrap/server.rb', line 92 def running? @server.status != :Stop end |
#start ⇒ Object
84 85 86 |
# File 'lib/contentful/bootstrap/server.rb', line 84 def start Thread.new { @server.start } end |
#stop ⇒ Object
88 89 90 |
# File 'lib/contentful/bootstrap/server.rb', line 88 def stop @server.shutdown end |