From c44d4248ac27dddc267e7dc0909eb802b7b9bafb Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Sat, 11 May 2013 19:54:06 +0200 Subject: [PATCH 1/3] warn on use of deprecated "server_port" option --- lib/jekyll/configuration.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index d6856bb1..64434dcc 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -164,6 +164,12 @@ module Jekyll config.delete('server') end + if config.has_key? 'server_port' + Jekyll::Logger.warn "Deprecation:", "The 'server_port' configuration option" + + " has been renamed to 'port'. Update your config file" + + " accordingly." + end + config end From a8788f4a0aa6afc6226989d4666f8f0dfdc6baad Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Sat, 11 May 2013 19:57:11 +0200 Subject: [PATCH 2/3] copy over deprecated config option to new one --- lib/jekyll/configuration.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 64434dcc..42082229 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -168,6 +168,9 @@ module Jekyll Jekyll::Logger.warn "Deprecation:", "The 'server_port' configuration option" + " has been renamed to 'port'. Update your config file" + " accordingly." + # copy but don't overwrite: + config['port'] = config['server_port'] unless config.has_key?('port') + config.delete('server_port') end config From 1b80fc8cc86c5147ce8806b43611e9212740b931 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Sat, 11 May 2013 20:03:55 +0200 Subject: [PATCH 3/3] always be polite to the user :) --- lib/jekyll/configuration.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 42082229..50dca537 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -166,8 +166,8 @@ module Jekyll if config.has_key? 'server_port' Jekyll::Logger.warn "Deprecation:", "The 'server_port' configuration option" + - " has been renamed to 'port'. Update your config file" + - " accordingly." + " has been renamed to 'port'. Please update your config" + + " file accordingly." # copy but don't overwrite: config['port'] = config['server_port'] unless config.has_key?('port') config.delete('server_port')