From 78b3e6bede697f697f30a3f265ece52caf82036b Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 18 Jul 2017 14:43:28 +0530 Subject: [PATCH 1/5] correct typo --- lib/jekyll/deprecator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index e5574bdf952..b01900d6511 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -5,7 +5,7 @@ module Deprecator def process(args) arg_is_present? args, "--server", "The --server command has been replaced by the \ 'serve' subcommand." - arg_is_present? args, "--serve", "The --server command has been replaced by the \ + arg_is_present? args, "--serve", "The --serve command has been replaced by the \ 'serve' subcommand." arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \ use the 'build' subcommand." From bb6b7f3617107d5a8fcf3da47eda94a2418bc81c Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 18 Jul 2017 14:59:46 +0530 Subject: [PATCH 2/5] remove duplicate topic label The first warning is short enough such that it wont wrap to the next line. Hence the subsequent message does not need a topic label. --- lib/jekyll/deprecator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index b01900d6511..720be5de13a 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -43,7 +43,7 @@ def deprecation_message(message) def defaults_deprecate_type(old, current) Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'." - Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use \ + Jekyll.logger.warn "", "Please update your front-matter defaults to use \ 'type: #{current}'." end From 902ed64207d5fa71369ad80dc8d43983503c7b90 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 18 Jul 2017 15:03:29 +0530 Subject: [PATCH 3/5] optimize whitespace --- lib/jekyll/deprecator.rb | 47 +++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index 720be5de13a..a5eed966c9e 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -3,30 +3,34 @@ module Deprecator extend self def process(args) - arg_is_present? args, "--server", "The --server command has been replaced by the \ - 'serve' subcommand." - arg_is_present? args, "--serve", "The --serve command has been replaced by the \ - 'serve' subcommand." - arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \ - use the 'build' subcommand." - arg_is_present? args, "--auto", "The switch '--auto' has been replaced with \ - '--watch'." - arg_is_present? args, "--no-auto", "To disable auto-replication, simply leave off \ - the '--watch' switch." - arg_is_present? args, "--pygments", "The 'pygments'settings has been removed in \ - favour of 'highlighter'." - arg_is_present? args, "--paginate", "The 'paginate' setting can only be set in \ - your config files." - arg_is_present? args, "--url", "The 'url' setting can only be set in your \ - config files." + arg_is_present? args, "--server", + "The --server command has been replaced by the 'serve' subcommand." + arg_is_present? args, "--serve", + "The --serve command has been replaced by the 'serve' subcommand." + arg_is_present? args, "--no-server", + "To build Jekyll without launching a server, use the 'build' subcommand." + arg_is_present? args, "--auto", + "The switch '--auto' has been replaced with '--watch'." + arg_is_present? args, "--no-auto", + "To disable auto-replication, simply leave off the '--watch' switch." + arg_is_present? args, "--pygments", + "The 'pygments'settings has been removed in favour of 'highlighter'." + arg_is_present? args, "--paginate", + "The 'paginate' setting can only be set in your config files." + arg_is_present? args, "--url", + "The 'url' setting can only be set in your config files." + no_subcommand(args) end def no_subcommand(args) unless args.empty? || - args.first !~ %r(!/^--/!) || %w(--help --version).include?(args.first) - deprecation_message "Jekyll now uses subcommands instead of just switches. \ - Run `jekyll help` to find out more." + args.first !~ %r(!/^--/!) || + %w(--help --version).include?(args.first) + deprecation_message( + "Jekyll now uses subcommands instead of just switches. " \ + "Run `jekyll help` to find out more." + ) abort end end @@ -43,9 +47,8 @@ def deprecation_message(message) def defaults_deprecate_type(old, current) Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'." - Jekyll.logger.warn "", "Please update your front-matter defaults to use \ - 'type: #{current}'." + Jekyll.logger.warn "", + "Please update your front-matter defaults to use 'type: #{current}'." end - end end From d637f1a005c98333e8bb027cfd599e9de0a95c00 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 18 Jul 2017 15:24:11 +0530 Subject: [PATCH 4/5] wrap message gracefully --- lib/jekyll/deprecator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index a5eed966c9e..6a6b911096d 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -47,8 +47,8 @@ def deprecation_message(message) def defaults_deprecate_type(old, current) Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'." - Jekyll.logger.warn "", - "Please update your front-matter defaults to use 'type: #{current}'." + Jekyll.logger.warn "", "Please update your front-matter defaults to " \ + "use 'type: #{current}'." end end end From da78e01045b29815addec408662e063a76c603df Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 18 Jul 2017 17:11:32 +0530 Subject: [PATCH 5/5] remove unnecessary modifications --- lib/jekyll/deprecator.rb | 46 ++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index 6a6b911096d..ca2b8b3f74a 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -3,34 +3,30 @@ module Deprecator extend self def process(args) - arg_is_present? args, "--server", - "The --server command has been replaced by the 'serve' subcommand." - arg_is_present? args, "--serve", - "The --serve command has been replaced by the 'serve' subcommand." - arg_is_present? args, "--no-server", - "To build Jekyll without launching a server, use the 'build' subcommand." - arg_is_present? args, "--auto", - "The switch '--auto' has been replaced with '--watch'." - arg_is_present? args, "--no-auto", - "To disable auto-replication, simply leave off the '--watch' switch." - arg_is_present? args, "--pygments", - "The 'pygments'settings has been removed in favour of 'highlighter'." - arg_is_present? args, "--paginate", - "The 'paginate' setting can only be set in your config files." - arg_is_present? args, "--url", - "The 'url' setting can only be set in your config files." - + arg_is_present? args, "--server", "The --server command has been replaced by the \ + 'serve' subcommand." + arg_is_present? args, "--serve", "The --serve command has been replaced by the \ + 'serve' subcommand." + arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \ + use the 'build' subcommand." + arg_is_present? args, "--auto", "The switch '--auto' has been replaced with \ + '--watch'." + arg_is_present? args, "--no-auto", "To disable auto-replication, simply leave off \ + the '--watch' switch." + arg_is_present? args, "--pygments", "The 'pygments'settings has been removed in \ + favour of 'highlighter'." + arg_is_present? args, "--paginate", "The 'paginate' setting can only be set in \ + your config files." + arg_is_present? args, "--url", "The 'url' setting can only be set in your \ + config files." no_subcommand(args) end def no_subcommand(args) unless args.empty? || - args.first !~ %r(!/^--/!) || - %w(--help --version).include?(args.first) - deprecation_message( - "Jekyll now uses subcommands instead of just switches. " \ - "Run `jekyll help` to find out more." - ) + args.first !~ %r(!/^--/!) || %w(--help --version).include?(args.first) + deprecation_message "Jekyll now uses subcommands instead of just switches. \ + Run `jekyll help` to find out more." abort end end @@ -47,8 +43,8 @@ def deprecation_message(message) def defaults_deprecate_type(old, current) Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'." - Jekyll.logger.warn "", "Please update your front-matter defaults to " \ - "use 'type: #{current}'." + Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use \ + 'type: #{current}'." end end end