From b937953efbe32a00e0dfd2b92120759ba41f5a42 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Mon, 8 May 2023 16:17:01 +0200 Subject: [PATCH] Format RR. --- src/storage/zone.cr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/storage/zone.cr b/src/storage/zone.cr index c7fdef3..ed93d3e 100644 --- a/src/storage/zone.cr +++ b/src/storage/zone.cr @@ -48,7 +48,7 @@ class DNSManager::Storage::Zone end def to_s(io : IO) - io << "#{@name} #{@ttl} IN #{@rrtype.upcase} #{@target}\n" + io << "#{ "%30s" % @name} #{ "%6d" % @ttl} IN #{ "%10s" % @rrtype.upcase} #{ "%30s" % @target}\n" end end @@ -69,10 +69,10 @@ class DNSManager::Storage::Zone def to_s(io : IO) io << "#{name} #{ttl} #{target} #{@rrtype.upcase} (#{mname} #{rname}\n" - io << "\t\t#{serial}; serial\n" - io << "\t\t#{refresh}; refresh\n" - io << "\t\t#{retry}; retry\n" - io << "\t\t#{expire}; expire\n" + io << "\t\t#{ "%10d" % serial} ; serial\n" + io << "\t\t#{ "%10d" % refresh} ; refresh\n" + io << "\t\t#{ "%10d" % retry} ; retry\n" + io << "\t\t#{ "%10d" % expire} ; expire\n" io << "\t)\n" end @@ -223,7 +223,7 @@ class DNSManager::Storage::Zone end def to_s(io : IO) - io << "#{@name} #{@ttl} IN #{@rrtype.upcase} #{@priority} #{@target}\n" + io << "#{ "%30s" % @name} #{ "%6d" % @ttl} IN MX #{ "%3d" % @priority} #{ "%30s" % @target}\n" end def get_errors : Array(Error)