lib/jekyll/commands/serve.rb in jekyll-3.1.0.pre.beta1 vs lib/jekyll/commands/serve.rb in jekyll-3.1.0.pre.rc1
- old
+ new
@@ -101,11 +101,11 @@
private
def file_handler_opts
WEBrick::Config::FileHandler.merge({
:FancyIndexing => true,
:NondisclosureName => [
- '.ht*','~*'
+ '.ht*', '~*'
]
})
end
#
@@ -121,11 +121,18 @@
#
private
def launch_browser(server, opts)
- command = Utils::Platforms.windows?? "start" : Utils::Platforms.osx?? "open" : "xdg-open"
+ command =
+ if Utils::Platforms.windows?
+ "start"
+ elsif Utils::Platforms.osx?
+ "open"
+ else
+ "xdg-open"
+ end
system command, server_address(server, opts)
end
# Keep in our area with a thread or detach the server as requested
# by the user. This method determines what we do based on what you
@@ -166,10 +173,11 @@
return if !opts[:JekyllOptions]["ssl_cert"] && !opts[:JekyllOptions]["ssl_key"]
if !opts[:JekyllOptions]["ssl_cert"] || !opts[:JekyllOptions]["ssl_key"]
raise RuntimeError, "--ssl-cert or --ssl-key missing."
end
- require "openssl"; require "webrick/https"
+ require "openssl"
+ require "webrick/https"
source_key = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_key" ])
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(File.read(source_key))
opts[:EnableSSL] = true