lib/onering/plugins/reporter.rb in onering-client-0.0.96 vs lib/onering/plugins/reporter.rb in onering-client-0.0.97
- old
+ new
@@ -1,10 +1,11 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'timeout'
require 'optparse'
require 'hashlib'
+require 'set'
def report(&block)
Onering::Reporter.add(&block)
end
@@ -35,12 +36,17 @@
@path = [*Onering::Config.get('reporter.plugin_path',[])]
@path += DEFAULT_PLUGIN_PATH
begin
- @detected_gems = (Gem::Specification.all.collect{|i|
- i.name
- }.select{|i|
+ specs = Set.new()
+ @detected_gems = []
+
+ Gem::Specification.each do |spec|
+ specs << spec.name
+ end
+
+ @detected_gems = (specs.to_a.select{|i|
i =~ /^onering-report-/
} - DEFAULT_PLUGIN_GEMNAMES)
rescue Exception => e
Onering::Logger.warn("Unable to detect plugin gems: #{e.class.name} - #{e.message}", "Onering::Reporter")
end