class RubyAudit::Database
Public Instance Methods
Source
# 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
Source
# 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
Source
# File lib/ruby_audit/database.rb, line 13 def check_ruby(ruby, &) check(ruby, 'rubies', &) end
Source
# File lib/ruby_audit/database.rb, line 17 def check_rubygems(rubygems, &) check(rubygems, 'gems', &) end
Protected Instance Methods
Source
# File lib/ruby_audit/database.rb, line 31 def each_advisory_path(&) Dir.glob(File.join(@path, '{gems,rubies}', '*', '*.yml'), &) end
Source
# File lib/ruby_audit/database.rb, line 35 def each_advisory_path_for(name, type = 'gems', &) Dir.glob(File.join(@path, type, name, '*.yml'), &) end