diff options
author | kibigo! <marrus-sh@users.noreply.github.com> | 2017-11-16 21:35:25 -0800 |
---|---|---|
committer | kibigo! <marrus-sh@users.noreply.github.com> | 2017-11-16 21:37:08 -0800 |
commit | 585758a373df05127b0d544ac5971ef67f053e83 (patch) | |
tree | 186e27d2256929e1c75d6f56ca0d31f2018259d4 /app/lib | |
parent | b28b405b9763a0bb3df653b51e6d084b42e9a54d (diff) |
Themed prefetching
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/themes.rb | 9 |
1 files changed, 7 insertions, 2 deletions
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 |