Class: OSGi::GroupMatcher

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/buildr4osgi/osgi/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGroupMatcher

Returns a new instance of GroupMatcher.



24
25
26
27
28
# File 'lib/buildr4osgi/osgi/registry.rb', line 24

def initialize
  @group_matchers = []
  # Default rule for Eclipse artifacts.
  @group_matchers << Proc.new {|n| "org.eclipse" if n.match(/org\.eclipse\..*/) }
end

Instance Attribute Details

#group_matchersObject

Returns the value of attribute group_matchers.



22
23
24
# File 'lib/buildr4osgi/osgi/registry.rb', line 22

def group_matchers
  @group_matchers
end

Instance Method Details

#group(bundle) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/buildr4osgi/osgi/registry.rb', line 30

def group(bundle)
  return group(bundle.id) if bundle.is_a?(Bundle)
  group_matchers.reverse.each do |group|
    result = group.call(bundle)
    return result unless result.nil?
  end
  OSGI_GROUP_ID
  
end