From bc6748f1399d150440190d4fe0ef351498e587af Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 13 Apr 2013 18:03:38 +0200 Subject: [PATCH] Add Jekyll::Deprecator --- lib/jekyll/deprecator.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/jekyll/deprecator.rb diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb new file mode 100644 index 00000000..02f00d15 --- /dev/null +++ b/lib/jekyll/deprecator.rb @@ -0,0 +1,25 @@ +module Jekyll + class Deprecator + def self.process(args) + deprecation_message args, "--server", "The --server command has been replaced by the \ + 'serve' subcommand." + deprecation_message args, "--no-server", "To build Jekyll without launching a server, \ + use the 'build' subcommand." + deprecation_message args, "--auto", "The switch '--auto' has been replaced with '--watch'." + deprecation_message args, "--no-auto", "To disable auto-replication, simply leave off \ + the '--watch' switch." + deprecation_message args, "--pygments", "The 'pygments' setting can only be set in \ + your config files." + deprecation_message args, "--paginate", "The 'paginate' setting can only be set in your \ + config files." + deprecation_message args, "--url", "The 'url' setting can only be set in your config files." + end + + def self.deprecation_message(args, deprecated_argument, message) + if args.include?(deprecated_argument) + Jekyll.warn "Deprecation:", message + exit(1) + end + end + end +end