Class: Nesta::Path
- Inherits:
-
Object
- Object
- Nesta::Path
- Defined in:
- lib/nesta-contentfocus-extensions/path.rb
Class Method Summary collapse
- .pre_contentfocus_themes ⇒ Object
- .resolve_theme_path(theme) ⇒ Object
- .theme_gemified?(theme) ⇒ Boolean
- .theme_loaded?(theme) ⇒ Boolean
- .themes(*args) ⇒ Object
Class Method Details
.pre_contentfocus_themes ⇒ Object
5 |
# File 'lib/nesta-contentfocus-extensions/path.rb', line 5 alias_method :pre_contentfocus_themes, :themes |
.resolve_theme_path(theme) ⇒ Object
18 19 20 |
# File 'lib/nesta-contentfocus-extensions/path.rb', line 18 def self.resolve_theme_path(theme) theme_gemified?(theme).first if theme_gemified?(theme) end |
.theme_gemified?(theme) ⇒ Boolean
22 23 24 |
# File 'lib/nesta-contentfocus-extensions/path.rb', line 22 def self.theme_gemified?(theme) $LOADED_FEATURES.grep(/nesta-theme-#{theme}\.rb/) end |
.theme_loaded?(theme) ⇒ Boolean
26 27 28 |
# File 'lib/nesta-contentfocus-extensions/path.rb', line 26 def self.theme_loaded?(theme) Nesta::Config.theme && Nesta::Theme.const_defined?(theme.capitalize) end |
.themes(*args) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/nesta-contentfocus-extensions/path.rb', line 8 def self.themes(*args) theme = args[0] if theme_loaded?(theme) && theme_gemified?(theme) theme_dir = resolve_theme_path(theme) File.(File.join(*args[1..-1]), theme_dir + '/../..') else pre_contentfocus_themes(*args) end end |