Class: Sauce::Jasmine::Server
- Inherits:
-
Object
- Object
- Sauce::Jasmine::Server
- Defined in:
- lib/sauce/jasmine/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(config) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(config) ⇒ Server
6 7 8 9 |
# File 'lib/sauce/jasmine/server.rb', line 6 def initialize(config) @config = config @host = "127.0.0.1" end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/sauce/jasmine/server.rb', line 4 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
4 5 6 |
# File 'lib/sauce/jasmine/server.rb', line 4 def port @port end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/sauce/jasmine/server.rb', line 11 def start @port = ::Jasmine::find_unused_port Thread.new do handler = Rack::Handler.default handler.run ::Jasmine.app(@config), :Port => @port, :AccessLog => [] end ::Jasmine::wait_for_listener(@port, "jasmine server") end |
#stop ⇒ Object
20 21 22 |
# File 'lib/sauce/jasmine/server.rb', line 20 def stop # nothing, yet end |