Class: Nesta::ContentFocus::Paths
- Inherits:
-
Object
- Object
- Nesta::ContentFocus::Paths
- Defined in:
- lib/nesta-contentfocus-extensions/paths.rb
Class Method Summary collapse
- .add_public_path(path) ⇒ Object
- .add_sass_path(path) ⇒ Object
- .add_view_path(path) ⇒ Object
- .lock ⇒ Object
- .public_paths ⇒ Object
- .setup_base_app ⇒ Object
- .view_paths ⇒ Object
Class Method Details
.add_public_path(path) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 19 def self.add_public_path(path) lock.synchronize do @public_paths ||= [] @public_paths.unshift(path) end end |
.add_sass_path(path) ⇒ Object
33 34 35 36 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 33 def self.add_sass_path(path) Sass.load_paths << path SassPaths.append(path) end |
.add_view_path(path) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 26 def self.add_view_path(path) lock.synchronize do @view_paths ||= [] @view_paths.unshift(path) end end |
.lock ⇒ Object
47 48 49 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 47 def self.lock @lock || Mutex.new end |
.public_paths ⇒ Object
7 8 9 10 11 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 7 def self.public_paths lock.synchronize do @public_paths || [] end end |
.setup_base_app ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 38 def self.setup_base_app app_root = Nesta::Env.root asset_base = File.('../../assets', File.dirname(__FILE__)) style_path = File.join(asset_base, 'stylesheets') add_sass_path(style_path) add_public_path(File.('public', app_root)) add_view_path(File.('views', app_root)) end |
.view_paths ⇒ Object
13 14 15 16 17 |
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 13 def self.view_paths lock.synchronize do @view_paths || [] end end |