Sha256: bcac932f545d8cbed3a0e515cea798d382b9c84d1825cf15c08ff14b6e6799f2
Contents?: true
Size: 475 Bytes
Versions: 30
Compression:
Stored size: 475 Bytes
Contents
require 'csv' class Gratan::Identifier::CSV include Gratan::Logger::Helper def initialize(path, options = {}) @options = options @passwords = {} CSV.foreach(path) do |row| @passwords[row[0]] = row[1] end end def identify(user, host) user_host = "#{user}@#{host}" password = @passwords[user_host] unless password log(:warn, "password for `#{user_host}` can not be found", :color => :yellow) end password end end
Version data entries
30 entries across 30 versions & 1 rubygems