From 223f516e28aececdd59faf3a2969e3cdcfef0d39 Mon Sep 17 00:00:00 2001 From: waynedpj Date: Mon, 16 Dec 2013 22:15:22 -0500 Subject: [PATCH 1/2] whitespace cleanup and commit test --- lib/ruhoh/config.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ruhoh/config.rb b/lib/ruhoh/config.rb index aa347c7..bd13fd1 100644 --- a/lib/ruhoh/config.rb +++ b/lib/ruhoh/config.rb @@ -16,7 +16,7 @@ def touch @data.clear @data.merge!(data) - + Time.default_format = @data['date_format'] @data["compiled_path"] = File.expand_path(@data["compiled_path"]) @@ -42,18 +42,18 @@ def find_theme_path if theme_name Ruhoh::Friend.say { plain "Using theme: \"#{theme_name[0]}\""} { "_theme_collection" => theme_name[0] } - else + else { "_theme_collection" => nil } end end # Quick and dirty way to scan for config files in collection folders. - # This is needed because we don't know which collection defines itself as a theme + # This is needed because we don't know which collection defines itself as a theme # so we'll scan for any configs and merge the data to find the theme folder. def collections_config data = {} @ruhoh.cascade.paths.map{ |a| a['path'] }.each do |path| - FileUtils.cd(path) { + FileUtils.cd(path) { Dir["*/config.*"].each { |id| next unless File.exist?(id) && FileTest.file?(id) data = Ruhoh::Utils.deep_merge(data, (Ruhoh::Parse.data_file(File.realpath(id)) || {})) From 1ba7781854a3c4ca09e67f7ca1a28063e5bb7e93 Mon Sep 17 00:00:00 2001 From: waynedpj Date: Mon, 16 Dec 2013 22:24:05 -0500 Subject: [PATCH 2/2] updated collections_config to find only config.{yaml,yml,json} files case insensitively --- lib/ruhoh/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruhoh/config.rb b/lib/ruhoh/config.rb index bd13fd1..120a318 100644 --- a/lib/ruhoh/config.rb +++ b/lib/ruhoh/config.rb @@ -54,7 +54,7 @@ def collections_config data = {} @ruhoh.cascade.paths.map{ |a| a['path'] }.each do |path| FileUtils.cd(path) { - Dir["*/config.*"].each { |id| + Dir.glob("config.{yml,yaml,json}", File::FNM_CASEFOLD).each { |id| next unless File.exist?(id) && FileTest.file?(id) data = Ruhoh::Utils.deep_merge(data, (Ruhoh::Parse.data_file(File.realpath(id)) || {})) }