Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/ruhoh/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand All @@ -42,19 +42,19 @@ 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) {
Dir["*/config.*"].each { |id|
FileUtils.cd(path) {
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)) || {}))
}
Expand Down