nx-http 0.1.3 → 0.1.6

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
  SHA256:
3
- metadata.gz: 337b4a94d37b11617afd4e0fcb69ee0f26c0ad24782123ad9ecf0b56fba87183
4
- data.tar.gz: 03770de9d12c3367ae91b4e196a730194aa517c448a888ae7061e868456911ef
3
+ metadata.gz: 87102d94710aa254f010f2e6b421010b590a8d9c4951bdce0951398f20435cec
4
+ data.tar.gz: 41a935a45bc5036be50a92bc19ea0304897b638ce21f78d1e21fa9524fed581f
5
5
  SHA512:
6
- metadata.gz: d6e70fd365d548dc2a5925cdc67faf8333963bf28841051a49467ff5811263192a1d38ce153aafe552d4461676eb305591dee849809fde2980aaedd31d89e8aa
7
- data.tar.gz: 0fc150f12773deeca9b2f8544a435c58f5e2a80602e5ed692002e49c7c21b068b8e1723d178a8beb43c4aa772cb5ba426b7b32bf713b71d074b5040ab9d61743
6
+ metadata.gz: 573b11d56bd71586f0d8a263d0b1818596a2f21e6bf4e424937b7a4fc363a4c39696f96c470575606a29bc55314372215bf053845728a5a55c2119c56db8c73d
7
+ data.tar.gz: 3b0de3d70369dff21744539bb877400c31747033fb128bb6d917958ed34e906bd0aa868b3548dd7d2930dfbc82b0d73f8a18161b743e3960d92cd5e544acb55c
data/lib/nx/http.rb CHANGED
@@ -32,7 +32,7 @@ module Nx
32
32
  uri.query = URI.encode_www_form(in_data)
33
33
  else
34
34
  in_options.each do |key, value|
35
- if key == "content_type"
35
+ if key == :content_type
36
36
  ContentType.const_get value.upcase
37
37
  else
38
38
  request[key] = value
@@ -40,7 +40,9 @@ module Nx
40
40
  end
41
41
  end
42
42
 
43
- yield(uri, method, request, http)
43
+ if block_given?
44
+ yield(uri, method, request, http)
45
+ end
44
46
 
45
47
  begin
46
48
  http.request(request)
@@ -51,8 +53,8 @@ module Nx
51
53
 
52
54
  class << self
53
55
  ["get", "post", "put", "delete", "options"].each do |item|
54
- define_method item.to_sym do |url, data, options|
55
- self.request(item, url, data || {}, options || {})
56
+ define_method item.to_sym do |url, data = {}, options = {}|
57
+ self.request(item, url, data, options)
56
58
  end
57
59
  end
58
60
  end
data/lib/nx/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Nx
2
2
  class Http
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
data/nx-http-0.1.4.gem ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nx-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - afeiship
@@ -69,8 +69,7 @@ files:
69
69
  - lib/nx/data_transform.rb
70
70
  - lib/nx/http.rb
71
71
  - lib/nx/version.rb
72
- - nx-http-0.1.1.gem
73
- - nx-http-0.1.2.gem
72
+ - nx-http-0.1.4.gem
74
73
  - nx-http.gemspec
75
74
  - package.json
76
75
  homepage: https://github.com/afeiship/nx-http
data/nx-http-0.1.1.gem DELETED
Binary file
data/nx-http-0.1.2.gem DELETED
Binary file