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.



26
27
28
29
30
# File 'lib/buildr4osgi/osgi/registry.rb', line 26

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.



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

def group_matchers
  @group_matchers
end

Instance Method Details

#group(bundle) ⇒ Object



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

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