Class: OSGi::GroupMatcher
- Includes:
- Singleton
- Defined in:
- lib/buildr4osgi/osgi/registry.rb
Instance Attribute Summary collapse
-
#group_matchers ⇒ Object
Returns the value of attribute group_matchers.
Instance Method Summary collapse
- #group(bundle) ⇒ Object
-
#initialize ⇒ GroupMatcher
constructor
A new instance of GroupMatcher.
Constructor Details
#initialize ⇒ GroupMatcher
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_matchers ⇒ Object
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 |