nice_http 1.9.5 → 1.9.7
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/README.md +7 -3
- data/lib/nice_http/manage/response.rb +1 -0
- data/lib/nice_http/utils/set_lambdas.rb +3 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41cdb6573d61a197be54a860cf866552f7601ec2b51767d094cf9187d6cf2946
|
|
4
|
+
data.tar.gz: 90d6bbecf158d8c00ca4f73917eb4e4a35a1a00fedf80f31ccbd42fdcd030678
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6377a24a67e092ca8f7dec56424097df3b17f4b9e75dc4f0ff33085e77fd93d5e312be0753d696aba08cf796e371eaa2f15d59554c19b628906b0f9cc4223ed
|
|
7
|
+
data.tar.gz: 3d7640eb70c81dc3a795816720b98a451c709ebd4ac28a6665c131c578e15e113d6e7e09762890795b2edf502f1a54c28b7b45fdf77f5c008d361f30627c0c1c
|
data/README.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
[](https://rubygems.org/gems/nice_http)
|
|
4
4
|
[](https://github.com/MarioRuiz/nice_http)
|
|
5
5
|
[](https://coveralls.io/github/MarioRuiz/nice_http?branch=master)
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
6
10
|
|
|
7
11
|
NiceHttp the simplest library for accessing and testing HTTP and REST resources.
|
|
8
12
|
|
|
@@ -751,14 +755,14 @@ This will generate an items key that will contain an array of the values you add
|
|
|
751
755
|
* Direct download:
|
|
752
756
|
|
|
753
757
|
```ruby
|
|
754
|
-
resp = NiceHttp.new("https://
|
|
758
|
+
resp = NiceHttp.new("https://github.com").get("/MarioRuiz/slack-smart-bot/blob/master/slack-smart-bot.png", save_data: './tmp/')
|
|
755
759
|
```
|
|
756
760
|
|
|
757
761
|
* Get the data and store it like you want:
|
|
758
762
|
|
|
759
763
|
```ruby
|
|
760
|
-
resp = NiceHttp.new("https://
|
|
761
|
-
File.open('./
|
|
764
|
+
resp = NiceHttp.new("https://github.com").get("/MarioRuiz/slack-smart-bot/blob/master/slack-smart-bot.png")
|
|
765
|
+
File.open('./slack-smart-bot.png', 'wb') { |fp| fp.write(resp.data) }
|
|
762
766
|
```
|
|
763
767
|
|
|
764
768
|
### Send multipart content
|
|
@@ -19,6 +19,9 @@ module NiceHttpUtils
|
|
|
19
19
|
end
|
|
20
20
|
elsif v.is_a?(Hash)
|
|
21
21
|
data[k] = set_lambdas(v, data_orig[k])
|
|
22
|
+
unless data_orig.is_a?(Hash) and data_orig.key?(k)
|
|
23
|
+
data.delete(k) if data[k].empty?
|
|
24
|
+
end
|
|
22
25
|
elsif v.is_a?(Array)
|
|
23
26
|
v.each.with_index do |v2, i|
|
|
24
27
|
if data_orig.key?(k) and data_orig[k].is_a?(Array) and data_orig[k].size > i
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nice_http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mario Ruiz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nice_hash
|
|
@@ -19,7 +19,7 @@ dependencies:
|
|
|
19
19
|
version: '1.18'
|
|
20
20
|
- - ">="
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 1.18.
|
|
22
|
+
version: 1.18.4
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,7 +29,7 @@ dependencies:
|
|
|
29
29
|
version: '1.18'
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 1.18.
|
|
32
|
+
version: 1.18.4
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: rspec
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|