Class: Deface::Environment::Overrides

Inherits:
Object
  • Object
show all
Defined in:
lib/deface/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOverrides

Returns a new instance of Overrides.



14
15
16
# File 'lib/deface/environment.rb', line 14

def initialize
  @all = {}
end

Instance Attribute Details

#allObject

Returns the value of attribute all.



12
13
14
# File 'lib/deface/environment.rb', line 12

def all
  @all
end

Instance Method Details

#early_checkObject



38
39
40
41
42
43
44
# File 'lib/deface/environment.rb', line 38

def early_check
  Deface::Override._early.each do |args|
    Deface::Override.new(args)
  end

  Deface::Override._early.clear
end

#find(*args) ⇒ Object



18
19
20
# File 'lib/deface/environment.rb', line 18

def find(*args)
  Deface::Override.find(*args)
end

#load_all(app) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/deface/environment.rb', line 22

def load_all(app)
  # check application for specified overrides paths
  #
  #
  override_paths = app.paths["app/overrides"]
  enumerate_and_load(override_paths, app.root)

  # check all railties / engines / extensions for overrides
  app.railties.all.each do |railtie|
    next unless railtie.respond_to? :root

    override_paths = railtie.respond_to?(:paths) ? railtie.paths["app/overrides"] : nil
    enumerate_and_load(override_paths, railtie.root)
  end
end