cloudflare-dns-update 2.1.1 → 2.2.0

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
  SHA1:
3
- metadata.gz: 6dad16eca439baf778b65ace80eee737f6ab3884
4
- data.tar.gz: fec02f50d441f579a4e5d3b560c1dcfb086a9bc0
3
+ metadata.gz: 076e72b5373e7244852b4dfc4df13385aaf6694a
4
+ data.tar.gz: d68ca108a1d34ab03cc766060834dc6fed7dc558
5
5
  SHA512:
6
- metadata.gz: 26c35465cc6f0145337771131676d5d071c4c7d4c00b4e504c2c9452cc27dce547c4a267120c6e4b86f24f7c62c2202058b7d09050df830dfd4f18e17e9c068f
7
- data.tar.gz: f8c26eef30fb4fe0ce5058002fd4be70ea4957be9b6ea8b45f78e182a3e62653ca926aa1d9dae12db740263e8b1c88d22bc8be90aa8b2df392d67136e830da21
6
+ metadata.gz: ca464b63e21f59c148334cd2a5dbdf43f34a7307022c1265423764606ff799b91b9c6759cb90eecfdfd99ed373f8e2c7d6cec5049910914e6bc012d5e5349cfc
7
+ data.tar.gz: c0e72350e25a19662473641249ca5633268bdb99157d1cb98da4f51871869936676d83e483a23968da19c91a4d9053fb404c291719d559969ad1769fc8b9222e
@@ -126,22 +126,24 @@ module Cloudflare::DNS::Update
126
126
  end
127
127
  end
128
128
 
129
- def update_domains
129
+ def update_domains(content = nil)
130
130
  configuration_store.transaction do |configuration|
131
- logger.debug "Executing content command: #{configuration[:content_command]}"
132
- content, status = Open3.capture2(configuration[:content_command])
133
-
134
- unless status.success?
135
- raise RuntimeError.new("Content command failed with non-zero output: #{status}")
136
- end
137
-
138
- unless zone = @connection.zones.find_by_id(configuration[:zone][:id])
139
- raise RuntimeError.new("Couldn't load zone #{configuration[:zone].inspect} from API!")
131
+ unless content
132
+ logger.debug "Executing content command: #{configuration[:content_command]}"
133
+ content, status = Open3.capture2(configuration[:content_command])
134
+
135
+ unless status.success?
136
+ raise RuntimeError.new("Content command failed with non-zero output: #{status}")
137
+ end
138
+
139
+ unless zone = @connection.zones.find_by_id(configuration[:zone][:id])
140
+ raise RuntimeError.new("Couldn't load zone #{configuration[:zone].inspect} from API!")
141
+ end
142
+
143
+ # Make sure there is no trailing space:
144
+ content.chomp!
140
145
  end
141
146
 
142
- # Make sure there is no trailing space:
143
- content.chomp!
144
-
145
147
  if content != configuration[:content] || @options[:force]
146
148
  logger.info "Content changed #{content.inspect}, updating records..."
147
149
 
@@ -169,9 +171,9 @@ module Cloudflare::DNS::Update
169
171
  else
170
172
  logger.debug "Content hasn't changed."
171
173
  end
172
-
173
- return content
174
174
  end
175
+
176
+ return content
175
177
  end
176
178
 
177
179
  def invoke(program_name: File.basename($0))
@@ -22,7 +22,7 @@
22
22
  module Cloudflare
23
23
  module DNS
24
24
  module Update
25
- VERSION = "2.1.1"
25
+ VERSION = "2.2.0"
26
26
  end
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudflare-dns-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams