Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rafaelfelix opened this issue Nov 6, 2015 · 2 comments

Comments

@rafaelfelix
Copy link

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)
rafaelfelix added a commit to getninjas/cookbook-cloudflare that referenced this issue Nov 17, 2015
rafaelfelix added a commit to getninjas/cookbook-cloudflare that referenced this issue Nov 17, 2015
rafaelfelix added a commit to getninjas/cookbook-cloudflare that referenced this issue Nov 17, 2015
rafaelfelix added a commit to getninjas/cookbook-cloudflare that referenced this issue Nov 17, 2015
rafaelfelix added a commit to getninjas/cookbook-cloudflare that referenced this issue Nov 17, 2015
@b4k3r
Copy link
Collaborator

b4k3r commented May 17, 2016

@ioquatix
Copy link
Member

Awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants