my_api_client 0.14.0.pre → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +179 -38
  3. data/.dependabot/config.yml +19 -1
  4. data/.envrc.skeleton +1 -0
  5. data/.rubocop.yml +9 -1
  6. data/.rubocop_challenge.yml +5 -0
  7. data/.rubocop_todo.yml +29 -1
  8. data/CHANGELOG.md +177 -1
  9. data/Gemfile.lock +47 -45
  10. data/README.jp.md +156 -21
  11. data/bin/console +4 -0
  12. data/example/api_clients/application_api_client.rb +13 -0
  13. data/example/api_clients/my_error_api_client.rb +34 -0
  14. data/example/api_clients/my_errors.rb +27 -0
  15. data/example/api_clients/my_pagination_api_client.rb +18 -0
  16. data/example/api_clients/my_rest_api_client.rb +48 -0
  17. data/example/api_clients/my_status_api_client.rb +22 -0
  18. data/lib/generators/rails/templates/application_api_client.rb.erb +0 -11
  19. data/lib/generators/rspec/templates/api_client_spec.rb.erb +22 -15
  20. data/lib/my_api_client.rb +7 -0
  21. data/lib/my_api_client/base.rb +4 -2
  22. data/lib/my_api_client/default_error_handlers.rb +64 -0
  23. data/lib/my_api_client/error_handling.rb +6 -6
  24. data/lib/my_api_client/error_handling/generator.rb +23 -7
  25. data/lib/my_api_client/errors.rb +1 -53
  26. data/lib/my_api_client/errors/api_limit_error.rb +6 -0
  27. data/lib/my_api_client/errors/client_error.rb +93 -0
  28. data/lib/my_api_client/errors/network_error.rb +43 -0
  29. data/lib/my_api_client/errors/server_error.rb +42 -0
  30. data/lib/my_api_client/request.rb +29 -34
  31. data/lib/my_api_client/request/basic.rb +32 -0
  32. data/lib/my_api_client/request/executor.rb +1 -1
  33. data/lib/my_api_client/request/pagination.rb +39 -0
  34. data/lib/my_api_client/rspec/matchers/request_to.rb +3 -4
  35. data/lib/my_api_client/version.rb +1 -1
  36. data/my_api/.envrc.skeleton +3 -0
  37. data/my_api/.gitignore +14 -0
  38. data/my_api/.jetskeep +1 -0
  39. data/my_api/.rspec +3 -0
  40. data/my_api/.ruby-version +1 -0
  41. data/my_api/Gemfile +23 -0
  42. data/my_api/Gemfile.lock +243 -0
  43. data/my_api/Procfile +7 -0
  44. data/my_api/README.md +54 -0
  45. data/my_api/Rakefile +4 -0
  46. data/my_api/app/controllers/application_controller.rb +5 -0
  47. data/my_api/app/controllers/error_controller.rb +21 -0
  48. data/my_api/app/controllers/pagination_controller.rb +58 -0
  49. data/my_api/app/controllers/rest_controller.rb +60 -0
  50. data/my_api/app/controllers/status_controller.rb +11 -0
  51. data/my_api/app/helpers/application_helper.rb +5 -0
  52. data/my_api/app/jobs/application_job.rb +7 -0
  53. data/my_api/app/models/application_item.rb +5 -0
  54. data/my_api/config.ru +7 -0
  55. data/my_api/config/application.rb +73 -0
  56. data/my_api/config/dynamodb.yml +22 -0
  57. data/my_api/config/environments/development.rb +9 -0
  58. data/my_api/config/environments/production.rb +11 -0
  59. data/my_api/config/environments/test.rb +9 -0
  60. data/my_api/config/routes.rb +17 -0
  61. data/my_api/db/.gitkeep +0 -0
  62. data/my_api/public/404.html +67 -0
  63. data/my_api/public/422.html +67 -0
  64. data/my_api/public/500.html +66 -0
  65. data/my_api/public/favicon.ico +0 -0
  66. data/my_api/public/index.html +91 -0
  67. data/my_api/spec/controllers/error_controller_spec.rb +43 -0
  68. data/my_api/spec/controllers/pagination_controller_spec.rb +73 -0
  69. data/my_api/spec/controllers/rest_controller_spec.rb +99 -0
  70. data/my_api/spec/controllers/status_controller_spec.rb +47 -0
  71. data/my_api/spec/fixtures/payloads/posts-index.json +51 -0
  72. data/my_api/spec/fixtures/payloads/posts-show.json +53 -0
  73. data/my_api/spec/spec_helper.rb +31 -0
  74. data/rails_app/rails_5.2/.rspec +3 -0
  75. data/rails_app/rails_5.2/Gemfile +18 -0
  76. data/rails_app/rails_5.2/Gemfile.lock +171 -0
  77. data/rails_app/rails_5.2/README.md +24 -0
  78. data/rails_app/rails_5.2/Rakefile +8 -0
  79. data/rails_app/rails_5.2/app/controllers/application_controller.rb +4 -0
  80. data/rails_app/rails_5.2/app/jobs/application_job.rb +4 -0
  81. data/rails_app/rails_5.2/bin/bundle +5 -0
  82. data/rails_app/rails_5.2/bin/rails +6 -0
  83. data/rails_app/rails_5.2/bin/rake +6 -0
  84. data/rails_app/rails_5.2/bin/setup +27 -0
  85. data/rails_app/rails_5.2/bin/update +27 -0
  86. data/rails_app/rails_5.2/config.ru +7 -0
  87. data/rails_app/rails_5.2/config/application.rb +37 -0
  88. data/rails_app/rails_5.2/config/boot.rb +6 -0
  89. data/rails_app/rails_5.2/config/credentials.yml.enc +1 -0
  90. data/rails_app/rails_5.2/config/environment.rb +7 -0
  91. data/rails_app/rails_5.2/config/environments/development.rb +41 -0
  92. data/rails_app/rails_5.2/config/environments/production.rb +70 -0
  93. data/rails_app/rails_5.2/config/environments/test.rb +38 -0
  94. data/rails_app/rails_5.2/config/initializers/application_controller_renderer.rb +9 -0
  95. data/rails_app/rails_5.2/config/initializers/backtrace_silencers.rb +8 -0
  96. data/rails_app/rails_5.2/config/initializers/cors.rb +17 -0
  97. data/rails_app/rails_5.2/config/initializers/filter_parameter_logging.rb +6 -0
  98. data/rails_app/rails_5.2/config/initializers/inflections.rb +17 -0
  99. data/rails_app/rails_5.2/config/initializers/mime_types.rb +5 -0
  100. data/rails_app/rails_5.2/config/initializers/wrap_parameters.rb +11 -0
  101. data/rails_app/rails_5.2/config/locales/en.yml +33 -0
  102. data/rails_app/rails_5.2/config/routes.rb +5 -0
  103. data/rails_app/rails_5.2/config/spring.rb +8 -0
  104. data/rails_app/rails_5.2/public/robots.txt +1 -0
  105. data/rails_app/rails_5.2/spec/rails_helper.rb +14 -0
  106. data/rails_app/rails_5.2/spec/spec_helper.rb +13 -0
  107. data/rails_app/rails_6.0/.rspec +3 -0
  108. data/rails_app/rails_6.0/Gemfile +17 -0
  109. data/rails_app/rails_6.0/Gemfile.lock +186 -0
  110. data/rails_app/rails_6.0/README.md +24 -0
  111. data/rails_app/rails_6.0/Rakefile +8 -0
  112. data/rails_app/rails_6.0/app/controllers/application_controller.rb +4 -0
  113. data/rails_app/rails_6.0/app/jobs/application_job.rb +9 -0
  114. data/rails_app/rails_6.0/bin/rails +6 -0
  115. data/rails_app/rails_6.0/bin/rake +6 -0
  116. data/rails_app/rails_6.0/bin/setup +27 -0
  117. data/rails_app/rails_6.0/config.ru +7 -0
  118. data/rails_app/rails_6.0/config/application.rb +39 -0
  119. data/rails_app/rails_6.0/config/boot.rb +6 -0
  120. data/rails_app/rails_6.0/config/credentials.yml.enc +1 -0
  121. data/rails_app/rails_6.0/config/environment.rb +7 -0
  122. data/rails_app/rails_6.0/config/environments/development.rb +39 -0
  123. data/rails_app/rails_6.0/config/environments/production.rb +90 -0
  124. data/rails_app/rails_6.0/config/environments/test.rb +41 -0
  125. data/rails_app/rails_6.0/config/initializers/application_controller_renderer.rb +9 -0
  126. data/rails_app/rails_6.0/config/initializers/backtrace_silencers.rb +8 -0
  127. data/rails_app/rails_6.0/config/initializers/cors.rb +17 -0
  128. data/rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb +6 -0
  129. data/rails_app/rails_6.0/config/initializers/inflections.rb +17 -0
  130. data/rails_app/rails_6.0/config/initializers/mime_types.rb +5 -0
  131. data/rails_app/rails_6.0/config/initializers/wrap_parameters.rb +11 -0
  132. data/rails_app/rails_6.0/config/locales/en.yml +33 -0
  133. data/rails_app/rails_6.0/config/routes.rb +5 -0
  134. data/rails_app/rails_6.0/config/spring.rb +8 -0
  135. data/rails_app/rails_6.0/public/robots.txt +1 -0
  136. data/rails_app/rails_6.0/spec/rails_helper.rb +14 -0
  137. data/rails_app/rails_6.0/spec/spec_helper.rb +13 -0
  138. metadata +120 -5
  139. data/renovate.json +0 -21
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.routes.draw do
4
+ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ Spring.watch(
4
+ '.ruby-version',
5
+ '.rbenv-vars',
6
+ 'tmp/restart.txt',
7
+ 'tmp/caching-dev.txt'
8
+ )
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ ENV['RAILS_ENV'] ||= 'test'
5
+ require File.expand_path('../config/environment', __dir__)
6
+ abort('The Rails environment is running in production mode!') if Rails.env.production?
7
+ require 'rspec/rails'
8
+ require 'my_api_client/rspec'
9
+
10
+ RSpec.configure do |config|
11
+ config.use_active_record = false
12
+ config.infer_spec_type_from_file_location!
13
+ config.filter_rails_from_backtrace!
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
+ end
7
+
8
+ config.mock_with :rspec do |mocks|
9
+ mocks.verify_partial_doubles = true
10
+ end
11
+
12
+ config.shared_context_metadata_behavior = :apply_to_host_groups
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0.pre
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryz310
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-23 00:00:00.000000000 Z
11
+ date: 2020-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -234,6 +234,7 @@ files:
234
234
  - ".gitignore"
235
235
  - ".rspec"
236
236
  - ".rubocop.yml"
237
+ - ".rubocop_challenge.yml"
237
238
  - ".rubocop_todo.yml"
238
239
  - CHANGELOG.md
239
240
  - CODE_OF_CONDUCT.md
@@ -245,6 +246,12 @@ files:
245
246
  - Rakefile
246
247
  - bin/console
247
248
  - bin/setup
249
+ - example/api_clients/application_api_client.rb
250
+ - example/api_clients/my_error_api_client.rb
251
+ - example/api_clients/my_errors.rb
252
+ - example/api_clients/my_pagination_api_client.rb
253
+ - example/api_clients/my_rest_api_client.rb
254
+ - example/api_clients/my_status_api_client.rb
248
255
  - gemfiles/rails_4.2.gemfile
249
256
  - gemfiles/rails_5.0.gemfile
250
257
  - gemfiles/rails_5.1.gemfile
@@ -261,17 +268,24 @@ files:
261
268
  - lib/my_api_client.rb
262
269
  - lib/my_api_client/base.rb
263
270
  - lib/my_api_client/config.rb
271
+ - lib/my_api_client/default_error_handlers.rb
264
272
  - lib/my_api_client/error_handling.rb
265
273
  - lib/my_api_client/error_handling/generator.rb
266
274
  - lib/my_api_client/error_handling/retry_option_processor.rb
267
275
  - lib/my_api_client/errors.rb
276
+ - lib/my_api_client/errors/api_limit_error.rb
277
+ - lib/my_api_client/errors/client_error.rb
278
+ - lib/my_api_client/errors/network_error.rb
279
+ - lib/my_api_client/errors/server_error.rb
268
280
  - lib/my_api_client/exceptions.rb
269
281
  - lib/my_api_client/integrations/bugsnag.rb
270
282
  - lib/my_api_client/params/params.rb
271
283
  - lib/my_api_client/params/request.rb
272
284
  - lib/my_api_client/request.rb
285
+ - lib/my_api_client/request/basic.rb
273
286
  - lib/my_api_client/request/executor.rb
274
287
  - lib/my_api_client/request/logger.rb
288
+ - lib/my_api_client/request/pagination.rb
275
289
  - lib/my_api_client/rspec.rb
276
290
  - lib/my_api_client/rspec/matcher_helper.rb
277
291
  - lib/my_api_client/rspec/matchers/be_handled_as_an_error.rb
@@ -280,8 +294,109 @@ files:
280
294
  - lib/my_api_client/service_abstract.rb
281
295
  - lib/my_api_client/sleeper.rb
282
296
  - lib/my_api_client/version.rb
297
+ - my_api/.envrc.skeleton
298
+ - my_api/.gitignore
299
+ - my_api/.jetskeep
300
+ - my_api/.rspec
301
+ - my_api/.ruby-version
302
+ - my_api/Gemfile
303
+ - my_api/Gemfile.lock
304
+ - my_api/Procfile
305
+ - my_api/README.md
306
+ - my_api/Rakefile
307
+ - my_api/app/controllers/application_controller.rb
308
+ - my_api/app/controllers/error_controller.rb
309
+ - my_api/app/controllers/pagination_controller.rb
310
+ - my_api/app/controllers/rest_controller.rb
311
+ - my_api/app/controllers/status_controller.rb
312
+ - my_api/app/helpers/application_helper.rb
313
+ - my_api/app/jobs/application_job.rb
314
+ - my_api/app/models/application_item.rb
315
+ - my_api/config.ru
316
+ - my_api/config/application.rb
317
+ - my_api/config/dynamodb.yml
318
+ - my_api/config/environments/development.rb
319
+ - my_api/config/environments/production.rb
320
+ - my_api/config/environments/test.rb
321
+ - my_api/config/routes.rb
322
+ - my_api/db/.gitkeep
323
+ - my_api/public/404.html
324
+ - my_api/public/422.html
325
+ - my_api/public/500.html
326
+ - my_api/public/favicon.ico
327
+ - my_api/public/index.html
328
+ - my_api/spec/controllers/error_controller_spec.rb
329
+ - my_api/spec/controllers/pagination_controller_spec.rb
330
+ - my_api/spec/controllers/rest_controller_spec.rb
331
+ - my_api/spec/controllers/status_controller_spec.rb
332
+ - my_api/spec/fixtures/payloads/posts-index.json
333
+ - my_api/spec/fixtures/payloads/posts-show.json
334
+ - my_api/spec/spec_helper.rb
283
335
  - my_api_client.gemspec
284
- - renovate.json
336
+ - rails_app/rails_5.2/.rspec
337
+ - rails_app/rails_5.2/Gemfile
338
+ - rails_app/rails_5.2/Gemfile.lock
339
+ - rails_app/rails_5.2/README.md
340
+ - rails_app/rails_5.2/Rakefile
341
+ - rails_app/rails_5.2/app/controllers/application_controller.rb
342
+ - rails_app/rails_5.2/app/jobs/application_job.rb
343
+ - rails_app/rails_5.2/bin/bundle
344
+ - rails_app/rails_5.2/bin/rails
345
+ - rails_app/rails_5.2/bin/rake
346
+ - rails_app/rails_5.2/bin/setup
347
+ - rails_app/rails_5.2/bin/update
348
+ - rails_app/rails_5.2/config.ru
349
+ - rails_app/rails_5.2/config/application.rb
350
+ - rails_app/rails_5.2/config/boot.rb
351
+ - rails_app/rails_5.2/config/credentials.yml.enc
352
+ - rails_app/rails_5.2/config/environment.rb
353
+ - rails_app/rails_5.2/config/environments/development.rb
354
+ - rails_app/rails_5.2/config/environments/production.rb
355
+ - rails_app/rails_5.2/config/environments/test.rb
356
+ - rails_app/rails_5.2/config/initializers/application_controller_renderer.rb
357
+ - rails_app/rails_5.2/config/initializers/backtrace_silencers.rb
358
+ - rails_app/rails_5.2/config/initializers/cors.rb
359
+ - rails_app/rails_5.2/config/initializers/filter_parameter_logging.rb
360
+ - rails_app/rails_5.2/config/initializers/inflections.rb
361
+ - rails_app/rails_5.2/config/initializers/mime_types.rb
362
+ - rails_app/rails_5.2/config/initializers/wrap_parameters.rb
363
+ - rails_app/rails_5.2/config/locales/en.yml
364
+ - rails_app/rails_5.2/config/routes.rb
365
+ - rails_app/rails_5.2/config/spring.rb
366
+ - rails_app/rails_5.2/public/robots.txt
367
+ - rails_app/rails_5.2/spec/rails_helper.rb
368
+ - rails_app/rails_5.2/spec/spec_helper.rb
369
+ - rails_app/rails_6.0/.rspec
370
+ - rails_app/rails_6.0/Gemfile
371
+ - rails_app/rails_6.0/Gemfile.lock
372
+ - rails_app/rails_6.0/README.md
373
+ - rails_app/rails_6.0/Rakefile
374
+ - rails_app/rails_6.0/app/controllers/application_controller.rb
375
+ - rails_app/rails_6.0/app/jobs/application_job.rb
376
+ - rails_app/rails_6.0/bin/rails
377
+ - rails_app/rails_6.0/bin/rake
378
+ - rails_app/rails_6.0/bin/setup
379
+ - rails_app/rails_6.0/config.ru
380
+ - rails_app/rails_6.0/config/application.rb
381
+ - rails_app/rails_6.0/config/boot.rb
382
+ - rails_app/rails_6.0/config/credentials.yml.enc
383
+ - rails_app/rails_6.0/config/environment.rb
384
+ - rails_app/rails_6.0/config/environments/development.rb
385
+ - rails_app/rails_6.0/config/environments/production.rb
386
+ - rails_app/rails_6.0/config/environments/test.rb
387
+ - rails_app/rails_6.0/config/initializers/application_controller_renderer.rb
388
+ - rails_app/rails_6.0/config/initializers/backtrace_silencers.rb
389
+ - rails_app/rails_6.0/config/initializers/cors.rb
390
+ - rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb
391
+ - rails_app/rails_6.0/config/initializers/inflections.rb
392
+ - rails_app/rails_6.0/config/initializers/mime_types.rb
393
+ - rails_app/rails_6.0/config/initializers/wrap_parameters.rb
394
+ - rails_app/rails_6.0/config/locales/en.yml
395
+ - rails_app/rails_6.0/config/routes.rb
396
+ - rails_app/rails_6.0/config/spring.rb
397
+ - rails_app/rails_6.0/public/robots.txt
398
+ - rails_app/rails_6.0/spec/rails_helper.rb
399
+ - rails_app/rails_6.0/spec/spec_helper.rb
285
400
  homepage: https://github.com/ryz310/my_api_client
286
401
  licenses:
287
402
  - MIT
@@ -297,9 +412,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
412
  version: 2.4.0
298
413
  required_rubygems_version: !ruby/object:Gem::Requirement
299
414
  requirements:
300
- - - ">"
415
+ - - ">="
301
416
  - !ruby/object:Gem::Version
302
- version: 1.3.1
417
+ version: '0'
303
418
  requirements: []
304
419
  rubygems_version: 3.1.2
305
420
  signing_key:
@@ -1,21 +0,0 @@
1
- {
2
- "extends": [
3
- "config:base"
4
- ],
5
- "packageRules": [
6
- {
7
- "updateTypes": ["major"],
8
- "labels": ["renovate", "major"]
9
- },
10
- {
11
- "updateTypes": ["minor"],
12
- "labels": ["renovate", "minor", "auto merge"],
13
- "automerge": true
14
- },
15
- {
16
- "updateTypes": ["patch"],
17
- "labels": ["renovate", "patch", "auto merge"],
18
- "automerge": true
19
- }
20
- ]
21
- }