Module: Trinidad::Extensions

Defined in:
lib/trinidad/extensions.rb

Defined Under Namespace

Classes: Extension, OptionsExtension, ServerExtension, WebAppExtension

Class Method Summary collapse

Class Method Details

.configure_options_extensions(extensions, parser, default_options) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/trinidad/extensions.rb', line 4

def self.configure_options_extensions(extensions, parser, default_options)
  extensions.each do |name, options|
    if extension = extension(name, 'OptionsExtension', options)
      extension.configure(parser, default_options)
    end
  end if extensions
end

.configure_server_extensions(extensions, tomcat) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/trinidad/extensions.rb', line 12

def self.configure_server_extensions(extensions, tomcat)
  extensions.each do |name, options|
    if extension = extension(name, 'ServerExtension', options)
      outcome = extension.configure(tomcat)
      if tomcat_like?(outcome) || extension.override_tomcat?
        tomcat = outcome
      end
    end
  end if extensions
  tomcat
end

.configure_webapp_extensions(extensions, tomcat, context) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trinidad/extensions.rb', line 24

def self.configure_webapp_extensions(extensions, tomcat, context)
  extensions.each do |name, options|
    if extension = extension(name, 'WebAppExtension', options)
      extension.tomcat = tomcat
      if extension.method(:configure).arity == 2
        extension.configure(tomcat, context) # #deprecated old way
      else
        extension.configure(context)
      end
    end
  end if extensions
end