about summary refs log tree commit diff
path: root/app/lib/themes.rb
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-11-17 14:01:23 -0600
committerGitHub <noreply@github.com>2017-11-17 14:01:23 -0600
commit45f18b8f494153fd63871d60782da992e847ec16 (patch)
tree82b4be5028ec4c8e066c69bdf068ac786104508f /app/lib/themes.rb
parent2a386ad88dad4a076f19dbd1b085ea561868deec (diff)
parent585758a373df05127b0d544ac5971ef67f053e83 (diff)
Merge pull request #218 from glitch-soc/themed-prefetching
Themed preloading
Diffstat (limited to 'app/lib/themes.rb')
-rw-r--r--app/lib/themes.rb9
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