Class: RubyAudit::Database

Inherits:
Bundler::Audit::Database
  • Object
show all
Defined in:
lib/ruby_audit/database.rb

Instance Method Summary collapse

Instance Method Details

#advisories_for(name, type) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ruby_audit/database.rb', line 5

def advisories_for(name, type)
  return enum_for(__method__, name, type) unless block_given?

  each_advisory_path_for(name, type) do |path|
    yield Bundler::Audit::Advisory.load(path)
  end
end

#check(object, type = 'gems') ⇒ Object



21
22
23
24
25
26
27
# File 'lib/ruby_audit/database.rb', line 21

def check(object, type = 'gems')
  return enum_for(__method__, object, type) unless block_given?

  advisories_for(object.name, type) do |advisory|
    yield advisory if advisory.vulnerable?(object.version)
  end
end

#check_ruby(ruby, &block) ⇒ Object



13
14
15
# File 'lib/ruby_audit/database.rb', line 13

def check_ruby(ruby, &block)
  check(ruby, 'rubies', &block)
end

#check_rubygems(rubygems, &block) ⇒ Object



17
18
19
# File 'lib/ruby_audit/database.rb', line 17

def check_rubygems(rubygems, &block)
  check(rubygems, 'gems', &block)
end