my_api_client 1.1.0 → 1.3.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.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +8 -7
  3. data/.rubocop.yml +7 -4
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +71 -0
  6. data/Gemfile.lock +95 -81
  7. data/README.jp.md +2 -2
  8. data/README.md +2 -2
  9. data/example/api_clients/my_error_api_client.rb +1 -1
  10. data/example/api_clients/my_header_api_client.rb +1 -1
  11. data/example/api_clients/my_pagination_api_client.rb +2 -2
  12. data/example/api_clients/my_rest_api_client.rb +10 -10
  13. data/example/api_clients/my_status_api_client.rb +1 -1
  14. data/gemfiles/rails_7.1.gemfile +15 -0
  15. data/gemfiles/rails_7.2.gemfile +15 -0
  16. data/lib/my_api_client/base.rb +1 -1
  17. data/lib/my_api_client/error_handling.rb +1 -1
  18. data/lib/my_api_client/errors/network_error.rb +1 -1
  19. data/lib/my_api_client/errors.rb +1 -1
  20. data/lib/my_api_client/exceptions.rb +1 -1
  21. data/lib/my_api_client/params/params.rb +1 -1
  22. data/lib/my_api_client/params/request.rb +8 -8
  23. data/lib/my_api_client/request/basic.rb +2 -2
  24. data/lib/my_api_client/request/executor.rb +1 -1
  25. data/lib/my_api_client/request/pagination.rb +1 -3
  26. data/lib/my_api_client/request.rb +5 -5
  27. data/lib/my_api_client/rspec/matcher_helper.rb +3 -3
  28. data/lib/my_api_client/rspec/matchers/request_to.rb +1 -1
  29. data/lib/my_api_client/version.rb +1 -1
  30. data/my_api/Gemfile +1 -1
  31. data/my_api/Gemfile.lock +83 -71
  32. data/my_api/app/controllers/error_controller.rb +1 -1
  33. data/my_api/app/controllers/pagination_controller.rb +1 -1
  34. data/my_api/app/controllers/rest_controller.rb +4 -4
  35. data/my_api/app/controllers/status_controller.rb +1 -1
  36. data/my_api/spec/controllers/error_controller_spec.rb +4 -4
  37. data/my_api/spec/controllers/status_controller_spec.rb +3 -3
  38. data/my_api_client.gemspec +2 -1
  39. data/rails_app/rails_6.1/Gemfile.lock +73 -71
  40. data/rails_app/rails_7.0/Gemfile.lock +78 -76
  41. data/rails_app/rails_7.1/.dockerignore +31 -0
  42. data/rails_app/rails_7.1/.rspec +1 -0
  43. data/rails_app/rails_7.1/Dockerfile +55 -0
  44. data/rails_app/rails_7.1/Gemfile +16 -0
  45. data/rails_app/rails_7.1/Gemfile.lock +241 -0
  46. data/rails_app/rails_7.1/README.md +24 -0
  47. data/rails_app/rails_7.1/Rakefile +8 -0
  48. data/rails_app/rails_7.1/app/controllers/application_controller.rb +4 -0
  49. data/rails_app/rails_7.1/app/controllers/concerns/.keep +0 -0
  50. data/rails_app/rails_7.1/app/models/application_record.rb +5 -0
  51. data/rails_app/rails_7.1/app/models/concerns/.keep +0 -0
  52. data/rails_app/rails_7.1/bin/bundle +122 -0
  53. data/rails_app/rails_7.1/bin/docker-entrypoint +8 -0
  54. data/rails_app/rails_7.1/bin/rails +6 -0
  55. data/rails_app/rails_7.1/bin/rake +6 -0
  56. data/rails_app/rails_7.1/bin/setup +35 -0
  57. data/rails_app/rails_7.1/config/application.rb +46 -0
  58. data/rails_app/rails_7.1/config/boot.rb +5 -0
  59. data/rails_app/rails_7.1/config/credentials.yml.enc +1 -0
  60. data/rails_app/rails_7.1/config/database.yml +25 -0
  61. data/rails_app/rails_7.1/config/environment.rb +7 -0
  62. data/rails_app/rails_7.1/config/environments/development.rb +58 -0
  63. data/rails_app/rails_7.1/config/environments/production.rb +74 -0
  64. data/rails_app/rails_7.1/config/environments/test.rb +56 -0
  65. data/rails_app/rails_7.1/config/initializers/cors.rb +17 -0
  66. data/rails_app/rails_7.1/config/initializers/filter_parameter_logging.rb +10 -0
  67. data/rails_app/rails_7.1/config/initializers/inflections.rb +17 -0
  68. data/rails_app/rails_7.1/config/locales/en.yml +31 -0
  69. data/rails_app/rails_7.1/config/puma.rb +46 -0
  70. data/rails_app/rails_7.1/config/routes.rb +12 -0
  71. data/rails_app/rails_7.1/config.ru +8 -0
  72. data/rails_app/rails_7.1/db/seeds.rb +10 -0
  73. data/rails_app/rails_7.1/lib/tasks/.keep +0 -0
  74. data/rails_app/rails_7.1/public/robots.txt +2 -0
  75. data/rails_app/rails_7.1/spec/rails_helper.rb +13 -0
  76. data/rails_app/rails_7.1/spec/spec_helper.rb +13 -0
  77. data/rails_app/rails_7.1/storage/.keep +0 -0
  78. data/rails_app/rails_7.1/tmp/.keep +0 -0
  79. data/rails_app/rails_7.1/tmp/pids/.keep +0 -0
  80. data/rails_app/rails_7.1/tmp/storage/.keep +0 -0
  81. data/rails_app/rails_7.1/vendor/.keep +0 -0
  82. data/rails_app/rails_7.2/.dockerignore +42 -0
  83. data/rails_app/rails_7.2/.github/dependabot.yml +12 -0
  84. data/rails_app/rails_7.2/.github/workflows/ci.yml +55 -0
  85. data/rails_app/rails_7.2/.rspec +1 -0
  86. data/rails_app/rails_7.2/Dockerfile +62 -0
  87. data/rails_app/rails_7.2/Gemfile +15 -0
  88. data/rails_app/rails_7.2/Gemfile.lock +240 -0
  89. data/rails_app/rails_7.2/README.md +24 -0
  90. data/rails_app/rails_7.2/Rakefile +8 -0
  91. data/rails_app/rails_7.2/app/controllers/application_controller.rb +4 -0
  92. data/rails_app/rails_7.2/app/controllers/concerns/.keep +0 -0
  93. data/rails_app/rails_7.2/app/models/application_record.rb +5 -0
  94. data/rails_app/rails_7.2/app/models/concerns/.keep +0 -0
  95. data/rails_app/rails_7.2/bin/brakeman +9 -0
  96. data/rails_app/rails_7.2/bin/bundle +122 -0
  97. data/rails_app/rails_7.2/bin/docker-entrypoint +13 -0
  98. data/rails_app/rails_7.2/bin/rails +6 -0
  99. data/rails_app/rails_7.2/bin/rake +6 -0
  100. data/rails_app/rails_7.2/bin/rubocop +10 -0
  101. data/rails_app/rails_7.2/bin/setup +39 -0
  102. data/rails_app/rails_7.2/config/application.rb +46 -0
  103. data/rails_app/rails_7.2/config/boot.rb +5 -0
  104. data/rails_app/rails_7.2/config/credentials.yml.enc +1 -0
  105. data/rails_app/rails_7.2/config/database.yml +32 -0
  106. data/rails_app/rails_7.2/config/environment.rb +7 -0
  107. data/rails_app/rails_7.2/config/environments/development.rb +59 -0
  108. data/rails_app/rails_7.2/config/environments/production.rb +77 -0
  109. data/rails_app/rails_7.2/config/environments/test.rb +53 -0
  110. data/rails_app/rails_7.2/config/initializers/cors.rb +18 -0
  111. data/rails_app/rails_7.2/config/initializers/filter_parameter_logging.rb +10 -0
  112. data/rails_app/rails_7.2/config/initializers/inflections.rb +18 -0
  113. data/rails_app/rails_7.2/config/locales/en.yml +31 -0
  114. data/rails_app/rails_7.2/config/puma.rb +36 -0
  115. data/rails_app/rails_7.2/config/routes.rb +12 -0
  116. data/rails_app/rails_7.2/config.ru +8 -0
  117. data/rails_app/rails_7.2/db/seeds.rb +11 -0
  118. data/rails_app/rails_7.2/lib/tasks/.keep +0 -0
  119. data/rails_app/rails_7.2/public/robots.txt +3 -0
  120. data/rails_app/rails_7.2/spec/rails_helper.rb +13 -0
  121. data/rails_app/rails_7.2/spec/spec_helper.rb +13 -0
  122. data/rails_app/rails_7.2/storage/.keep +0 -0
  123. data/rails_app/rails_7.2/tmp/.keep +0 -0
  124. data/rails_app/rails_7.2/tmp/pids/.keep +0 -0
  125. data/rails_app/rails_7.2/tmp/storage/.keep +0 -0
  126. data/rails_app/rails_7.2/vendor/.keep +0 -0
  127. metadata +107 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bb264840d0afd66355f973a3a19fc6aa5e3ea0ecd58a99bf557aff067bc323d
4
- data.tar.gz: fb24229652289a5b924d585a5e24807397f946987e38195fd1bbd292da6083cc
3
+ metadata.gz: 66fa22bb37cf8e0d6938aac486cb667964ce00deba397c4060b8689719060718
4
+ data.tar.gz: 3e2f17e219ee5fb5dac541039a8629b97c3a739dd096ac44844bcc493d60f39f
5
5
  SHA512:
6
- metadata.gz: 03b973918920394204062f1584a081382dd0d7763a5b48b335c89637e97115969f965cc792ff5ad7477332a1205c9eec3cfde17465c35d69e21cef332bf91f17
7
- data.tar.gz: f52ae41dafa15db16d13929ad4f3c06258ca8403e7cb69c67fa9a62380e7b870d9014ca15986a7a13bfa72ac2c1b89eef1a37db1ec351b8faba860937fb8b774
6
+ metadata.gz: 658c659d53caa15d0a1d2597e0fcb300738931886dff9f91ff89a3d76397d4a2bb68fcc427e70c29d38763f53a4ba6a3641631f6eeeb4fbd8db6c2223cd2805b
7
+ data.tar.gz: 5e7d00b63b87a9057f218154d4e884ae0c2d3d0955d1a65ef91e5a77cac93099d9f91ba30f0a0be849342c6b621f0e6a71bcf2baa313b31c6a20b962f3e01007
data/.circleci/config.yml CHANGED
@@ -12,13 +12,13 @@ references:
12
12
  - &ruby_version
13
13
  ruby_version:
14
14
  type: enum
15
- enum: &ruby_version_enum ["3.0", "3.1", "3.2"]
16
- default: "3.2"
15
+ enum: &ruby_version_enum ["3.1", "3.2", "3.3"]
16
+ default: "3.3"
17
17
  - &rails_version
18
18
  rails_version:
19
19
  type: enum
20
- enum: &rails_version_enum ["6.1", "7.0"]
21
- default: "7.0"
20
+ enum: &rails_version_enum ["6.1", "7.0", "7.1", "7.2"]
21
+ default: "7.2"
22
22
  - &bundler_options
23
23
  bundler_options:
24
24
  type: string
@@ -252,7 +252,7 @@ jobs:
252
252
  - code-climate/install
253
253
  - code-climate/sum-coverage:
254
254
  input: codeclimate.*.json
255
- parts: 12
255
+ parts: 24
256
256
  - code-climate/upload-coverage
257
257
  rubocop:
258
258
  executor: gem_executor
@@ -293,8 +293,9 @@ workflows:
293
293
  parameters:
294
294
  ruby_version: *ruby_version_enum
295
295
  rails_version: *rails_version_enum
296
- - test_api:
297
- ruby_version: "3.2"
296
+ # TODO: Update the version of Ruby on Jets or re-create the test API server with Ruby on Rails 8.0
297
+ # - test_api:
298
+ # ruby_version: "3.2" # Ruby on Jets requires Ruby 2.5, 2.7 or 3.2
298
299
  - rubocop
299
300
  - yardoc
300
301
  - upload-coverage:
data/.rubocop.yml CHANGED
@@ -1,12 +1,15 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-performance
3
+
4
+ require:
3
5
  - rubocop-rake
4
6
  - rubocop-rspec
7
+ - rubocop-rspec_rails
5
8
 
6
9
  inherit_from: .rubocop_todo.yml
7
10
 
8
11
  AllCops:
9
- TargetRubyVersion: 3.0
12
+ TargetRubyVersion: 3.1
10
13
  NewCops: enable
11
14
  Exclude:
12
15
  - rails_app/**/*
@@ -49,7 +52,7 @@ RSpec/DescribeClass:
49
52
  RSpec/ExampleLength:
50
53
  Max: 10
51
54
 
52
- RSpec/FilePath:
55
+ RSpec/SpecFilePathFormat:
53
56
  Exclude:
54
57
  - "spec/lib/my_api_client/integrations/**/*"
55
58
  - "spec/lib/my_api_client/errors/**/*"
@@ -64,6 +67,6 @@ RSpec/NestedGroups:
64
67
  RSpec/MultipleExpectations:
65
68
  Max: 4
66
69
 
67
- RSpec/Rails/HaveHttpStatus:
70
+ RSpecRails/HaveHttpStatus:
68
71
  Exclude:
69
72
  - "my_api/spec/controllers/**/*"
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # Change log
2
2
 
3
+ ## v1.3.0 (Jun 10, 2025)
4
+
5
+ ### Feature
6
+
7
+ - [#1093](https://github.com/ryz310/my_api_client/pull/1093) Allow to use instance writer in the logger ([@ryz310](https://github.com/ryz310))
8
+
9
+ ### Dependabot
10
+
11
+ - [#1063](https://github.com/ryz310/my_api_client/pull/1063) Bump rexml from 3.3.8 to 3.3.9 ([@ryz310](https://github.com/ryz310))
12
+ - [#1081](https://github.com/ryz310/my_api_client/pull/1081) Bump webmock from 3.24.0 to 3.25.0 ([@ryz310](https://github.com/ryz310))
13
+ - [#1074](https://github.com/ryz310/my_api_client/pull/1074) Bump faraday from 2.12.0 to 2.12.2 ([@ryz310](https://github.com/ryz310))
14
+ - [#1078](https://github.com/ryz310/my_api_client/pull/1078) Bump rubocop-performance from 1.22.1 to 1.23.1 ([@ryz310](https://github.com/ryz310))
15
+ - [#1076](https://github.com/ryz310/my_api_client/pull/1076) Bump activesupport from 7.2.2 to 7.2.2.1 ([@ryz310](https://github.com/ryz310))
16
+ - [#1092](https://github.com/ryz310/my_api_client/pull/1092) Bump pry-byebug from 3.10.1 to 3.11.0 ([@ryz310](https://github.com/ryz310))
17
+ - [#1088](https://github.com/ryz310/my_api_client/pull/1088) Bump rake from 13.2.1 to 13.3.0 ([@ryz310](https://github.com/ryz310))
18
+ - [#1090](https://github.com/ryz310/my_api_client/pull/1090) Bump rubocop-rake from 0.6.0 to 0.7.1 ([@ryz310](https://github.com/ryz310))
19
+ - [#1091](https://github.com/ryz310/my_api_client/pull/1091) Bump rubocop-rspec_rails from 2.30.0 to 2.31.0 ([@ryz310](https://github.com/ryz310))
20
+ - [#1089](https://github.com/ryz310/my_api_client/pull/1089) Bump rspec from 3.13.0 to 3.13.1 ([@ryz310](https://github.com/ryz310))
21
+
22
+ ### Misc
23
+
24
+ - [#1083](https://github.com/ryz310/my_api_client/pull/1083) Update bundler to v2.6.9 ([@ryz310](https://github.com/ryz310))
25
+ - [#1084](https://github.com/ryz310/my_api_client/pull/1084) Stop CI for the testing API test ([@ryz310](https://github.com/ryz310))
26
+
27
+ ## v1.2.0 (Sep 06, 2024)
28
+
29
+ ### Feature
30
+
31
+ - [#1048](https://github.com/ryz310/my_api_client/pull/1048) Support lazy evaluation for request headers and body parameters ([@ryz310](https://github.com/ryz310))
32
+ The API client allows lazy evaluation for request headers and body parameters.
33
+ For example, a time-limited token can be issued immediately before the request.
34
+
35
+ ```rb
36
+ class ExampleApiClient < MyApiClient::Base
37
+ def get_users
38
+ get 'users', headers: headers, query: { key: 'value' }
39
+ end
40
+
41
+ private
42
+
43
+ def headers
44
+ lambda do
45
+ new_access_token = issue_new_access_token!
46
+ {
47
+ 'Content-Type': 'application/json;charset=UTF-8',
48
+ 'Authorization': "Bearer #{new_access_token}",
49
+ }
50
+ end
51
+ end
52
+ end
53
+ ```
54
+
55
+ ### Misc
56
+
57
+ - [#1049](https://github.com/ryz310/my_api_client/pull/1049) Update supporting ruby and rails versions ([@ryz310](https://github.com/ryz310))
58
+ Support Ruby 3.3, Rails 7.1 and 7.2
59
+ End of supporting Ruby 3.0 :wave:
60
+
61
+ ### Dependabot
62
+
63
+ - [#982](https://github.com/ryz310/my_api_client/pull/982) Bump rspec from 3.12.0 to 3.13.0 ([@ryz310](https://github.com/ryz310))
64
+ - [#1006](https://github.com/ryz310/my_api_client/pull/1006) Bump rake from 13.2.0 to 13.2.1 ([@ryz310](https://github.com/ryz310))
65
+ - [#1018](https://github.com/ryz310/my_api_client/pull/1018) Bump bugsnag from 6.26.4 to 6.27.0 ([@ryz310](https://github.com/ryz310))
66
+ - [#1020](https://github.com/ryz310/my_api_client/pull/1020) Bump webmock from 3.23.0 to 3.23.1 ([@ryz310](https://github.com/ryz310))
67
+ - [#1031](https://github.com/ryz310/my_api_client/pull/1031) Bump rubocop-performance from 1.21.0 to 1.21.1 ([@ryz310](https://github.com/ryz310))
68
+ - [#1032](https://github.com/ryz310/my_api_client/pull/1032) Bump bugsnag from 6.27.0 to 6.27.1 ([@ryz310](https://github.com/ryz310))
69
+ - [#1043](https://github.com/ryz310/my_api_client/pull/1043) Bump rexml from 3.3.3 to 3.3.6 ([@ryz310](https://github.com/ryz310))
70
+ - [#1045](https://github.com/ryz310/my_api_client/pull/1045) Bump activesupport from 7.1.3.4 to 7.1.4 ([@ryz310](https://github.com/ryz310))
71
+ - [#1046](https://github.com/ryz310/my_api_client/pull/1046) Bump faraday from 2.10.1 to 2.11.0 ([@ryz310](https://github.com/ryz310))
72
+ - [#1047](https://github.com/ryz310/my_api_client/pull/1047) Bump yard from 0.9.36 to 0.9.37 ([@ryz310](https://github.com/ryz310))
73
+
3
74
  ## v1.1.0 (Jan 09, 2024)
4
75
 
5
76
  ### Bugfix
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- my_api_client (1.1.0)
4
+ my_api_client (1.3.0)
5
5
  activesupport (>= 6.1.0)
6
6
  faraday (>= 0.17.1)
7
7
  jsonpath
@@ -10,125 +10,138 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.1.2)
13
+ activesupport (7.2.2.1)
14
14
  base64
15
+ benchmark (>= 0.3)
15
16
  bigdecimal
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ concurrent-ruby (~> 1.0, >= 1.3.1)
17
18
  connection_pool (>= 2.2.5)
18
19
  drb
19
20
  i18n (>= 1.6, < 2)
21
+ logger (>= 1.4.2)
20
22
  minitest (>= 5.1)
21
- mutex_m
22
- tzinfo (~> 2.0)
23
- addressable (2.8.6)
24
- public_suffix (>= 2.0.2, < 6.0)
25
- ast (2.4.2)
26
- base64 (0.2.0)
27
- bigdecimal (3.1.5)
28
- bugsnag (6.26.0)
23
+ securerandom (>= 0.3)
24
+ tzinfo (~> 2.0, >= 2.0.5)
25
+ addressable (2.8.7)
26
+ public_suffix (>= 2.0.2, < 7.0)
27
+ ast (2.4.3)
28
+ base64 (0.3.0)
29
+ benchmark (0.4.1)
30
+ bigdecimal (3.2.2)
31
+ bugsnag (6.27.1)
29
32
  concurrent-ruby (~> 1.0)
30
- byebug (11.1.3)
33
+ byebug (12.0.0)
31
34
  coderay (1.1.3)
32
- concurrent-ruby (1.2.2)
33
- connection_pool (2.4.1)
34
- crack (0.4.5)
35
+ concurrent-ruby (1.3.5)
36
+ connection_pool (2.5.3)
37
+ crack (1.0.0)
38
+ bigdecimal
35
39
  rexml
36
- diff-lcs (1.5.0)
37
- docile (1.4.0)
38
- drb (2.2.0)
39
- ruby2_keywords
40
- faraday (2.8.1)
41
- base64
42
- faraday-net_http (>= 2.0, < 3.1)
43
- ruby2_keywords (>= 0.0.4)
44
- faraday-net_http (3.0.2)
45
- hashdiff (1.1.0)
46
- i18n (1.14.1)
40
+ diff-lcs (1.6.2)
41
+ docile (1.4.1)
42
+ drb (2.2.3)
43
+ faraday (2.13.1)
44
+ faraday-net_http (>= 2.0, < 3.5)
45
+ json
46
+ logger
47
+ faraday-net_http (3.4.0)
48
+ net-http (>= 0.5.0)
49
+ hashdiff (1.2.0)
50
+ i18n (1.14.7)
47
51
  concurrent-ruby (~> 1.0)
48
- json (2.7.1)
52
+ json (2.12.2)
49
53
  jsonpath (1.1.5)
50
54
  multi_json
51
- language_server-protocol (3.17.0.3)
52
- method_source (1.0.0)
53
- minitest (5.20.0)
55
+ language_server-protocol (3.17.0.5)
56
+ lint_roller (1.1.0)
57
+ logger (1.7.0)
58
+ method_source (1.1.0)
59
+ minitest (5.25.5)
54
60
  multi_json (1.15.0)
55
- mutex_m (0.2.0)
56
- parallel (1.24.0)
57
- parser (3.3.0.2)
61
+ net-http (0.6.0)
62
+ uri
63
+ parallel (1.27.0)
64
+ parser (3.3.8.0)
58
65
  ast (~> 2.4.1)
59
66
  racc
60
- pry (0.14.2)
67
+ prism (1.4.0)
68
+ pry (0.15.2)
61
69
  coderay (~> 1.1)
62
70
  method_source (~> 1.0)
63
- pry-byebug (3.10.1)
64
- byebug (~> 11.0)
65
- pry (>= 0.13, < 0.15)
66
- public_suffix (5.0.4)
67
- racc (1.7.3)
71
+ pry-byebug (3.11.0)
72
+ byebug (~> 12.0)
73
+ pry (>= 0.13, < 0.16)
74
+ public_suffix (6.0.2)
75
+ racc (1.8.1)
68
76
  rainbow (3.1.1)
69
- rake (13.1.0)
70
- regexp_parser (2.9.0)
71
- rexml (3.2.6)
72
- rspec (3.12.0)
73
- rspec-core (~> 3.12.0)
74
- rspec-expectations (~> 3.12.0)
75
- rspec-mocks (~> 3.12.0)
76
- rspec-core (3.12.2)
77
- rspec-support (~> 3.12.0)
78
- rspec-expectations (3.12.3)
77
+ rake (13.3.0)
78
+ regexp_parser (2.10.0)
79
+ rexml (3.4.1)
80
+ rspec (3.13.1)
81
+ rspec-core (~> 3.13.0)
82
+ rspec-expectations (~> 3.13.0)
83
+ rspec-mocks (~> 3.13.0)
84
+ rspec-core (3.13.4)
85
+ rspec-support (~> 3.13.0)
86
+ rspec-expectations (3.13.5)
79
87
  diff-lcs (>= 1.2.0, < 2.0)
80
- rspec-support (~> 3.12.0)
81
- rspec-mocks (3.12.6)
88
+ rspec-support (~> 3.13.0)
89
+ rspec-mocks (3.13.5)
82
90
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.12.0)
84
- rspec-support (3.12.1)
91
+ rspec-support (~> 3.13.0)
92
+ rspec-support (3.13.4)
85
93
  rspec_junit_formatter (0.6.0)
86
94
  rspec-core (>= 2, < 4, != 2.12.0)
87
- rubocop (1.59.0)
95
+ rubocop (1.76.1)
88
96
  json (~> 2.3)
89
- language_server-protocol (>= 3.17.0)
97
+ language_server-protocol (~> 3.17.0.2)
98
+ lint_roller (~> 1.1.0)
90
99
  parallel (~> 1.10)
91
- parser (>= 3.2.2.4)
100
+ parser (>= 3.3.0.2)
92
101
  rainbow (>= 2.2.2, < 4.0)
93
- regexp_parser (>= 1.8, < 3.0)
94
- rexml (>= 3.2.5, < 4.0)
95
- rubocop-ast (>= 1.30.0, < 2.0)
102
+ regexp_parser (>= 2.9.3, < 3.0)
103
+ rubocop-ast (>= 1.45.0, < 2.0)
96
104
  ruby-progressbar (~> 1.7)
97
- unicode-display_width (>= 2.4.0, < 3.0)
98
- rubocop-ast (1.30.0)
99
- parser (>= 3.2.1.0)
100
- rubocop-capybara (2.20.0)
101
- rubocop (~> 1.41)
102
- rubocop-factory_bot (2.25.1)
103
- rubocop (~> 1.41)
104
- rubocop-performance (1.20.2)
105
- rubocop (>= 1.48.1, < 2.0)
106
- rubocop-ast (>= 1.30.0, < 2.0)
107
- rubocop-rake (0.6.0)
108
- rubocop (~> 1.0)
109
- rubocop-rspec (2.26.1)
110
- rubocop (~> 1.40)
111
- rubocop-capybara (~> 2.17)
112
- rubocop-factory_bot (~> 2.22)
105
+ unicode-display_width (>= 2.4.0, < 4.0)
106
+ rubocop-ast (1.45.1)
107
+ parser (>= 3.3.7.2)
108
+ prism (~> 1.4)
109
+ rubocop-performance (1.25.0)
110
+ lint_roller (~> 1.1)
111
+ rubocop (>= 1.75.0, < 2.0)
112
+ rubocop-ast (>= 1.38.0, < 2.0)
113
+ rubocop-rake (0.7.1)
114
+ lint_roller (~> 1.1)
115
+ rubocop (>= 1.72.1)
116
+ rubocop-rspec (3.6.0)
117
+ lint_roller (~> 1.1)
118
+ rubocop (~> 1.72, >= 1.72.1)
119
+ rubocop-rspec_rails (2.31.0)
120
+ lint_roller (~> 1.1)
121
+ rubocop (~> 1.72, >= 1.72.1)
122
+ rubocop-rspec (~> 3.5)
113
123
  ruby-progressbar (1.13.0)
114
- ruby2_keywords (0.0.5)
115
124
  sawyer (0.9.2)
116
125
  addressable (>= 2.3.5)
117
126
  faraday (>= 0.17.3, < 3)
127
+ securerandom (0.4.1)
118
128
  simplecov (0.22.0)
119
129
  docile (~> 1.1)
120
130
  simplecov-html (~> 0.11)
121
131
  simplecov_json_formatter (~> 0.1)
122
- simplecov-html (0.12.3)
132
+ simplecov-html (0.13.1)
123
133
  simplecov_json_formatter (0.1.4)
124
134
  tzinfo (2.0.6)
125
135
  concurrent-ruby (~> 1.0)
126
- unicode-display_width (2.5.0)
127
- webmock (3.19.1)
136
+ unicode-display_width (3.1.4)
137
+ unicode-emoji (~> 4.0, >= 4.0.4)
138
+ unicode-emoji (4.0.4)
139
+ uri (1.0.3)
140
+ webmock (3.25.1)
128
141
  addressable (>= 2.8.0)
129
142
  crack (>= 0.3.2)
130
143
  hashdiff (>= 0.4.0, < 2.0.0)
131
- yard (0.9.34)
144
+ yard (0.9.37)
132
145
 
133
146
  PLATFORMS
134
147
  ruby
@@ -145,9 +158,10 @@ DEPENDENCIES
145
158
  rubocop-performance
146
159
  rubocop-rake
147
160
  rubocop-rspec
161
+ rubocop-rspec_rails
148
162
  simplecov (= 0.22.0)
149
163
  webmock
150
164
  yard
151
165
 
152
166
  BUNDLED WITH
153
- 2.3.26
167
+ 2.6.9
data/README.jp.md CHANGED
@@ -12,8 +12,8 @@ MyApiClient は API リクエストクラスを作成するための汎用的な
12
12
 
13
13
  ## Supported Versions
14
14
 
15
- - Ruby 3.0, 3.1, 3.2
16
- - Rails 6.1, 7.0
15
+ - Ruby 3.1, 3.2, 3.3
16
+ - Rails 6.1, 7.0, 7.1, 7.2
17
17
 
18
18
  ## Installation
19
19
 
data/README.md CHANGED
@@ -16,8 +16,8 @@ It is supposed to be used in Ruby on Rails, but it is made to work in other envi
16
16
 
17
17
  ## Supported Versions
18
18
 
19
- - Ruby 3.0, 3.1, 3.2
20
- - Rails 6.1, 7.0
19
+ - Ruby 3.1, 3.2, 3.3
20
+ - Rails 6.1, 7.0, 7.1, 7.2
21
21
 
22
22
  ## Installation
23
23
 
@@ -23,7 +23,7 @@ class MyErrorApiClient < ApplicationApiClient
23
23
 
24
24
  # GET error/:code
25
25
  def get_error(code:)
26
- get "error/#{code}", headers: headers
26
+ get "error/#{code}", headers:
27
27
  end
28
28
 
29
29
  private
@@ -24,7 +24,7 @@ class MyHeaderApiClient < ApplicationApiClient
24
24
  # @param second_header [String] X-Second-Header
25
25
  # @return [Sawyer::Resource]
26
26
  def get_header(first_header:, second_header:)
27
- get 'header', headers: headers, query: {
27
+ get 'header', headers:, query: {
28
28
  'X-First-Header': first_header,
29
29
  'X-Second-Header': second_header,
30
30
  }.compact
@@ -8,13 +8,13 @@ class MyPaginationApiClient < ApplicationApiClient
8
8
  # Paging with JSONPath
9
9
  # GET pagination?page=1
10
10
  def paging_with_jsonpath
11
- pget 'pagination', headers: headers, query: { page: 1 }, paging: '$.links.next'
11
+ pget 'pagination', headers:, query: { page: 1 }, paging: '$.links.next'
12
12
  end
13
13
 
14
14
  # Paging with Proc
15
15
  # GET pagination?page=1
16
16
  def paging_with_proc
17
- pget 'pagination', headers: headers, query: { page: 1 }, paging: lambda { |response|
17
+ pget 'pagination', headers:, query: { page: 1 }, paging: lambda { |response|
18
18
  response.data.links.next
19
19
  }
20
20
  end
@@ -8,36 +8,36 @@ class MyRestApiClient < ApplicationApiClient
8
8
  # GET rest
9
9
  def get_posts(order: :asc)
10
10
  order = :desc unless order == :asc
11
- query = { order: order }
12
- get 'rest', query: query, headers: headers
11
+ query = { order: }
12
+ get 'rest', query:, headers:
13
13
  end
14
14
 
15
15
  # GET rest/:id
16
16
  def get_post(id:)
17
- get "rest/#{id}", headers: headers
17
+ get "rest/#{id}", headers:
18
18
  end
19
19
 
20
20
  # POST rest
21
21
  def post_post(title:)
22
- body = { title: title }
23
- post 'rest', body: body, headers: headers
22
+ body = { title: }
23
+ post 'rest', body:, headers:
24
24
  end
25
25
 
26
26
  # PUT rest/:id
27
27
  def put_post(id:, title:)
28
- body = { title: title }
29
- put "rest/#{id}", body: body, headers: headers
28
+ body = { title: }
29
+ put "rest/#{id}", body:, headers:
30
30
  end
31
31
 
32
32
  # PATCH rest/:id
33
33
  def patch_post(id:, title:)
34
- body = { title: title }
35
- patch "rest/#{id}", body: body, headers: headers
34
+ body = { title: }
35
+ patch "rest/#{id}", body:, headers:
36
36
  end
37
37
 
38
38
  # DELETE rest/:id
39
39
  def delete_post(id:)
40
- delete "rest/#{id}", headers: headers
40
+ delete "rest/#{id}", headers:
41
41
  end
42
42
 
43
43
  private
@@ -11,7 +11,7 @@ class MyStatusApiClient < ApplicationApiClient
11
11
 
12
12
  # GET status/:status
13
13
  def get_status(status:)
14
- get "status/#{status}", headers: headers
14
+ get "status/#{status}", headers:
15
15
  end
16
16
 
17
17
  private
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'https://rubygems.org'
6
+
7
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
8
+
9
+ gem 'activesupport', '~> 7.1.0'
10
+
11
+ group :integrations, optional: true do
12
+ gem 'bugsnag', '>= 6.11.0'
13
+ end
14
+
15
+ gemspec
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'https://rubygems.org'
6
+
7
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
8
+
9
+ gem 'activesupport', '~> 7.2.0'
10
+
11
+ group :integrations, optional: true do
12
+ gem 'bugsnag', '>= 6.11.0'
13
+ end
14
+
15
+ gemspec
@@ -8,7 +8,7 @@ module MyApiClient
8
8
  include MyApiClient::Exceptions
9
9
  include MyApiClient::Request
10
10
 
11
- class_attribute :logger, instance_writer: false, default: ::Logger.new($stdout)
11
+ class_attribute :logger, default: ::Logger.new($stdout)
12
12
  class_attribute :error_handlers, instance_writer: false, default: []
13
13
 
14
14
  include MyApiClient::DefaultErrorHandlers
@@ -50,7 +50,7 @@ module MyApiClient
50
50
 
51
51
  new_error_handlers = error_handlers.dup
52
52
  new_error_handlers << lambda { |instance, response|
53
- Generator.call(**options.merge(instance: instance, response: response))
53
+ Generator.call(**options, instance:, response:)
54
54
  }
55
55
  self.error_handlers = new_error_handlers
56
56
  end
@@ -30,7 +30,7 @@ module MyApiClient
30
30
  #
31
31
  # @return [String] Contents as string
32
32
  def inspect
33
- { error: original_error, params: params }.inspect
33
+ { error: original_error, params: }.inspect
34
34
  end
35
35
 
36
36
  # Generate metadata for bugsnag.
@@ -23,7 +23,7 @@ module MyApiClient
23
23
  #
24
24
  # @return [String] Contents as string
25
25
  def inspect
26
- { error: super, params: params }.inspect
26
+ { error: super, params: }.inspect
27
27
  end
28
28
  end
29
29
  end
@@ -51,7 +51,7 @@ module MyApiClient
51
51
  end
52
52
 
53
53
  def retry_calling(wait)
54
- Sleeper.call(wait: wait)
54
+ Sleeper.call(wait:)
55
55
  @retry_count += 1
56
56
  @retry_result = call(*args)
57
57
  end
@@ -29,7 +29,7 @@ module MyApiClient
29
29
  #
30
30
  # @return [String] Contents as string
31
31
  def inspect
32
- { request: request, response: response }.inspect
32
+ { request:, response: }.inspect
33
33
  end
34
34
 
35
35
  private