From dc139e2ac97197182b2d036e8794cc1e45306b40 Mon Sep 17 00:00:00 2001 From: Tom Bell Date: Tue, 18 Dec 2012 22:13:17 +0000 Subject: [PATCH] Update the sym->str key conversion --- bin/jekyll2 | 9 ++++++--- lib/jekyll.rb | 2 +- lib/jekyll/commands/build.rb | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/jekyll2 b/bin/jekyll2 index 34d040aa..f46f2dc7 100755 --- a/bin/jekyll2 +++ b/bin/jekyll2 @@ -28,7 +28,9 @@ command :build do |c| c.description = 'Build your site with the option of auto-renegeration' c.option '-w', '--watch', 'Watch for changes and rebuild' c.action do |args, options| - Jekyll::BuildCommand.process(options.__hash__) + options.defaults :serving => false + options = Jekyll.configuration(options.__hash__) + Jekyll::BuildCommand.process(options) end end @@ -55,7 +57,8 @@ command :serve do |c| :baseurl => '/', :serving => true - Jekyll::BuildCommand.process(options.__hash__) - Jekyll::ServeCommand.process(options.__hash__) + options = Jekyll.configuration(options.__hash__) + Jekyll::BuildCommand.process(options) + Jekyll::ServeCommand.process(options) end end diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 98f99402..2b008f88 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -124,7 +124,7 @@ module Jekyll # Returns the final configuration Hash. def self.configuration(override) # Convert any symbol keys to strings and remove the old key/values - override.keys.each { |k| override[k.to_s] = override.delete(k) } + override = override.reduce({}) { |hsh,(k,v)| hsh.merge(k.to_s => v) } # _config.yml may override default source location, but until # then, we need to know where to look for _config.yml diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index 6c8a1254..27461101 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -2,7 +2,6 @@ module Jekyll class BuildCommand < Command def self.process(options) - options = Jekyll.configuration(options) site = Jekyll::Site.new(options) source = options['source']