takeout 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72075d033cab3d057e294b12750acaefa042fa58
4
- data.tar.gz: cbdca972755b2ad75c08466c898974533479b39e
3
+ metadata.gz: 5ec3cff238a42aa8206efd0dac0a9654357bab6e
4
+ data.tar.gz: 40f64a3daadb3f431b66b9a6ce158c7065f24d45
5
5
  SHA512:
6
- metadata.gz: 41f37fca4f63f5194d7e037fdb7c03123bceeb879a883e47494884eb87763cf42633c17523953a9792f040ac4d5c5f1d904c5d103c0eff583b1bb71ee519f8b1
7
- data.tar.gz: 8f43aaa7f2f4d5388f532fd2c156ad52061de8aa251e29bdcc86a984ddf33f2f3c7a1607176be6300bfd30d424f7e3649fbe0ab744f364be1b5d3237b9df5b5f
6
+ metadata.gz: 378aeaa4430c736c0a4365260659e98b2588bc08fc08d6c3b292cee7ecf3cb32dee946cd773c39252770de5eba250f401e020cf7be8fd290129bd1a32b9f5771
7
+ data.tar.gz: cd18d141eebaac058aae2f671d8bf78f790c2596994b23f77ad4e68b8d6c41600fb9104cfa76d6d48b354b6402c1d82a65f5a2db1225e9f6a78e27431ed4fcef
@@ -29,8 +29,8 @@ module Takeout
29
29
 
30
30
  attr_accessor :port
31
31
 
32
- # A constant specifying the kind of event callbacks to raise errors for
33
- FAILURES = [:failure, :missing]
32
+ # A constant specifying the kind of event callbacks and if they should or should not raise an error
33
+ CALLBACKS = {failure: true, missing: true, redirect: false, success: false}
34
34
 
35
35
  # The main client initialization method.
36
36
  # ==== Attributes
@@ -123,10 +123,7 @@ module Takeout
123
123
  curl.password = options[:password]
124
124
  end
125
125
 
126
- curl.on_success {|response| @parsed_body, @failure = Takeout::Response.new(headers: parse_response_headers(response.head), body: Oj.load(response.body_str), response: response), false}
127
- curl.on_redirect {|response| @parsed_body, @failure = Takeout::Response.new(headers: parse_response_headers(response.head), body: Oj.load(response.body_str), response: response), false}
128
-
129
- FAILURES.each { |failure_type| curl.send("on_#{failure_type}") {|response| @parsed_body, @failure = Takeout::Response.new(headers: parse_response_headers(response.head), body: Oj.load(response.body_str), response: response), true} }
126
+ CALLBACKS.each { |callback_type,failure| curl.send("on_#{callback_type}") {|response| @parsed_body, @failure = Takeout::Response.new(headers: parse_response_headers(response.head), body: Oj.load(response.body_str), response: response), failure} }
130
127
  end
131
128
 
132
129
  raise Takeout::EndpointFailureError.new(curl, request_type, @parsed_body) if @failure
@@ -199,6 +196,7 @@ module Takeout
199
196
 
200
197
  return perform_curl_request(request_type, request_url, options, headers)
201
198
  end
199
+
202
200
  self.send(method_sym, *attributes, &block)
203
201
  else
204
202
  super
@@ -1,3 +1,3 @@
1
1
  module Takeout
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takeout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Lucas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-06 00:00:00.000000000 Z
11
+ date: 2016-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -157,10 +157,8 @@ files:
157
157
  - lib/takeout/endpoint_failure_error.rb
158
158
  - lib/takeout/response.rb
159
159
  - lib/takeout/version.rb
160
- - spec/.DS_Store
161
160
  - spec/client_spec.rb
162
161
  - spec/spec_helper.rb
163
- - spec/support/.DS_Store
164
162
  - spec/support/fake_test_api.rb
165
163
  - spec/support/fixtures/post.json
166
164
  - spec/support/fixtures/posts.json
@@ -190,10 +188,8 @@ signing_key:
190
188
  specification_version: 4
191
189
  summary: A powerful little tool for generating on-the-fly API clients.
192
190
  test_files:
193
- - spec/.DS_Store
194
191
  - spec/client_spec.rb
195
192
  - spec/spec_helper.rb
196
- - spec/support/.DS_Store
197
193
  - spec/support/fake_test_api.rb
198
194
  - spec/support/fixtures/post.json
199
195
  - spec/support/fixtures/posts.json
data/spec/.DS_Store DELETED
Binary file
Binary file