7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/active_support_decorators/dependencies_patch.rb', line 7
def require_or_load(file_name, const_path = nil)
if ActiveSupportDecorators.is_decorator?(file_name)
original_const_name = ActiveSupportDecorators.original_const_name(file_name)
if original_const_name
ActiveSupportDecorators.log "Decorators: Expecting #{file_name} to decorate #{original_const_name}."
original_const_name.constantize
ActiveSupportDecorators.all(file_name, const_path).each do |d|
ActiveSupportDecorators.log "Decorators: Loading #{d} for #{file_name}."
require_or_load_single(d)
end
else
ActiveSupportDecorators.log "Decorators: Nothing found to load before: #{file_name}."
require_or_load_single(file_name)
end
else
require_or_load_single(file_name, const_path)
ActiveSupportDecorators.all(file_name, const_path).each do |d|
ActiveSupportDecorators.log "Decorators: Loading #{d} for #{file_name}."
require_or_load_single(d)
end
end
end
|