Themed prefetching

This commit is contained in:
kibigo!
2017-11-16 21:35:25 -08:00
parent b28b405b97
commit 585758a373
6 changed files with 31 additions and 14 deletions

View File

@ -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