glare 0.2.1 → 0.2.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 +4 -4
- data/lib/glare/cf_dns_records.rb +10 -5
- data/lib/glare/domain/record.rb +3 -3
- data/lib/glare/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4a589da3c254fdca06a73b781d66118653269f3
|
4
|
+
data.tar.gz: 9e05730f1f912cf502fb2aad6583256a5005038f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa057266e6b79ff0f91f231f07a2d09a8d1afa1017ebcd1103e23dec2be426d34611a4b3aea84e7a86ce302709d67b2ddd499333207dfb91008423eba642ab9
|
7
|
+
data.tar.gz: cec20af8b032913a2a0c80ef65665b21b79c4c67900061132b3a6e1875d40064ce19eeeca4874d7ed3f64b3a0112885182bd1a6c760ccbe0aa2c55205219ac47
|
data/lib/glare/cf_dns_records.rb
CHANGED
@@ -36,11 +36,16 @@ module Glare
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def to_update(desired_records)
|
39
|
-
records_to_update = desired_records
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
records_to_update = @records - desired_records
|
40
|
+
records_to_update.first(desired_records.count)
|
41
|
+
end
|
42
|
+
|
43
|
+
def -(records)
|
44
|
+
@records.reject { |record| records.any? { |r| r.content == record.content } }
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_a
|
48
|
+
@records.dup
|
44
49
|
end
|
45
50
|
|
46
51
|
def count
|
data/lib/glare/domain/record.rb
CHANGED
@@ -31,9 +31,9 @@ module Glare
|
|
31
31
|
create_new_records(zone_id, dns_records, existing_records)
|
32
32
|
end
|
33
33
|
|
34
|
-
def update_current_records(zone_id,
|
35
|
-
records_to_update = existing_records.to_update(
|
36
|
-
updates = records_to_update.zip(
|
34
|
+
def update_current_records(zone_id, new_records, existing_records)
|
35
|
+
records_to_update = existing_records.to_update(new_records)
|
36
|
+
updates = records_to_update.zip(new_records - existing_records.to_a)
|
37
37
|
updates.each do |existing_record, dns_record|
|
38
38
|
@client.put("/zones/#{zone_id}/dns_records/#{existing_record.id}", dns_record.to_h)
|
39
39
|
end
|
data/lib/glare/version.rb
CHANGED