Method: Seasar::Container::S2ApplicationContext#select_component_info_by_namespace
- Defined in:
- lib/seasar/container/s2application-context.rb
#select_component_info_by_namespace(component_infos, namespaces) ⇒ Object
-
args
-
Array component_infos Array of Seasar::Container::ComponentInfoDef
-
Array namespaces String namespaces
-
-
return
-
Array
-
407 408 409 410 411 412 413 414 415 416 |
# File 'lib/seasar/container/s2application-context.rb', line 407 def select_component_info_by_namespace(component_infos, namespaces) return component_infos if namespaces.size == 0 reg_namespaces = namespaces.map {|v| /^#{v.gsub(/\./, '\.')}\./ } return component_infos.select {|info| next false if info.namespace.nil? next true if namespaces.member?(info.namespace) next true if nil != reg_namespaces.find {|reg| info.namespace.match(reg)} next false } end |