httpigeon 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +13 -0
- data/httpigeon.gemspec +2 -2
- data/lib/httpigeon/request.rb +15 -1
- data/lib/httpigeon/response.rb +3 -1
- data/lib/httpigeon/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 687076ba8fc193d290ae5bc527269a48e8f7a407e6c8f47007c1408a42a9c604
|
4
|
+
data.tar.gz: 1440197153f6fab85582117e97436694ff086df7b22c3c636ddec88f1cfa168b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee09ec237262bbca31f0c834fb64856cffd5624cff5ac6153e96e31bef75ac307376cb1dc7be4ca90bf9136cb6d200025e3c965d48e3b005ab54965c5644a344
|
7
|
+
data.tar.gz: 8c584ec73859acfb7b8673e685a0721fd71fd305dbd3076a93dc9c633f0a716d3652c49ee828e6b7a81ea4ea83538b44f19b169b38ef56c0f510ab74a4e91096
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.3.0](https://github.com/dailypay/httpigeon/compare/v2.2.0...v2.3.0) (2024-07-11)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* add and fix put and delete methods ([#41](https://github.com/dailypay/httpigeon/issues/41)) ([1d9e9b0](https://github.com/dailypay/httpigeon/commit/1d9e9b0585d56c9785efa97e5a743cdcbd179884))
|
9
|
+
* Use enumarable for collection delegation ([8fc143a](https://github.com/dailypay/httpigeon/commit/8fc143a8717aebdd072bd48dceccc34a318657b7))
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* Delegate :map to parsed response ([#39](https://github.com/dailypay/httpigeon/issues/39)) ([59b77e8](https://github.com/dailypay/httpigeon/commit/59b77e821a1356884cb7c426fe433229aa1bdfcc))
|
15
|
+
|
3
16
|
## [2.2.0](https://github.com/dailypay/httpigeon/compare/v2.1.0...v2.2.0) (2024-05-17)
|
4
17
|
|
5
18
|
|
data/httpigeon.gemspec
CHANGED
@@ -33,8 +33,8 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency "rake", "~> 13.0"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.4"
|
35
35
|
spec.add_development_dependency "simplecov"
|
36
|
-
spec.add_development_dependency "rubocop", "~> 1.
|
37
|
-
spec.add_development_dependency "rubocop-rspec", "~>
|
36
|
+
spec.add_development_dependency "rubocop", "~> 1.65"
|
37
|
+
spec.add_development_dependency "rubocop-rspec", "~> 3.0"
|
38
38
|
spec.add_development_dependency "pry", "~> 0.13.1"
|
39
39
|
spec.add_development_dependency "timecop", "~> 0.9.8"
|
40
40
|
|
data/lib/httpigeon/request.rb
CHANGED
@@ -22,6 +22,20 @@ module HTTPigeon
|
|
22
22
|
yield(req) if block_given?
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
def put(endpoint, payload, headers = {}, event_type = nil, log_filters = [])
|
27
|
+
request = new(base_url: endpoint, headers: headers, event_type: event_type, log_filters: log_filters)
|
28
|
+
request.run(method: :put, path: '', payload: payload) do |req|
|
29
|
+
yield(req) if block_given?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def delete(endpoint, query = {}, headers = {}, event_type = nil, log_filters = [])
|
34
|
+
request = new(base_url: endpoint, headers: headers, event_type: event_type, log_filters: log_filters)
|
35
|
+
request.run(method: :delete, path: '', payload: query) do |req|
|
36
|
+
yield(req) if block_given?
|
37
|
+
end
|
38
|
+
end
|
25
39
|
end
|
26
40
|
|
27
41
|
attr_reader :connection, :response, :parsed_response, :base_url, :fuse
|
@@ -56,7 +70,7 @@ module HTTPigeon
|
|
56
70
|
end
|
57
71
|
|
58
72
|
def run(method: :get, path: '/', payload: {})
|
59
|
-
unless method.to_sym == :get
|
73
|
+
unless method.to_sym == :get || method.to_sym == :delete
|
60
74
|
payload = payload.presence&.to_json
|
61
75
|
connection.headers['Content-Type'] = 'application/json'
|
62
76
|
end
|
data/lib/httpigeon/response.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
module HTTPigeon
|
2
2
|
class Response
|
3
|
+
include Enumerable
|
4
|
+
|
3
5
|
attr_reader :request, :parsed_response, :raw_response
|
4
6
|
|
5
|
-
delegate :to_h, :to_json, :with_indifferent_access, to: :parsed_response
|
7
|
+
delegate :each, :to_h, :to_json, :with_indifferent_access, to: :parsed_response
|
6
8
|
delegate :status, :body, :env, to: :raw_response
|
7
9
|
|
8
10
|
def initialize(request, raw_response)
|
data/lib/httpigeon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpigeon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 2k-joker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
89
|
+
version: '1.65'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
96
|
+
version: '1.65'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop-rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '3.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '3.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: pry
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|