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.
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_matchers ⇒ Object
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 |