Module: Themeable

Defined in:
lib/themeable.rb,
lib/themeable/theme.rb,
lib/themeable/command.rb,
lib/themeable/railtie.rb,
lib/themeable/version.rb,
lib/themeable/acts_as_themeable.rb,
lib/themeable/css_path_resolver.rb,
lib/generators/themeable/scaffold_admin_controller_generator.rb

Defined Under Namespace

Modules: ActsAsThemeable, Generators, Theme Classes: Command, CssPathResolver, Railtie

Constant Summary collapse

VERSION =
"1.0.5"
@@theme_set =
Set.new

Class Method Summary collapse

Class Method Details

.add_theme(theme_class) ⇒ Object



11
12
13
# File 'lib/themeable.rb', line 11

def add_theme(theme_class)
  @@theme_set << theme_class
end

.template_engineObject



27
28
29
# File 'lib/themeable.rb', line 27

def template_engine
  @template_engine
end

.template_engine=(theme_name) ⇒ Object



23
24
25
# File 'lib/themeable.rb', line 23

def template_engine=(theme_name)
  @template_engine = "theme_#{theme(theme_name).theme_name}"
end

.theme(theme_name) ⇒ Object



19
20
21
# File 'lib/themeable.rb', line 19

def theme(theme_name)
  themes.find{|t| t.theme_name == theme_name.to_sym } || raise("Theme #{theme_name} not found")
end

.themesObject



15
16
17
# File 'lib/themeable.rb', line 15

def themes
  @@theme_set
end