zonesync 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8092e718a86bb6aecf07937b02b5d7e2dfc3afb130b0e34d5caaa2e5ca7454d3
4
- data.tar.gz: 6f5f7c405a4a5eb13dfc2caf6276bdde907a48b3226ad356efc2793768b2d304
3
+ metadata.gz: de0f19d0c0fc5e8ce4abdbf8162e812bc8e9625949c569f8241f1dd3a26b1d59
4
+ data.tar.gz: ac995b1a37c31ebfcc942d1b7bdf8af61d3ea542b928181d98a5339ae3ed873f
5
5
  SHA512:
6
- metadata.gz: 02da529d99feab4932cd07da8426308dbecf93cc5f1cfb5465241b097cbc46207f93ff74bb85d50332de03dec950338897078f063ffed539b58fbb3a891b7fc5
7
- data.tar.gz: 3b4c687eb3f84e5f6c096ab101da99cec73c2064c218f8551d76c301f67edb707e82c58c5e06587c114b5ca8f34af4216977521f5d16ef2f315ceaaf82d4f8a7
6
+ metadata.gz: 2ae81d95b270a1832003e80fa9b9a239fa84550baef01b2e965ea98c4d9088386cf7bda17c25dc62d91b1bb1d24fb6e743957246b38f927219844185d8eefc89
7
+ data.tar.gz: a21efe23b40750c68ab57597fca878771fdf1e5738b847d818b56fb4331af83094fb78d5d340f006815c264cd80217239c2a0be59e77295ad22c797838af3657
@@ -36,7 +36,7 @@ module Zonesync
36
36
  response = http.get(nil)
37
37
  response["result"].reduce({}) do |map, attrs|
38
38
  map.merge attrs["id"] => Record.new(
39
- attrs["name"],
39
+ attrs["name"] + ".", # normalize to trailing period
40
40
  attrs["type"],
41
41
  attrs["ttl"].to_i,
42
42
  attrs["content"],
@@ -12,7 +12,7 @@ module Zonesync
12
12
  Record.from_dns_zonefile_record(record)
13
13
  end.select do |record|
14
14
  %w[A AAAA CNAME MX TXT SPF NAPTR PTR].include?(record.type)
15
- end
15
+ end.sort
16
16
  end
17
17
 
18
18
  def read record
@@ -25,6 +25,18 @@ module Zonesync
25
25
  rdata,
26
26
  )
27
27
  end
28
+
29
+ def <=> other
30
+ to_sortable <=> other.to_sortable
31
+ end
32
+
33
+ def to_sortable
34
+ [type, name, rdata, ttl]
35
+ end
36
+
37
+ def to_s
38
+ values.join(" ")
39
+ end
28
40
  end
29
41
  end
30
42
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zonesync
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zonesync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel