Class: ThemeReader
- Inherits:
-
Object
- Object
- ThemeReader
- Defined in:
- lib/theme_reader.rb
Overview
ThemeReader
Returns name of the theme to use.
Class Method Summary collapse
Class Method Details
.read ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/theme_reader.rb', line 8 def self.read rails_root = begin Rails.root rescue StandardError File.dirname(File.dirname(__FILE__)) end theme_txt = "#{rails_root}/config/theme.txt" if ENV['THEME'] ENV['THEME'] elsif File.exist?(theme_txt) File.read(theme_txt).strip else 'default' end end |