Revert Commands::Serve#server_address signature change.
This commit is contained in:
parent
7133bddfb2
commit
6d1bc6c6ea
|
@ -104,12 +104,7 @@ module Jekyll
|
||||||
def start_up_webrick(opts, destination)
|
def start_up_webrick(opts, destination)
|
||||||
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
||||||
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
||||||
Jekyll.logger.info "Server address:", server_address(
|
Jekyll.logger.info "Server address:", server_address(server, opts)
|
||||||
server.config[:SSLEnable],
|
|
||||||
server.config[:BindAddress],
|
|
||||||
server.config[:Port],
|
|
||||||
opts["baseurl"]
|
|
||||||
)
|
|
||||||
launch_browser server, opts if opts["open_url"]
|
launch_browser server, opts if opts["open_url"]
|
||||||
boot_or_detach server, opts
|
boot_or_detach server, opts
|
||||||
end
|
end
|
||||||
|
@ -129,9 +124,19 @@ module Jekyll
|
||||||
#
|
#
|
||||||
|
|
||||||
private
|
private
|
||||||
def server_address(prefix, address, port, baseurl = nil)
|
def server_address(server, options = {})
|
||||||
|
format_url(
|
||||||
|
server.config[:SSLEnable],
|
||||||
|
server.config[:BindAddress],
|
||||||
|
server.config[:Port],
|
||||||
|
options["baseurl"],
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def format_url(ssl_enabled, address, port, baseurl = nil)
|
||||||
format("%{prefix}://%{address}:%{port}%{baseurl}", {
|
format("%{prefix}://%{address}:%{port}%{baseurl}", {
|
||||||
:prefix => prefix ? "https" : "http",
|
:prefix => ssl_enabled ? "https" : "http",
|
||||||
:address => address,
|
:address => address,
|
||||||
:port => port,
|
:port => port,
|
||||||
:baseurl => baseurl ? "#{baseurl}/" : ""
|
:baseurl => baseurl ? "#{baseurl}/" : ""
|
||||||
|
@ -143,7 +148,7 @@ module Jekyll
|
||||||
private
|
private
|
||||||
def default_url(opts)
|
def default_url(opts)
|
||||||
config = configuration_from_options(opts)
|
config = configuration_from_options(opts)
|
||||||
server_address(
|
format_url(
|
||||||
config["ssl_cert"] && config["ssl_key"],
|
config["ssl_cert"] && config["ssl_key"],
|
||||||
config["host"] == "127.0.0.1" ? "localhost" : config["host"],
|
config["host"] == "127.0.0.1" ? "localhost" : config["host"],
|
||||||
config["port"]
|
config["port"]
|
||||||
|
|
Loading…
Reference in New Issue