Sha256: 96e7fb5fd8862f07ed1498f302819b8fcedd71a17fec82c2010dcf683b677d71

Contents?: true

Size: 679 Bytes

Versions: 25

Compression:

Stored size: 679 Bytes

Contents

module DnsOne; module Backend; class File < Base

    def initialize file
        @domain_map = {}
        load file
    end

    def find dom_name
        @domain_map[dom_name.downcase]
    end

    def allow_cache
        false
    end

    private

    def load file
        ::File.open(file).each_line do |line|
            line.strip!
            domain_name, rec_set_name = line
                .split(/[,\s]+/)
            if domain_name and not domain_name.empty?
                @domain_map[domain_name.strip.downcase] = rec_set_name&.strip || ''
            else
                Log.w "Ignoring #{file} line: #{line}"
            end
        end
    end

end; end; end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
dns_one-0.5.5 lib/dns_one/backend/file.rb
dns_one-0.5.4 lib/dns_one/backend/file.rb
dns_one-0.5.3 lib/dns_one/backend/file.rb
dns_one-0.5.2 lib/dns_one/backend/file.rb
dns_one-0.5.1 lib/dns_one/backend/file.rb
dns_one-0.5.0 lib/dns_one/backend/file.rb
dns_one-0.4.66 lib/dns_one/backend/file.rb
dns_one-0.4.666 lib/dns_one/backend/file.rb
dns_one-0.4.65 lib/dns_one/backend/file.rb
dns_one-0.4.64 lib/dns_one/backend/file.rb
dns_one-0.4.63 lib/dns_one/backend/file.rb
dns_one-0.4.62 lib/dns_one/backend/file.rb
dns_one-0.4.61 lib/dns_one/backend/file.rb
dns_one-0.4.60 lib/dns_one/backend/file.rb
dns_one-0.4.59 lib/dns_one/backend/file.rb
dns_one-0.4.58 lib/dns_one/backend/file.rb
dns_one-0.4.57 lib/dns_one/backend/file.rb
dns_one-0.4.56 lib/dns_one/backend/file.rb
dns_one-0.4.55 lib/dns_one/backend/file.rb
dns_one-0.4.54 lib/dns_one/backend/file.rb