funnel_http 0.3.1 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dc5ca92f2cadd38540d16fefc60846938f645205482549ed6075a151b4bf446
4
- data.tar.gz: f4d709200e55e657ba73b70c8c7cd0620ba065644f20f6393c24a765a71cbcf8
3
+ metadata.gz: c5daab559328b4688ea1b0df8f729922d5fb0a59c9bf9a59b6b8ad5151f9011e
4
+ data.tar.gz: e97215f71aeb86c5b3d5c728c573fcb5b0f2a4e3a1f3c86f60f8d76799122177
5
5
  SHA512:
6
- metadata.gz: 60c7d733ee0cd9cf43ddb1b705ae69b8b9cb97c32eb6ad62e6d170202760307aaa0caa508128674cd4d2a1d68b78d0f985cad6a5cd15ad138e68446b6e09d171
7
- data.tar.gz: 317bb2a84a2bb0e89ccfc92def4669a58f60a107e0756959a3298aa3b2ad0135bbb72db27bfd43825895c962f94c4ab4554e92d7877a2f5d9bd2dc9e3581d660
6
+ metadata.gz: b3b2dad1cd53e30867557448964cfb08f980cbe2fb10c6545cacf71776b4e5e9c5c1230d8975e470c7fb526ea2383fe67e62235aa8174e12360c692806fbaea9
7
+ data.tar.gz: eee89453a2d1aa51e9f6e1e44510abf941a0e914b8f9972c92b9495a7756ad4661206cd5ddebb224bcf9e194e9cd0552ac48f47d91af7ac42e688d4281f84899
data/.golangci.yml CHANGED
@@ -1,18 +1,31 @@
1
- linters-settings:
2
- revive:
3
- rules:
4
- - name: exported
5
- arguments:
6
- - disableStutteringCheck
7
-
1
+ version: "2"
8
2
  linters:
9
3
  enable:
10
- - gofmt
11
4
  - revive
12
5
  - testifylint
13
6
  - wrapcheck
14
-
15
- issues:
16
- include:
17
- - EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments
18
- - EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments
7
+ settings:
8
+ revive:
9
+ rules:
10
+ - name: exported
11
+ arguments:
12
+ - disableStutteringCheck
13
+ exclusions:
14
+ generated: lax
15
+ presets:
16
+ - common-false-positives
17
+ - legacy
18
+ - std-error-handling
19
+ paths:
20
+ - third_party$
21
+ - builtin$
22
+ - examples$
23
+ formatters:
24
+ enable:
25
+ - gofmt
26
+ exclusions:
27
+ generated: lax
28
+ paths:
29
+ - third_party$
30
+ - builtin$
31
+ - examples$
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## [Unreleased]
2
- [full changelog](http://github.com/sue445/funnel_http/compare/v0.3.1...main)
2
+ [full changelog](http://github.com/sue445/funnel_http/compare/v0.4.0...main)
3
+
4
+ ## [0.4.0](https://github.com/sue445/funnel_http/releases/tag/v0.4.0) - 2025-04-13
5
+ [full changelog](http://github.com/sue445/funnel_http/compare/v0.3.2...v0.4.0)
6
+
7
+ * Add request url to response
8
+ * https://github.com/sue445/funnel_http/pull/80
9
+ * Update Go dependencies
10
+
11
+ ## [0.3.2](https://github.com/sue445/funnel_http/releases/tag/v0.3.2) - 2025-03-22
12
+ [full changelog](http://github.com/sue445/funnel_http/compare/v0.3.1...v0.3.2)
13
+
14
+ * Fix `Ruby::BlockBodyTypeMismatch` in rbs
15
+ * https://github.com/sue445/funnel_http/pull/71
3
16
 
4
17
  ## [0.3.1](https://github.com/sue445/funnel_http/releases/tag/v0.3.1) - 2025-03-12
5
18
  [full changelog](http://github.com/sue445/funnel_http/compare/v0.3.0...v0.3.1)
@@ -8,6 +21,7 @@
8
21
  * https://github.com/sue445/funnel_http/pull/66
9
22
  * Tweak gem description
10
23
  * https://github.com/sue445/funnel_http/pull/68
24
+ * Update Go dependencies
11
25
 
12
26
  ## [0.3.0](https://github.com/sue445/funnel_http/releases/tag/v0.3.0) - 2025-01-12
13
27
  [full changelog](http://github.com/sue445/funnel_http/compare/v0.2.0...v0.3.0)
data/README.md CHANGED
@@ -33,13 +33,13 @@ client = FunnelHttp::Client.new
33
33
  requests = [
34
34
  {
35
35
  method: :get,
36
- uri: "https://example.com/api/user/1",
36
+ url: "https://example.com/api/user/1",
37
37
  },
38
38
 
39
39
  # with request header
40
- {
41
- method: :get,
42
- uri: "https://example.com/api/user/2",
40
+ {
41
+ method: :get,
42
+ url: "https://example.com/api/user/2",
43
43
  header: {
44
44
  "Authorization" => "Bearer xxxxxxxx",
45
45
  "X-Multiple-Values" => ["1st value", "2nd value"],
@@ -49,7 +49,7 @@ requests = [
49
49
  # with request body
50
50
  {
51
51
  method: :post,
52
- uri: "https://example.com/api/user",
52
+ url: "https://example.com/api/user",
53
53
  header: {
54
54
  "Authorization" => "Bearer xxxxxxxx",
55
55
  "Content-Type" => "application/json",
@@ -60,9 +60,9 @@ requests = [
60
60
 
61
61
  responses = client.perform(requests)
62
62
  # => [
63
- # { status_code: 200, body: "Response of /api/user/1", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
64
- # { status_code: 200, body: "Response of /api/user/2", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
65
- # { status_code: 200, body: "Response of /api/user", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
63
+ # { url: "https://example.com/api/user/1", status_code: 200, body: "Response of /api/user/1", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
64
+ # { url: "https://example.com/api/user/2", status_code: 200, body: "Response of /api/user/2", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
65
+ # { url: "https://example.com/api/user", status_code: 200, body: "Response of /api/user", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
66
66
  # ]
67
67
  ```
68
68
 
@@ -44,6 +44,7 @@ func rb_funnel_http_run_requests(self C.VALUE, rbAry C.VALUE) C.VALUE {
44
44
 
45
45
  ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("status_code")), ruby.INT2NUM(response.StatusCode))
46
46
  ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("body")), ruby.String2Value(string(response.Body)))
47
+ ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("url")), ruby.String2Value(string(response.URL)))
47
48
 
48
49
  rbHashHeader := ruby.RbHashNew()
49
50
  ruby.RbGcRegisterAddress(&rbHashHeader)
@@ -6,10 +6,10 @@ toolchain go1.24.0
6
6
 
7
7
  require (
8
8
  github.com/cockroachdb/errors v1.11.3
9
- github.com/jarcoal/httpmock v1.3.1
9
+ github.com/jarcoal/httpmock v1.4.0
10
10
  github.com/ruby-go-gem/go-gem-wrapper v0.7.2
11
11
  github.com/stretchr/testify v1.10.0
12
- golang.org/x/sync v0.12.0
12
+ golang.org/x/sync v0.13.0
13
13
  )
14
14
 
15
15
  require (
@@ -15,16 +15,16 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
15
15
  github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
16
16
  github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
17
17
  github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
18
- github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww=
19
- github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
18
+ github.com/jarcoal/httpmock v1.4.0 h1:BvhqnH0JAYbNudL2GMJKgOHe2CtKlzJ/5rWKyp+hc2k=
19
+ github.com/jarcoal/httpmock v1.4.0/go.mod h1:ftW1xULwo+j0R0JJkJIIi7UKigZUXCLLanykgjwBXL0=
20
20
  github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
21
21
  github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
22
22
  github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
23
23
  github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
24
24
  github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
25
25
  github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
26
- github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g=
27
- github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
26
+ github.com/maxatome/go-testdeep v1.14.0 h1:rRlLv1+kI8eOI3OaBXZwb3O7xY3exRzdW5QyX48g9wI=
27
+ github.com/maxatome/go-testdeep v1.14.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
28
28
  github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
29
29
  github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
30
30
  github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -52,8 +52,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
52
52
  golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
53
53
  golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
54
54
  golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
55
- golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
56
- golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
55
+ golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
56
+ golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
57
57
  golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
58
58
  golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
59
59
  golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -18,6 +18,7 @@ type Request struct {
18
18
 
19
19
  // Response is proxy between CRuby and Go
20
20
  type Response struct {
21
+ URL string
21
22
  StatusCode int
22
23
  Header map[string][]string
23
24
  Body []byte
@@ -58,6 +59,7 @@ func RunRequests(httpClient *http.Client, requests []Request) ([]Response, error
58
59
  return errors.WithStack(err)
59
60
  }
60
61
 
62
+ responses[i].URL = request.URL
61
63
  responses[i].Body = buf
62
64
  responses[i].Header = map[string][]string{}
63
65
 
@@ -37,6 +37,7 @@ module FunnelHttp
37
37
  # @option request :body [String, nil] Request body
38
38
  #
39
39
  # @return [Array<Hash<Symbol => Object>>] `Array` of following `Hash`
40
+ # @return [String] `:url` Request url
40
41
  # @return [Integer] `:status_code`
41
42
  # @return [String] `:body` Response body
42
43
  # @return [Hash{String => Array<String>}] `:header` Response header
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FunnelHttp
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -6,7 +6,7 @@ gems:
6
6
  source:
7
7
  type: git
8
8
  name: ruby/gem_rbs_collection
9
- revision: 7c22ddc3de54df89ebb2546c9dcb1c1498c8154a
9
+ revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
10
10
  remote: https://github.com/ruby/gem_rbs_collection.git
11
11
  repo_dir: gems
12
12
  - name: cgi
@@ -18,7 +18,7 @@ gems:
18
18
  source:
19
19
  type: git
20
20
  name: ruby/gem_rbs_collection
21
- revision: 7c22ddc3de54df89ebb2546c9dcb1c1498c8154a
21
+ revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
22
22
  remote: https://github.com/ruby/gem_rbs_collection.git
23
23
  repo_dir: gems
24
24
  - name: fileutils
@@ -33,20 +33,12 @@ gems:
33
33
  version: '0'
34
34
  source:
35
35
  type: stdlib
36
- - name: parallel
37
- version: '1.20'
38
- source:
39
- type: git
40
- name: ruby/gem_rbs_collection
41
- revision: 7c22ddc3de54df89ebb2546c9dcb1c1498c8154a
42
- remote: https://github.com/ruby/gem_rbs_collection.git
43
- repo_dir: gems
44
36
  - name: rack
45
37
  version: '2.2'
46
38
  source:
47
39
  type: git
48
40
  name: ruby/gem_rbs_collection
49
- revision: 7c22ddc3de54df89ebb2546c9dcb1c1498c8154a
41
+ revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
50
42
  remote: https://github.com/ruby/gem_rbs_collection.git
51
43
  repo_dir: gems
52
44
  - name: rake
@@ -54,7 +46,7 @@ gems:
54
46
  source:
55
47
  type: git
56
48
  name: ruby/gem_rbs_collection
57
- revision: 7c22ddc3de54df89ebb2546c9dcb1c1498c8154a
49
+ revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
58
50
  remote: https://github.com/ruby/gem_rbs_collection.git
59
51
  repo_dir: gems
60
52
  - name: sinatra
@@ -62,7 +54,7 @@ gems:
62
54
  source:
63
55
  type: git
64
56
  name: ruby/gem_rbs_collection
65
- revision: 7c22ddc3de54df89ebb2546c9dcb1c1498c8154a
57
+ revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
66
58
  remote: https://github.com/ruby/gem_rbs_collection.git
67
59
  repo_dir: gems
68
60
  - name: stringio
data/sig/funnel_http.rbs CHANGED
@@ -19,10 +19,12 @@ module FunnelHttp
19
19
  type strict_request = {
20
20
  method: String,
21
21
  url: String,
22
- header: strict_header
22
+ header: strict_header,
23
+ body: String?,
23
24
  }
24
25
 
25
26
  type response = {
27
+ url: String,
26
28
  status_code: Integer,
27
29
  body: String,
28
30
  header: strict_header
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funnel_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-12 00:00:00.000000000 Z
10
+ date: 2025-04-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: go_gem
@@ -177,20 +177,6 @@ dependencies:
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
- - !ruby/object:Gem::Dependency
181
- name: parallel
182
- requirement: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
- type: :development
188
- prerelease: false
189
- version_requirements: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '0'
194
180
  description: Perform HTTP requests in parallel with goroutine
195
181
  email:
196
182
  - sue445@sue445.net