class Bundler::Audit::Scanner

def initialize(root=Dir.pwd,gemfile_lock='Gemfile.lock',database=Database.new,config_dot_file='.bundler-audit.yml')

Raises:
  • (Bundler::GemfileLockNotFound) -

Parameters:
  • config_dot_file (String) --
  • database (Database) --
  • gemfile_lock (String) --
  • root (String) --
def initialize(root=Dir.pwd,gemfile_lock='Gemfile.lock',database=Database.new,config_dot_file='.bundler-audit.yml')
  @root     = File.expand_path(root)
  @database = database
  gemfile_lock_path = File.join(@root,gemfile_lock)
  unless File.file?(gemfile_lock_path)
    raise(Bundler::GemfileLockNotFound,"Could not find #{gemfile_lock.inspect} in #{@root.inspect}")
  end
  @lockfile = LockfileParser.new(File.read(gemfile_lock_path))
  config_dot_file_full_path = File.absolute_path(config_dot_file, @root)
  @config = if File.exist?(config_dot_file_full_path)
              Configuration.load(config_dot_file_full_path)
            else
              Configuration.new
            end
end