Added Exceptions and Passing ABC Metric

This commit is contained in:
TheLucasMoore 2016-05-13 13:46:42 -05:00
parent 451881efcf
commit 465e7dd8b0
3 changed files with 22 additions and 17 deletions

View File

@ -28,19 +28,7 @@ module Jekyll
"#{new_blog_path} exists and is not empty."
end
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
if_options_blank(new_blog_path, options)
Jekyll.logger.info "New jekyll site installed in #{new_blog_path}."
end
@ -91,6 +79,22 @@ gem "jekyll", "#{Jekyll::VERSION}"
RUBY
end
def if_options_blank(new_blog_path, 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
def preserve_source_location?(path, options)
!options["force"] && !Dir["#{path}/**/*"].empty?
end

View File

@ -171,10 +171,12 @@ module Jekyll
# forget to add one of the certificates.
private
# rubocop:disable Metrics/AbcSize
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
# rubocop:disable Style/RedundantException
raise RuntimeError, "--ssl-cert or --ssl-key missing."
end
require "openssl"
require "webrick/https"

View File

@ -25,9 +25,8 @@ module Jekyll
super || super(req, res, "#{basename}.html")
end
#
def do_get(req, res)
# rubocop:disable Style/MethodName
def do_GET(req, res)
rtn = super
validate_and_ensure_charset(req, res)
res.header.merge!(@headers)