Class: Nesta::ContentFocus::Paths

Inherits:
Object
  • Object
show all
Defined in:
lib/nesta-contentfocus-extensions/paths.rb

Class Method Summary collapse

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

.lockObject



47
48
49
# File 'lib/nesta-contentfocus-extensions/paths.rb', line 47

def self.lock
  @lock || Mutex.new
end

.public_pathsObject



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_appObject



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.expand_path('../../assets', File.dirname(__FILE__))
  style_path = File.join(asset_base, 'stylesheets')
  add_sass_path(style_path)
  add_public_path(File.expand_path('public', app_root))
  add_view_path(File.expand_path('views', app_root))
end

.view_pathsObject



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