socketry/cloudflare

gem install cloudflare -v 2.0.3 is broken: connection.rb is from version v2.0.2

Closed this issue · 2 comments

Here's the git diff between the v2.0.2 version and the current HEAD (v2.0.3):

$ git diff v2.0.2..HEAD
diff --git a/lib/cloudflare/connection.rb b/lib/cloudflare/connection.rb
index 6b23229..5ab2dc3 100644
--- a/lib/cloudflare/connection.rb
+++ b/lib/cloudflare/connection.rb
@@ -289,8 +289,9 @@ module CloudFlare
     # @param weight [Intger] (applies to SRV)
     # @param port [Integer] (applies to SRV)
     # @param target [String] (applies to SRV)
+    # @param service_mode [String]

-    def rec_new(zone, type, name, content, ttl, prio = nil, service = nil, srvname = nil, protocol = nil, weight = nil, port = nil, target = nil)
+    def rec_new(zone, type, name, content, ttl, prio = nil, service = nil, srvname = nil, protocol = nil, weight = nil, port = nil, target = nil, service_mode = '1')
       send_req({
         a: :rec_new,
         z: zone,
@@ -305,7 +306,7 @@ module CloudFlare
         weight: weight,
         port: port,
         target: target,
-        service_mode: '1'
+        service_mode: service_mode
       })
     end

@@ -535,7 +536,7 @@ module CloudFlare
       end

       req = Net::HTTP::Post.new(uri.path)
-      req.set_form_data(params)
+      req.set_form_data(params.reject{|k, v| v.nil?})

       http = Net::HTTP.new(uri.host, uri.port)
       http.use_ssl = true
diff --git a/lib/cloudflare/version.rb b/lib/cloudflare/version.rb
index 9248895..6cf4496 100644
--- a/lib/cloudflare/version.rb
+++ b/lib/cloudflare/version.rb
@@ -19,5 +19,5 @@
 # THE SOFTWARE.

 module CloudFlare
-  VERSION = '2.0.2'
+  VERSION = '2.0.3'
 end

And here is lines 291..293 of the connection.rb that actually ships after gem install cloudflare -v 2.0.3:

    # @param target [String] (applies to SRV)

    def rec_new(zone, type, name, content, ttl, prio = nil, service = nil, srvname = nil, protocol = nil, weight = nil, port = nil, target = nil)

Awesome.