module LibraryDetection
Public Instance Methods
defer(&block)
click to toggle source
# File lib/one_apm/support/library_detection.rb, line 9 def defer(&block) item = Dependent.new item.instance_eval(&block) if item.name seen_names = @items.map { |i| i.name }.compact if seen_names.include?(item.name) OneApm::Manager.logger.warn("Refusing to re-register LibraryDetection block with name '#{item.name}'") return @items end end @items << item end
dependency_by_name(name)
click to toggle source
# File lib/one_apm/support/library_detection.rb, line 32 def dependency_by_name(name) @items.find {|i| i.name == name } end
detect!()
click to toggle source
# File lib/one_apm/support/library_detection.rb, line 24 def detect! @items.each do |item| if item.dependencies_satisfied? item.execute end end end
installed?(name)
click to toggle source
# File lib/one_apm/support/library_detection.rb, line 36 def installed?(name) item = dependency_by_name(name) item && item.executed end
items()
click to toggle source
# File lib/one_apm/support/library_detection.rb, line 41 def items @items end
items=(new_items)
click to toggle source
# File lib/one_apm/support/library_detection.rb, line 45 def items=(new_items) @items = new_items end