lib/pact/mock_service/run.rb in pact-mock_service-0.5.5 vs lib/pact/mock_service/run.rb in pact-mock_service-0.6.0
- old
+ new
@@ -65,10 +65,11 @@
end
def webbrick_opts
opts = {
:Port => port,
+ :Host => host,
:AccessLog => []
}
opts.merge!(ssl_opts) if options[:ssl]
opts.merge!(options[:webbrick_options]) if options[:webbrick_options]
opts
@@ -83,11 +84,15 @@
def port
@port ||= options[:port] || FindAPort.available_port
end
+ def host
+ @host ||= options[:host] || "localhost"
+ end
+
def base_url
- options[:ssl] ? "https://localhost:#{port}" : "http://localhost:#{port}"
+ options[:ssl] ? "https://#{host}:#{port}" : "http://#{host}:#{port}"
end
end
end
-end
\ No newline at end of file
+end