my_api_client 0.20.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +34 -18
  3. data/.github/dependabot.yml +32 -0
  4. data/.rubocop.yml +10 -10
  5. data/.rubocop_todo.yml +2 -2
  6. data/CHANGELOG.md +215 -249
  7. data/Gemfile.lock +54 -57
  8. data/README.jp.md +36 -34
  9. data/README.md +391 -8
  10. data/example/api_clients/application_api_client.rb +1 -1
  11. data/gemfiles/rails_5.0.gemfile +1 -0
  12. data/gemfiles/rails_5.1.gemfile +1 -0
  13. data/gemfiles/rails_5.2.gemfile +1 -0
  14. data/gemfiles/rails_6.0.gemfile +1 -0
  15. data/gemfiles/rails_7.0.gemfile +15 -0
  16. data/lib/generators/rails/templates/api_client.rb.erb +3 -5
  17. data/lib/generators/rspec/templates/api_client_spec.rb.erb +0 -8
  18. data/lib/my_api_client/errors/network_error.rb +3 -3
  19. data/lib/my_api_client/errors.rb +2 -2
  20. data/lib/my_api_client/integrations/bugsnag.rb +2 -2
  21. data/lib/my_api_client/rspec/matchers/be_handled_as_an_error.rb +3 -3
  22. data/lib/my_api_client/rspec/stub.rb +11 -7
  23. data/lib/my_api_client/version.rb +1 -1
  24. data/my_api/Gemfile +1 -1
  25. data/my_api/Gemfile.lock +100 -99
  26. data/my_api/app/controllers/pagination_controller.rb +1 -1
  27. data/my_api/public/index.html +2 -2
  28. data/my_api/spec/spec_helper.rb +1 -1
  29. data/my_api_client.gemspec +4 -1
  30. data/rails_app/rails_5.2/Gemfile.lock +70 -64
  31. data/rails_app/rails_6.0/Gemfile +1 -0
  32. data/rails_app/rails_6.0/Gemfile.lock +92 -94
  33. data/rails_app/rails_6.1/Gemfile +2 -2
  34. data/rails_app/rails_6.1/Gemfile.lock +91 -95
  35. data/rails_app/rails_6.1/Rakefile +3 -1
  36. data/rails_app/rails_6.1/bin/bundle +28 -20
  37. data/rails_app/rails_6.1/bin/rails +4 -2
  38. data/rails_app/rails_6.1/bin/rake +4 -2
  39. data/rails_app/rails_6.1/bin/setup +3 -1
  40. data/rails_app/rails_6.1/config.ru +3 -1
  41. data/rails_app/rails_7.0/Gemfile +13 -0
  42. data/rails_app/rails_7.0/Gemfile.lock +210 -0
  43. data/rails_app/rails_7.0/README.md +24 -0
  44. data/rails_app/rails_7.0/Rakefile +8 -0
  45. data/rails_app/rails_7.0/app/controllers/application_controller.rb +4 -0
  46. data/rails_app/rails_7.0/app/models/application_record.rb +5 -0
  47. data/rails_app/rails_7.0/bin/bundle +122 -0
  48. data/rails_app/rails_7.0/bin/rails +6 -0
  49. data/rails_app/rails_7.0/bin/rake +6 -0
  50. data/rails_app/rails_7.0/bin/setup +35 -0
  51. data/rails_app/rails_7.0/config/application.rb +41 -0
  52. data/rails_app/rails_7.0/config/boot.rb +5 -0
  53. data/rails_app/rails_7.0/config/credentials.yml.enc +1 -0
  54. data/rails_app/rails_7.0/config/database.yml +25 -0
  55. data/rails_app/rails_7.0/config/environment.rb +7 -0
  56. data/rails_app/rails_7.0/config/environments/development.rb +58 -0
  57. data/rails_app/rails_7.0/config/environments/production.rb +70 -0
  58. data/rails_app/rails_7.0/config/environments/test.rb +52 -0
  59. data/rails_app/rails_7.0/config/initializers/cors.rb +17 -0
  60. data/rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb +8 -0
  61. data/rails_app/rails_7.0/config/initializers/inflections.rb +17 -0
  62. data/rails_app/rails_7.0/config/locales/en.yml +33 -0
  63. data/rails_app/rails_7.0/config/routes.rb +8 -0
  64. data/rails_app/rails_7.0/config.ru +8 -0
  65. data/rails_app/rails_7.0/db/seeds.rb +8 -0
  66. data/rails_app/rails_7.0/public/robots.txt +1 -0
  67. data/rails_app/rails_7.0/spec/rails_helper.rb +14 -0
  68. data/rails_app/rails_7.0/spec/spec_helper.rb +13 -0
  69. metadata +36 -6
  70. data/.dependabot/config.yml +0 -34
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Load the Rails application.
4
+ require_relative 'application'
5
+
6
+ # Initialize the Rails application.
7
+ Rails.application.initialize!
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/integer/time'
4
+
5
+ Rails.application.configure do
6
+ # Settings specified here will take precedence over those in config/application.rb.
7
+
8
+ # In the development environment your application's code is reloaded any time
9
+ # it changes. This slows down response time but is perfect for development
10
+ # since you don't have to restart the web server when you make code changes.
11
+ config.cache_classes = false
12
+
13
+ # Do not eager load code on boot.
14
+ config.eager_load = false
15
+
16
+ # Show full error reports.
17
+ config.consider_all_requests_local = true
18
+
19
+ # Enable server timing
20
+ config.server_timing = true
21
+
22
+ # Enable/disable caching. By default caching is disabled.
23
+ # Run rails dev:cache to toggle caching.
24
+ if Rails.root.join('tmp/caching-dev.txt').exist?
25
+ config.cache_store = :memory_store
26
+ config.public_file_server.headers = {
27
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}",
28
+ }
29
+ else
30
+ config.action_controller.perform_caching = false
31
+
32
+ config.cache_store = :null_store
33
+ end
34
+
35
+ # Print deprecation notices to the Rails logger.
36
+ config.active_support.deprecation = :log
37
+
38
+ # Raise exceptions for disallowed deprecations.
39
+ config.active_support.disallowed_deprecation = :raise
40
+
41
+ # Tell Active Support which deprecation messages to disallow.
42
+ config.active_support.disallowed_deprecation_warnings = []
43
+
44
+ # Raise an error on page load if there are pending migrations.
45
+ config.active_record.migration_error = :page_load
46
+
47
+ # Highlight code that triggered database queries in logs.
48
+ config.active_record.verbose_query_logs = true
49
+
50
+ # Raises error for missing translations.
51
+ # config.i18n.raise_on_missing_translations = true
52
+
53
+ # Annotate rendered view with file names.
54
+ # config.action_view.annotate_rendered_view_with_filenames = true
55
+
56
+ # Uncomment if you wish to allow Action Cable access from any origin.
57
+ # config.action_cable.disable_request_forgery_protection = true
58
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/integer/time'
4
+
5
+ Rails.application.configure do
6
+ # Settings specified here will take precedence over those in config/application.rb.
7
+
8
+ # Code is not reloaded between requests.
9
+ config.cache_classes = true
10
+
11
+ # Eager load code on boot. This eager loads most of Rails and
12
+ # your application in memory, allowing both threaded web servers
13
+ # and those relying on copy on write to perform better.
14
+ # Rake tasks automatically ignore this option for performance.
15
+ config.eager_load = true
16
+
17
+ # Full error reports are disabled and caching is turned on.
18
+ config.consider_all_requests_local = false
19
+
20
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
21
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
22
+ # config.require_master_key = true
23
+
24
+ # Disable serving static files from the `/public` folder by default since
25
+ # Apache or NGINX already handles this.
26
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
+
28
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
29
+ # config.asset_host = "http://assets.example.com"
30
+
31
+ # Specifies the header that your server uses for sending files.
32
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
33
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
34
+
35
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
36
+ # config.force_ssl = true
37
+
38
+ # Include generic and useful information about system operation, but avoid logging too much
39
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
40
+ config.log_level = :info
41
+
42
+ # Prepend all log lines with the following tags.
43
+ config.log_tags = [:request_id]
44
+
45
+ # Use a different cache store in production.
46
+ # config.cache_store = :mem_cache_store
47
+
48
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
49
+ # the I18n.default_locale when a translation cannot be found).
50
+ config.i18n.fallbacks = true
51
+
52
+ # Don't log any deprecations.
53
+ config.active_support.report_deprecations = false
54
+
55
+ # Use default logging formatter so that PID and timestamp are not suppressed.
56
+ config.log_formatter = ::Logger::Formatter.new
57
+
58
+ # Use a different logger for distributed setups.
59
+ # require "syslog/logger"
60
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
61
+
62
+ if ENV['RAILS_LOG_TO_STDOUT'].present?
63
+ logger = ActiveSupport::Logger.new($stdout)
64
+ logger.formatter = config.log_formatter
65
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
66
+ end
67
+
68
+ # Do not dump schema after migrations.
69
+ config.active_record.dump_schema_after_migration = false
70
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/integer/time'
4
+
5
+ # The test environment is used exclusively to run your application's
6
+ # test suite. You never need to work with it otherwise. Remember that
7
+ # your test database is "scratch space" for the test suite and is wiped
8
+ # and recreated between test runs. Don't rely on the data there!
9
+
10
+ Rails.application.configure do
11
+ # Settings specified here will take precedence over those in config/application.rb.
12
+
13
+ # Turn false under Spring and add config.action_view.cache_template_loading = true
14
+ config.cache_classes = true
15
+
16
+ # Eager loading loads your whole application. When running a single test locally,
17
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
18
+ # system, or in some way before deploying your code.
19
+ config.eager_load = ENV['CI'].present?
20
+
21
+ # Configure public file server for tests with Cache-Control for performance.
22
+ config.public_file_server.enabled = true
23
+ config.public_file_server.headers = {
24
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}",
25
+ }
26
+
27
+ # Show full error reports and disable caching.
28
+ config.consider_all_requests_local = true
29
+ config.action_controller.perform_caching = false
30
+ config.cache_store = :null_store
31
+
32
+ # Raise exceptions instead of rendering exception templates.
33
+ config.action_dispatch.show_exceptions = false
34
+
35
+ # Disable request forgery protection in test environment.
36
+ config.action_controller.allow_forgery_protection = false
37
+
38
+ # Print deprecation notices to the stderr.
39
+ config.active_support.deprecation = :stderr
40
+
41
+ # Raise exceptions for disallowed deprecations.
42
+ config.active_support.disallowed_deprecation = :raise
43
+
44
+ # Tell Active Support which deprecation messages to disallow.
45
+ config.active_support.disallowed_deprecation_warnings = []
46
+
47
+ # Raises error for missing translations.
48
+ # config.i18n.raise_on_missing_translations = true
49
+
50
+ # Annotate rendered view with file names.
51
+ # config.action_view.annotate_rendered_view_with_filenames = true
52
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Avoid CORS issues when API is called from the frontend app.
5
+ # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
6
+
7
+ # Read more: https://github.com/cyu/rack-cors
8
+
9
+ # Rails.application.config.middleware.insert_before 0, Rack::Cors do
10
+ # allow do
11
+ # origins "example.com"
12
+ #
13
+ # resource "*",
14
+ # headers: :any,
15
+ # methods: [:get, :post, :put, :patch, :delete, :options, :head]
16
+ # end
17
+ # end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure sensitive parameters which will be filtered from the log file.
6
+ Rails.application.config.filter_parameters += %i[
7
+ passw secret token _key crypt salt certificate otp ssn
8
+ ]
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Add new inflection rules using the following format. Inflections
5
+ # are locale specific, and you may define rules for as many different
6
+ # locales as you wish. All of these examples are active by default:
7
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
8
+ # inflect.plural /^(ox)$/i, "\\1en"
9
+ # inflect.singular /^(ox)en/i, "\\1"
10
+ # inflect.irregular "person", "people"
11
+ # inflect.uncountable %w( fish sheep )
12
+ # end
13
+
14
+ # These inflection rules are supported but not enabled by default:
15
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
16
+ # inflect.acronym "RESTful"
17
+ # end
@@ -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,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.routes.draw do
4
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
5
+
6
+ # Defines the root path route ("/")
7
+ # root "articles#index"
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is used by Rack-based servers to start the application.
4
+
5
+ require_relative 'config/environment'
6
+
7
+ run Rails.application
8
+ Rails.application.load_server
@@ -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)
@@ -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
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.20.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryz310
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-07 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -228,9 +228,9 @@ extensions: []
228
228
  extra_rdoc_files: []
229
229
  files:
230
230
  - ".circleci/config.yml"
231
- - ".dependabot/config.yml"
232
231
  - ".envrc.skeleton"
233
232
  - ".gem_comet.yml"
233
+ - ".github/dependabot.yml"
234
234
  - ".gitignore"
235
235
  - ".rspec"
236
236
  - ".rubocop.yml"
@@ -256,6 +256,7 @@ files:
256
256
  - gemfiles/rails_5.2.gemfile
257
257
  - gemfiles/rails_6.0.gemfile
258
258
  - gemfiles/rails_6.1.gemfile
259
+ - gemfiles/rails_7.0.gemfile
259
260
  - lib/generators/generator_helper.rb
260
261
  - lib/generators/rails/USAGE
261
262
  - lib/generators/rails/api_client_generator.rb
@@ -438,10 +439,39 @@ files:
438
439
  - rails_app/rails_6.1/tmp/.keep
439
440
  - rails_app/rails_6.1/tmp/pids/.keep
440
441
  - rails_app/rails_6.1/vendor/.keep
442
+ - rails_app/rails_7.0/Gemfile
443
+ - rails_app/rails_7.0/Gemfile.lock
444
+ - rails_app/rails_7.0/README.md
445
+ - rails_app/rails_7.0/Rakefile
446
+ - rails_app/rails_7.0/app/controllers/application_controller.rb
447
+ - rails_app/rails_7.0/app/models/application_record.rb
448
+ - rails_app/rails_7.0/bin/bundle
449
+ - rails_app/rails_7.0/bin/rails
450
+ - rails_app/rails_7.0/bin/rake
451
+ - rails_app/rails_7.0/bin/setup
452
+ - rails_app/rails_7.0/config.ru
453
+ - rails_app/rails_7.0/config/application.rb
454
+ - rails_app/rails_7.0/config/boot.rb
455
+ - rails_app/rails_7.0/config/credentials.yml.enc
456
+ - rails_app/rails_7.0/config/database.yml
457
+ - rails_app/rails_7.0/config/environment.rb
458
+ - rails_app/rails_7.0/config/environments/development.rb
459
+ - rails_app/rails_7.0/config/environments/production.rb
460
+ - rails_app/rails_7.0/config/environments/test.rb
461
+ - rails_app/rails_7.0/config/initializers/cors.rb
462
+ - rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb
463
+ - rails_app/rails_7.0/config/initializers/inflections.rb
464
+ - rails_app/rails_7.0/config/locales/en.yml
465
+ - rails_app/rails_7.0/config/routes.rb
466
+ - rails_app/rails_7.0/db/seeds.rb
467
+ - rails_app/rails_7.0/public/robots.txt
468
+ - rails_app/rails_7.0/spec/rails_helper.rb
469
+ - rails_app/rails_7.0/spec/spec_helper.rb
441
470
  homepage: https://github.com/ryz310/my_api_client
442
471
  licenses:
443
472
  - MIT
444
- metadata: {}
473
+ metadata:
474
+ rubygems_mfa_required: 'true'
445
475
  post_install_message:
446
476
  rdoc_options: []
447
477
  require_paths:
@@ -450,14 +480,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
450
480
  requirements:
451
481
  - - ">="
452
482
  - !ruby/object:Gem::Version
453
- version: 2.5.0
483
+ version: 2.7.0
454
484
  required_rubygems_version: !ruby/object:Gem::Requirement
455
485
  requirements:
456
486
  - - ">="
457
487
  - !ruby/object:Gem::Version
458
488
  version: '0'
459
489
  requirements: []
460
- rubygems_version: 3.2.3
490
+ rubygems_version: 3.3.11
461
491
  signing_key:
462
492
  specification_version: 4
463
493
  summary: The framework of Web API Client
@@ -1,34 +0,0 @@
1
- version: 1
2
- update_configs:
3
- - package_manager: "ruby:bundler"
4
- directory: "/"
5
- update_schedule: "live"
6
- default_reviewers:
7
- - "ryz310"
8
- default_assignees:
9
- - "ryz310"
10
- default_labels:
11
- - "dependabot"
12
- automerged_updates:
13
- - match:
14
- dependency_type: "development"
15
- update_type: "all"
16
- - match:
17
- dependency_type: "production"
18
- update_type: "semver:patch"
19
- - package_manager: "ruby:bundler"
20
- directory: "/my_api"
21
- update_schedule: "live"
22
- default_reviewers:
23
- - "ryz310"
24
- default_assignees:
25
- - "ryz310"
26
- default_labels:
27
- - "dependabot"
28
- automerged_updates:
29
- - match:
30
- dependency_type: "development"
31
- update_type: "all"
32
- - match:
33
- dependency_type: "production"
34
- update_type: "semver:patch"