From 585758a373df05127b0d544ac5971ef67f053e83 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Thu, 16 Nov 2017 21:35:25 -0800 Subject: Themed prefetching --- app/lib/themes.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/lib/themes.rb') diff --git a/app/lib/themes.rb b/app/lib/themes.rb index 2dd188297..f7ec22fd2 100644 --- a/app/lib/themes.rb +++ b/app/lib/themes.rb @@ -10,13 +10,18 @@ class Themes result = Hash.new Dir.glob(Rails.root.join('app', 'javascript', 'themes', '*', 'theme.yml')) do |path| data = YAML.load_file(path) - if data['pack'] && data['name'] - result[data['name']] = data + name = File.basename(File.dirname(path)) + if data['pack'] + result[name] = data end end @conf = result end + def get(name) + @conf[name] + end + def names @conf.keys end -- cgit