Sha256: 2c668451a39b5a455e1216099a0f4f1e05fe087113c96d668f8f502b9065e43e

Contents?: true

Size: 647 Bytes

Versions: 7

Compression:

Stored size: 647 Bytes

Contents

module Dreamy::Command
  class Dns < Base
    
    def list
      dns = @account.dns
      
      if args.length > 0
        filter = args.shift.downcase
        dns = dns.select { |d| d.zone.match(filter) }
      end
      
      if dns.empty?
        display "No DNS records for this account or requested zone not found"
      else
        dns_table = table do |t|
          t.headings = 'Record', 'Type', 'Value'
          dns.each { |d| t << [d.record,d.type,d.value] if d.type != "TXT" }
        end
        display "NOTE: TXT records not displayed (too long)"
        display dns_table
      end
    end
    alias :index :list
    
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sant0sk1-dreamy-0.1.1 lib/dreamy/commands/dns.rb
sant0sk1-dreamy-0.1.2 lib/dreamy/commands/dns.rb
sant0sk1-dreamy-0.2.0 lib/dreamy/commands/dns.rb
sant0sk1-dreamy-0.2.1 lib/dreamy/commands/dns.rb
sant0sk1-dreamy-0.2.2 lib/dreamy/commands/dns.rb
sant0sk1-dreamy-0.2.3 lib/dreamy/commands/dns.rb
sant0sk1-dreamy-0.2.4 lib/dreamy/commands/dns.rb