nx-http 0.1.3 → 0.1.6
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 +4 -4
- data/lib/nx/http.rb +6 -4
- data/lib/nx/version.rb +1 -1
- data/nx-http-0.1.4.gem +0 -0
- metadata +2 -3
- data/nx-http-0.1.1.gem +0 -0
- data/nx-http-0.1.2.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87102d94710aa254f010f2e6b421010b590a8d9c4951bdce0951398f20435cec
|
4
|
+
data.tar.gz: 41a935a45bc5036be50a92bc19ea0304897b638ce21f78d1e21fa9524fed581f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 ==
|
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
|
-
|
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
|
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
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.
|
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.
|
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
|