diff --git a/lib/jekyll/commands/doctor.rb b/lib/jekyll/commands/doctor.rb index 68caa2e0..0c4f52f8 100644 --- a/lib/jekyll/commands/doctor.rb +++ b/lib/jekyll/commands/doctor.rb @@ -103,10 +103,9 @@ module Jekyll end def case_insensitive_urls(things, destination) - things.each_with_object({}) do |memo, thing| + things.each_with_object({}) do |thing, memo| dest = thing.destination(destination) (memo[dest.downcase] ||= []) << dest - memo end end end diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index c44379eb..4bfcca0f 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -28,7 +28,19 @@ module Jekyll "#{new_blog_path} exists and is not empty." end - if_blank_options + if options["blank"] + create_blank_site new_blog_path + else + create_sample_files new_blog_path + + File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f| + f.write(scaffold_post_content) + end + + File.open(File.expand_path("Gemfile", new_blog_path), "w") do |f| + f.write(gemfile_contents) + end + end Jekyll.logger.info "New jekyll site installed in #{new_blog_path}." end @@ -95,22 +107,6 @@ RUBY def scaffold_path "_posts/0000-00-00-welcome-to-jekyll.markdown.erb" end - - def if_blank_options - if options["blank"] - create_blank_site new_blog_path - else - create_sample_files new_blog_path - - File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f| - f.write(scaffold_post_content) - end - - File.open(File.expand_path("Gemfile", new_blog_path), "w") do |f| - f.write(gemfile_contents) - end - end - end end end end diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb index 7f0d0f84..3f630065 100644 --- a/lib/jekyll/commands/serve.rb +++ b/lib/jekyll/commands/serve.rb @@ -173,6 +173,9 @@ module Jekyll private def enable_ssl(opts) 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" source_key = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], \