12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/docker_boss/module.rb', line 12
def self.[](key)
key = key.downcase
unless @modules.has_key? key
path = "docker_boss/module/#{key}"
spec = Gem::Specification.find_by_path(path)
unless spec.nil?
activated = spec.activate
DockerBoss.logger.info "Activated gem `#{spec.full_name}`" if activated
end
begin
require path
rescue LoadError
end
end
raise IndexError, "Unknown module #{key}" unless @modules.has_key? key
@modules[key]
end
|