my_api_client 0.16.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +95 -135
  3. data/.gem_comet.yml +13 -2
  4. data/.rubocop.yml +5 -1
  5. data/.rubocop_todo.yml +39 -1
  6. data/CHANGELOG.md +142 -0
  7. data/Gemfile +0 -3
  8. data/Gemfile.lock +70 -64
  9. data/README.jp.md +126 -5
  10. data/bin/console +4 -0
  11. data/example/api_clients/application_api_client.rb +2 -2
  12. data/example/api_clients/my_rest_api_client.rb +9 -3
  13. data/gemfiles/{rails_4.2.gemfile → rails_6.1.gemfile} +1 -1
  14. data/lib/generators/rails/USAGE +1 -1
  15. data/lib/generators/rails/api_client_generator.rb +6 -0
  16. data/lib/generators/rails/templates/api_client.rb.erb +1 -1
  17. data/lib/generators/rspec/USAGE +1 -1
  18. data/lib/generators/rspec/api_client_generator.rb +6 -0
  19. data/lib/generators/rspec/templates/api_client_spec.rb.erb +23 -16
  20. data/lib/my_api_client/base.rb +2 -9
  21. data/lib/my_api_client/error_handling/generator.rb +0 -2
  22. data/lib/my_api_client/errors.rb +1 -0
  23. data/lib/my_api_client/integrations/bugsnag.rb +1 -1
  24. data/lib/my_api_client/params/params.rb +1 -3
  25. data/lib/my_api_client/request.rb +3 -3
  26. data/lib/my_api_client/request/basic.rb +1 -3
  27. data/lib/my_api_client/request/executor.rb +1 -1
  28. data/lib/my_api_client/rspec/matchers/request_to.rb +1 -1
  29. data/lib/my_api_client/rspec/stub.rb +30 -9
  30. data/lib/my_api_client/version.rb +1 -1
  31. data/my_api/.ruby-version +1 -1
  32. data/my_api/Gemfile +3 -0
  33. data/my_api/Gemfile.lock +116 -108
  34. data/my_api/app/controllers/pagination_controller.rb +2 -2
  35. data/my_api/spec/controllers/rest_controller_spec.rb +23 -5
  36. data/my_api_client.gemspec +3 -3
  37. data/rails_app/rails_5.2/.rspec +3 -0
  38. data/rails_app/rails_5.2/Gemfile +17 -0
  39. data/rails_app/rails_5.2/Gemfile.lock +174 -0
  40. data/rails_app/rails_5.2/README.md +24 -0
  41. data/rails_app/rails_5.2/Rakefile +8 -0
  42. data/rails_app/rails_5.2/app/controllers/application_controller.rb +4 -0
  43. data/rails_app/rails_5.2/app/jobs/application_job.rb +4 -0
  44. data/rails_app/rails_5.2/bin/bundle +5 -0
  45. data/rails_app/rails_5.2/bin/rails +6 -0
  46. data/rails_app/rails_5.2/bin/rake +6 -0
  47. data/rails_app/rails_5.2/bin/setup +27 -0
  48. data/rails_app/rails_5.2/bin/update +27 -0
  49. data/rails_app/rails_5.2/config.ru +7 -0
  50. data/rails_app/rails_5.2/config/application.rb +37 -0
  51. data/rails_app/rails_5.2/config/boot.rb +6 -0
  52. data/rails_app/rails_5.2/config/credentials.yml.enc +1 -0
  53. data/rails_app/rails_5.2/config/environment.rb +7 -0
  54. data/rails_app/rails_5.2/config/environments/development.rb +41 -0
  55. data/rails_app/rails_5.2/config/environments/production.rb +70 -0
  56. data/rails_app/rails_5.2/config/environments/test.rb +38 -0
  57. data/rails_app/rails_5.2/config/initializers/application_controller_renderer.rb +9 -0
  58. data/rails_app/rails_5.2/config/initializers/backtrace_silencers.rb +8 -0
  59. data/rails_app/rails_5.2/config/initializers/cors.rb +17 -0
  60. data/rails_app/rails_5.2/config/initializers/filter_parameter_logging.rb +6 -0
  61. data/rails_app/rails_5.2/config/initializers/inflections.rb +17 -0
  62. data/rails_app/rails_5.2/config/initializers/mime_types.rb +5 -0
  63. data/rails_app/rails_5.2/config/initializers/wrap_parameters.rb +11 -0
  64. data/rails_app/rails_5.2/config/locales/en.yml +33 -0
  65. data/rails_app/rails_5.2/config/routes.rb +5 -0
  66. data/rails_app/rails_5.2/config/spring.rb +8 -0
  67. data/rails_app/rails_5.2/public/robots.txt +1 -0
  68. data/rails_app/rails_5.2/spec/rails_helper.rb +14 -0
  69. data/rails_app/rails_5.2/spec/spec_helper.rb +13 -0
  70. data/rails_app/rails_6.0/.rspec +3 -0
  71. data/rails_app/rails_6.0/Gemfile +17 -0
  72. data/rails_app/rails_6.0/Gemfile.lock +190 -0
  73. data/rails_app/rails_6.0/README.md +24 -0
  74. data/rails_app/rails_6.0/Rakefile +8 -0
  75. data/rails_app/rails_6.0/app/controllers/application_controller.rb +4 -0
  76. data/rails_app/rails_6.0/app/jobs/application_job.rb +9 -0
  77. data/rails_app/rails_6.0/bin/rails +6 -0
  78. data/rails_app/rails_6.0/bin/rake +6 -0
  79. data/rails_app/rails_6.0/bin/setup +27 -0
  80. data/rails_app/rails_6.0/config.ru +7 -0
  81. data/rails_app/rails_6.0/config/application.rb +39 -0
  82. data/rails_app/rails_6.0/config/boot.rb +6 -0
  83. data/rails_app/rails_6.0/config/credentials.yml.enc +1 -0
  84. data/rails_app/rails_6.0/config/environment.rb +7 -0
  85. data/rails_app/rails_6.0/config/environments/development.rb +39 -0
  86. data/rails_app/rails_6.0/config/environments/production.rb +90 -0
  87. data/rails_app/rails_6.0/config/environments/test.rb +41 -0
  88. data/rails_app/rails_6.0/config/initializers/application_controller_renderer.rb +9 -0
  89. data/rails_app/rails_6.0/config/initializers/backtrace_silencers.rb +8 -0
  90. data/rails_app/rails_6.0/config/initializers/cors.rb +17 -0
  91. data/rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb +6 -0
  92. data/rails_app/rails_6.0/config/initializers/inflections.rb +17 -0
  93. data/rails_app/rails_6.0/config/initializers/mime_types.rb +5 -0
  94. data/rails_app/rails_6.0/config/initializers/wrap_parameters.rb +11 -0
  95. data/rails_app/rails_6.0/config/locales/en.yml +33 -0
  96. data/rails_app/rails_6.0/config/routes.rb +5 -0
  97. data/rails_app/rails_6.0/config/spring.rb +8 -0
  98. data/rails_app/rails_6.0/public/robots.txt +1 -0
  99. data/rails_app/rails_6.0/spec/rails_helper.rb +14 -0
  100. data/rails_app/rails_6.0/spec/spec_helper.rb +13 -0
  101. data/rails_app/rails_6.1/.gitattributes +8 -0
  102. data/rails_app/rails_6.1/.gitignore +28 -0
  103. data/rails_app/rails_6.1/.rspec +3 -0
  104. data/rails_app/rails_6.1/Gemfile +17 -0
  105. data/rails_app/rails_6.1/Gemfile.lock +197 -0
  106. data/rails_app/rails_6.1/README.md +24 -0
  107. data/rails_app/rails_6.1/Rakefile +6 -0
  108. data/rails_app/rails_6.1/app/controllers/application_controller.rb +4 -0
  109. data/rails_app/rails_6.1/app/controllers/concerns/.keep +0 -0
  110. data/rails_app/rails_6.1/app/javascript/.keep +0 -0
  111. data/rails_app/rails_6.1/app/models/application_record.rb +5 -0
  112. data/rails_app/rails_6.1/app/models/concerns/.keep +0 -0
  113. data/rails_app/rails_6.1/bin/bundle +114 -0
  114. data/rails_app/rails_6.1/bin/rails +4 -0
  115. data/rails_app/rails_6.1/bin/rake +4 -0
  116. data/rails_app/rails_6.1/bin/setup +33 -0
  117. data/rails_app/rails_6.1/config.ru +6 -0
  118. data/rails_app/rails_6.1/config/application.rb +42 -0
  119. data/rails_app/rails_6.1/config/boot.rb +5 -0
  120. data/rails_app/rails_6.1/config/credentials.yml.enc +1 -0
  121. data/rails_app/rails_6.1/config/database.yml +25 -0
  122. data/rails_app/rails_6.1/config/environment.rb +7 -0
  123. data/rails_app/rails_6.1/config/environments/development.rb +59 -0
  124. data/rails_app/rails_6.1/config/environments/production.rb +97 -0
  125. data/rails_app/rails_6.1/config/environments/test.rb +51 -0
  126. data/rails_app/rails_6.1/config/initializers/application_controller_renderer.rb +9 -0
  127. data/rails_app/rails_6.1/config/initializers/backtrace_silencers.rb +10 -0
  128. data/rails_app/rails_6.1/config/initializers/cors.rb +17 -0
  129. data/rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb +8 -0
  130. data/rails_app/rails_6.1/config/initializers/inflections.rb +17 -0
  131. data/rails_app/rails_6.1/config/initializers/mime_types.rb +5 -0
  132. data/rails_app/rails_6.1/config/initializers/wrap_parameters.rb +16 -0
  133. data/rails_app/rails_6.1/config/locales/en.yml +33 -0
  134. data/rails_app/rails_6.1/config/routes.rb +5 -0
  135. data/rails_app/rails_6.1/db/seeds.rb +8 -0
  136. data/rails_app/rails_6.1/lib/tasks/.keep +0 -0
  137. data/rails_app/rails_6.1/public/robots.txt +1 -0
  138. data/rails_app/rails_6.1/spec/rails_helper.rb +14 -0
  139. data/rails_app/rails_6.1/spec/spec_helper.rb +13 -0
  140. data/rails_app/rails_6.1/tmp/.keep +0 -0
  141. data/rails_app/rails_6.1/tmp/pids/.keep +0 -0
  142. data/rails_app/rails_6.1/vendor/.keep +0 -0
  143. metadata +115 -9
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -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
+ # This file should contain all the record creation needed to seed the database with its default values.
3
+ # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
4
+ #
5
+ # Examples:
6
+ #
7
+ # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
8
+ # Character.create(name: 'Luke', movie: movies.first)
File without changes
@@ -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 # [Workaround] See: https://github.com/rspec/rspec-rails/issues/2417
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
File without changes
File without changes
File without changes
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.16.0
4
+ version: 0.20.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-03-29 00:00:00.000000000 Z
11
+ date: 2021-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: 5.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.0
26
+ version: 5.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: 0.17.1
187
+ version: 0.21.2
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: 0.17.1
194
+ version: 0.21.2
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: webmock
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -251,11 +251,11 @@ files:
251
251
  - example/api_clients/my_pagination_api_client.rb
252
252
  - example/api_clients/my_rest_api_client.rb
253
253
  - example/api_clients/my_status_api_client.rb
254
- - gemfiles/rails_4.2.gemfile
255
254
  - gemfiles/rails_5.0.gemfile
256
255
  - gemfiles/rails_5.1.gemfile
257
256
  - gemfiles/rails_5.2.gemfile
258
257
  - gemfiles/rails_6.0.gemfile
258
+ - gemfiles/rails_6.1.gemfile
259
259
  - lib/generators/generator_helper.rb
260
260
  - lib/generators/rails/USAGE
261
261
  - lib/generators/rails/api_client_generator.rb
@@ -332,6 +332,112 @@ files:
332
332
  - my_api/spec/fixtures/payloads/posts-show.json
333
333
  - my_api/spec/spec_helper.rb
334
334
  - my_api_client.gemspec
335
+ - rails_app/rails_5.2/.rspec
336
+ - rails_app/rails_5.2/Gemfile
337
+ - rails_app/rails_5.2/Gemfile.lock
338
+ - rails_app/rails_5.2/README.md
339
+ - rails_app/rails_5.2/Rakefile
340
+ - rails_app/rails_5.2/app/controllers/application_controller.rb
341
+ - rails_app/rails_5.2/app/jobs/application_job.rb
342
+ - rails_app/rails_5.2/bin/bundle
343
+ - rails_app/rails_5.2/bin/rails
344
+ - rails_app/rails_5.2/bin/rake
345
+ - rails_app/rails_5.2/bin/setup
346
+ - rails_app/rails_5.2/bin/update
347
+ - rails_app/rails_5.2/config.ru
348
+ - rails_app/rails_5.2/config/application.rb
349
+ - rails_app/rails_5.2/config/boot.rb
350
+ - rails_app/rails_5.2/config/credentials.yml.enc
351
+ - rails_app/rails_5.2/config/environment.rb
352
+ - rails_app/rails_5.2/config/environments/development.rb
353
+ - rails_app/rails_5.2/config/environments/production.rb
354
+ - rails_app/rails_5.2/config/environments/test.rb
355
+ - rails_app/rails_5.2/config/initializers/application_controller_renderer.rb
356
+ - rails_app/rails_5.2/config/initializers/backtrace_silencers.rb
357
+ - rails_app/rails_5.2/config/initializers/cors.rb
358
+ - rails_app/rails_5.2/config/initializers/filter_parameter_logging.rb
359
+ - rails_app/rails_5.2/config/initializers/inflections.rb
360
+ - rails_app/rails_5.2/config/initializers/mime_types.rb
361
+ - rails_app/rails_5.2/config/initializers/wrap_parameters.rb
362
+ - rails_app/rails_5.2/config/locales/en.yml
363
+ - rails_app/rails_5.2/config/routes.rb
364
+ - rails_app/rails_5.2/config/spring.rb
365
+ - rails_app/rails_5.2/public/robots.txt
366
+ - rails_app/rails_5.2/spec/rails_helper.rb
367
+ - rails_app/rails_5.2/spec/spec_helper.rb
368
+ - rails_app/rails_6.0/.rspec
369
+ - rails_app/rails_6.0/Gemfile
370
+ - rails_app/rails_6.0/Gemfile.lock
371
+ - rails_app/rails_6.0/README.md
372
+ - rails_app/rails_6.0/Rakefile
373
+ - rails_app/rails_6.0/app/controllers/application_controller.rb
374
+ - rails_app/rails_6.0/app/jobs/application_job.rb
375
+ - rails_app/rails_6.0/bin/rails
376
+ - rails_app/rails_6.0/bin/rake
377
+ - rails_app/rails_6.0/bin/setup
378
+ - rails_app/rails_6.0/config.ru
379
+ - rails_app/rails_6.0/config/application.rb
380
+ - rails_app/rails_6.0/config/boot.rb
381
+ - rails_app/rails_6.0/config/credentials.yml.enc
382
+ - rails_app/rails_6.0/config/environment.rb
383
+ - rails_app/rails_6.0/config/environments/development.rb
384
+ - rails_app/rails_6.0/config/environments/production.rb
385
+ - rails_app/rails_6.0/config/environments/test.rb
386
+ - rails_app/rails_6.0/config/initializers/application_controller_renderer.rb
387
+ - rails_app/rails_6.0/config/initializers/backtrace_silencers.rb
388
+ - rails_app/rails_6.0/config/initializers/cors.rb
389
+ - rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb
390
+ - rails_app/rails_6.0/config/initializers/inflections.rb
391
+ - rails_app/rails_6.0/config/initializers/mime_types.rb
392
+ - rails_app/rails_6.0/config/initializers/wrap_parameters.rb
393
+ - rails_app/rails_6.0/config/locales/en.yml
394
+ - rails_app/rails_6.0/config/routes.rb
395
+ - rails_app/rails_6.0/config/spring.rb
396
+ - rails_app/rails_6.0/public/robots.txt
397
+ - rails_app/rails_6.0/spec/rails_helper.rb
398
+ - rails_app/rails_6.0/spec/spec_helper.rb
399
+ - rails_app/rails_6.1/.gitattributes
400
+ - rails_app/rails_6.1/.gitignore
401
+ - rails_app/rails_6.1/.rspec
402
+ - rails_app/rails_6.1/Gemfile
403
+ - rails_app/rails_6.1/Gemfile.lock
404
+ - rails_app/rails_6.1/README.md
405
+ - rails_app/rails_6.1/Rakefile
406
+ - rails_app/rails_6.1/app/controllers/application_controller.rb
407
+ - rails_app/rails_6.1/app/controllers/concerns/.keep
408
+ - rails_app/rails_6.1/app/javascript/.keep
409
+ - rails_app/rails_6.1/app/models/application_record.rb
410
+ - rails_app/rails_6.1/app/models/concerns/.keep
411
+ - rails_app/rails_6.1/bin/bundle
412
+ - rails_app/rails_6.1/bin/rails
413
+ - rails_app/rails_6.1/bin/rake
414
+ - rails_app/rails_6.1/bin/setup
415
+ - rails_app/rails_6.1/config.ru
416
+ - rails_app/rails_6.1/config/application.rb
417
+ - rails_app/rails_6.1/config/boot.rb
418
+ - rails_app/rails_6.1/config/credentials.yml.enc
419
+ - rails_app/rails_6.1/config/database.yml
420
+ - rails_app/rails_6.1/config/environment.rb
421
+ - rails_app/rails_6.1/config/environments/development.rb
422
+ - rails_app/rails_6.1/config/environments/production.rb
423
+ - rails_app/rails_6.1/config/environments/test.rb
424
+ - rails_app/rails_6.1/config/initializers/application_controller_renderer.rb
425
+ - rails_app/rails_6.1/config/initializers/backtrace_silencers.rb
426
+ - rails_app/rails_6.1/config/initializers/cors.rb
427
+ - rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb
428
+ - rails_app/rails_6.1/config/initializers/inflections.rb
429
+ - rails_app/rails_6.1/config/initializers/mime_types.rb
430
+ - rails_app/rails_6.1/config/initializers/wrap_parameters.rb
431
+ - rails_app/rails_6.1/config/locales/en.yml
432
+ - rails_app/rails_6.1/config/routes.rb
433
+ - rails_app/rails_6.1/db/seeds.rb
434
+ - rails_app/rails_6.1/lib/tasks/.keep
435
+ - rails_app/rails_6.1/public/robots.txt
436
+ - rails_app/rails_6.1/spec/rails_helper.rb
437
+ - rails_app/rails_6.1/spec/spec_helper.rb
438
+ - rails_app/rails_6.1/tmp/.keep
439
+ - rails_app/rails_6.1/tmp/pids/.keep
440
+ - rails_app/rails_6.1/vendor/.keep
335
441
  homepage: https://github.com/ryz310/my_api_client
336
442
  licenses:
337
443
  - MIT
@@ -344,14 +450,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
344
450
  requirements:
345
451
  - - ">="
346
452
  - !ruby/object:Gem::Version
347
- version: 2.4.0
453
+ version: 2.5.0
348
454
  required_rubygems_version: !ruby/object:Gem::Requirement
349
455
  requirements:
350
456
  - - ">="
351
457
  - !ruby/object:Gem::Version
352
458
  version: '0'
353
459
  requirements: []
354
- rubygems_version: 3.1.2
460
+ rubygems_version: 3.2.3
355
461
  signing_key:
356
462
  specification_version: 4
357
463
  summary: The framework of Web API Client