my_api_client 0.26.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +5 -5
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +15 -4
- data/CHANGELOG.md +55 -0
- data/Gemfile.lock +39 -27
- data/README.jp.md +7 -7
- data/README.md +5 -5
- data/example/api_clients/my_pagination_api_client.rb +11 -2
- data/lib/my_api_client/errors/network_error.rb +1 -1
- data/lib/my_api_client/errors.rb +1 -1
- data/lib/my_api_client/request/basic.rb +10 -2
- data/lib/my_api_client/request/pagination.rb +23 -2
- data/lib/my_api_client/rspec/stub.rb +1 -0
- data/lib/my_api_client/service_abstract.rb +2 -2
- data/lib/my_api_client/version.rb +1 -1
- data/my_api/.ruby-version +1 -1
- data/my_api/Gemfile +2 -2
- data/my_api/Gemfile.lock +77 -76
- data/my_api/public/index.html +2 -2
- data/my_api_client.gemspec +2 -2
- metadata +6 -38
- data/gemfiles/rails_6.0.gemfile +0 -16
- data/rails_app/rails_6.0/.rspec +0 -3
- data/rails_app/rails_6.0/Gemfile +0 -18
- data/rails_app/rails_6.0/Gemfile.lock +0 -188
- data/rails_app/rails_6.0/README.md +0 -24
- data/rails_app/rails_6.0/Rakefile +0 -8
- data/rails_app/rails_6.0/app/controllers/application_controller.rb +0 -4
- data/rails_app/rails_6.0/app/jobs/application_job.rb +0 -9
- data/rails_app/rails_6.0/bin/rails +0 -6
- data/rails_app/rails_6.0/bin/rake +0 -6
- data/rails_app/rails_6.0/bin/setup +0 -27
- data/rails_app/rails_6.0/config/application.rb +0 -39
- data/rails_app/rails_6.0/config/boot.rb +0 -6
- data/rails_app/rails_6.0/config/credentials.yml.enc +0 -1
- data/rails_app/rails_6.0/config/environment.rb +0 -7
- data/rails_app/rails_6.0/config/environments/development.rb +0 -39
- data/rails_app/rails_6.0/config/environments/production.rb +0 -90
- data/rails_app/rails_6.0/config/environments/test.rb +0 -41
- data/rails_app/rails_6.0/config/initializers/application_controller_renderer.rb +0 -9
- data/rails_app/rails_6.0/config/initializers/backtrace_silencers.rb +0 -8
- data/rails_app/rails_6.0/config/initializers/cors.rb +0 -17
- data/rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb +0 -6
- data/rails_app/rails_6.0/config/initializers/inflections.rb +0 -17
- data/rails_app/rails_6.0/config/initializers/mime_types.rb +0 -5
- data/rails_app/rails_6.0/config/initializers/wrap_parameters.rb +0 -11
- data/rails_app/rails_6.0/config/locales/en.yml +0 -33
- data/rails_app/rails_6.0/config/routes.rb +0 -5
- data/rails_app/rails_6.0/config/spring.rb +0 -8
- data/rails_app/rails_6.0/config.ru +0 -7
- data/rails_app/rails_6.0/public/robots.txt +0 -1
- data/rails_app/rails_6.0/spec/rails_helper.rb +0 -14
- data/rails_app/rails_6.0/spec/spec_helper.rb +0 -13
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'fileutils'
|
5
|
-
|
6
|
-
# path to your application root.
|
7
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
8
|
-
|
9
|
-
def system!(*args)
|
10
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
-
end
|
12
|
-
|
13
|
-
FileUtils.chdir APP_ROOT do
|
14
|
-
# This script is a way to setup or update your development environment automatically.
|
15
|
-
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
16
|
-
# Add necessary setup steps to this file.
|
17
|
-
|
18
|
-
puts '== Installing dependencies =='
|
19
|
-
system! 'gem install bundler --conservative'
|
20
|
-
system('bundle check') || system!('bundle install')
|
21
|
-
|
22
|
-
puts "\n== Removing old logs and tempfiles =="
|
23
|
-
system! 'bin/rails log:clear tmp:clear'
|
24
|
-
|
25
|
-
puts "\n== Restarting application server =="
|
26
|
-
system! 'bin/rails restart'
|
27
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'boot'
|
4
|
-
|
5
|
-
require 'rails'
|
6
|
-
# Pick the frameworks you want:
|
7
|
-
require 'active_model/railtie'
|
8
|
-
require 'active_job/railtie'
|
9
|
-
# require "active_record/railtie"
|
10
|
-
# require "active_storage/engine"
|
11
|
-
require 'action_controller/railtie'
|
12
|
-
# require "action_mailer/railtie"
|
13
|
-
# require "action_mailbox/engine"
|
14
|
-
# require "action_text/engine"
|
15
|
-
require 'action_view/railtie'
|
16
|
-
# require "action_cable/engine"
|
17
|
-
# require "sprockets/railtie"
|
18
|
-
# require "rails/test_unit/railtie"
|
19
|
-
|
20
|
-
# Require the gems listed in Gemfile, including any gems
|
21
|
-
# you've limited to :test, :development, or :production.
|
22
|
-
Bundler.require(*Rails.groups)
|
23
|
-
|
24
|
-
module Rails60
|
25
|
-
class Application < Rails::Application
|
26
|
-
# Initialize configuration defaults for originally generated Rails version.
|
27
|
-
config.load_defaults 6.0
|
28
|
-
|
29
|
-
# Settings in config/environments/* take precedence over those specified here.
|
30
|
-
# Application configuration can go into files in config/initializers
|
31
|
-
# -- all .rb files in that directory are automatically loaded after loading
|
32
|
-
# the framework and any gems in your application.
|
33
|
-
|
34
|
-
# Only loads a smaller set of middleware suitable for API only apps.
|
35
|
-
# Middleware like session, flash, cookies can be added back manually.
|
36
|
-
# Skip views, helpers and assets when generating a new resource.
|
37
|
-
config.api_only = true
|
38
|
-
end
|
39
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
CJoUu0GJghScfMh+62M1uFPVRisc5CXZnBkxDoQKWhZ8/MI6wnaEYO38GTneAdi77xgrjVMgwFD0w+o26d+OJxxkJ2MJY/0t1ioPY7uP2ccWW+WdHyM8O6q3zVh5ddyQnNdWWf2EeXQHiXoJjfvaFA7fqx2IWP4JVE5x2vI5z5boJnkfyKP02sFtuKldFthfhE+E1p7MgQ8svVp8J/XmzKzLP3vpWSkmZN3mFwQQ6aTBfcMez/AXBWa060CS6pDq6+Uh6waS+aN2X57fyJzwA4XtLAZpZ/rJAohuLs7DWgFcV3GisdZm54usjuXCJo15RpYdArBOCE7XanLMJE1jzVZy/PpaPFHW8N+oIMDVjufBBjRgT8+lkby1sFBZS70sfmSCzT8p9/0lFqlh1y6Y3lR5Ebf8vlZ6xddB--Wtg3m3b98OBj532l--PsJcDHPLD9pQa1QmIN9LSw==
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Rails.application.configure do
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
-
|
6
|
-
# In the development environment your application's code is reloaded on
|
7
|
-
# every request. This slows down response time but is perfect for development
|
8
|
-
# since you don't have to restart the web server when you make code changes.
|
9
|
-
config.cache_classes = false
|
10
|
-
|
11
|
-
# Do not eager load code on boot.
|
12
|
-
config.eager_load = false
|
13
|
-
|
14
|
-
# Show full error reports.
|
15
|
-
config.consider_all_requests_local = true
|
16
|
-
|
17
|
-
# Enable/disable caching. By default caching is disabled.
|
18
|
-
# Run rails dev:cache to toggle caching.
|
19
|
-
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
20
|
-
config.cache_store = :memory_store
|
21
|
-
config.public_file_server.headers = {
|
22
|
-
'Cache-Control' => "public, max-age=#{2.days.to_i}",
|
23
|
-
}
|
24
|
-
else
|
25
|
-
config.action_controller.perform_caching = false
|
26
|
-
|
27
|
-
config.cache_store = :null_store
|
28
|
-
end
|
29
|
-
|
30
|
-
# Print deprecation notices to the Rails logger.
|
31
|
-
config.active_support.deprecation = :log
|
32
|
-
|
33
|
-
# Raises error for missing translations.
|
34
|
-
# config.action_view.raise_on_missing_translations = true
|
35
|
-
|
36
|
-
# Use an evented file watcher to asynchronously detect changes in source code,
|
37
|
-
# routes, locales, etc. This feature depends on the listen gem.
|
38
|
-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
39
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Rails.application.configure do
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
-
|
6
|
-
# Code is not reloaded between requests.
|
7
|
-
config.cache_classes = true
|
8
|
-
|
9
|
-
# Eager load code on boot. This eager loads most of Rails and
|
10
|
-
# your application in memory, allowing both threaded web servers
|
11
|
-
# and those relying on copy on write to perform better.
|
12
|
-
# Rake tasks automatically ignore this option for performance.
|
13
|
-
config.eager_load = true
|
14
|
-
|
15
|
-
# Full error reports are disabled and caching is turned on.
|
16
|
-
config.consider_all_requests_local = false
|
17
|
-
|
18
|
-
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
19
|
-
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
20
|
-
# config.require_master_key = true
|
21
|
-
|
22
|
-
# Disable serving static files from the `/public` folder by default since
|
23
|
-
# Apache or NGINX already handles this.
|
24
|
-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
25
|
-
|
26
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
27
|
-
# config.action_controller.asset_host = 'http://assets.example.com'
|
28
|
-
|
29
|
-
# Specifies the header that your server uses for sending files.
|
30
|
-
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
31
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
32
|
-
|
33
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
34
|
-
# config.force_ssl = true
|
35
|
-
|
36
|
-
# Use the lowest log level to ensure availability of diagnostic information
|
37
|
-
# when problems arise.
|
38
|
-
config.log_level = :debug
|
39
|
-
|
40
|
-
# Prepend all log lines with the following tags.
|
41
|
-
config.log_tags = [:request_id]
|
42
|
-
|
43
|
-
# Use a different cache store in production.
|
44
|
-
# config.cache_store = :mem_cache_store
|
45
|
-
|
46
|
-
# Use a real queuing backend for Active Job (and separate queues per environment).
|
47
|
-
# config.active_job.queue_adapter = :resque
|
48
|
-
# config.active_job.queue_name_prefix = "rails_6_0_production"
|
49
|
-
|
50
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
51
|
-
# the I18n.default_locale when a translation cannot be found).
|
52
|
-
config.i18n.fallbacks = true
|
53
|
-
|
54
|
-
# Send deprecation notices to registered listeners.
|
55
|
-
config.active_support.deprecation = :notify
|
56
|
-
|
57
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
58
|
-
config.log_formatter = ::Logger::Formatter.new
|
59
|
-
|
60
|
-
# Use a different logger for distributed setups.
|
61
|
-
# require 'syslog/logger'
|
62
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
63
|
-
|
64
|
-
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
65
|
-
logger = ActiveSupport::Logger.new($stdout)
|
66
|
-
logger.formatter = config.log_formatter
|
67
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
68
|
-
end
|
69
|
-
|
70
|
-
# Inserts middleware to perform automatic connection switching.
|
71
|
-
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
72
|
-
# middleware. The `delay` is used to determine how long to wait after a write
|
73
|
-
# to send a subsequent read to the primary.
|
74
|
-
#
|
75
|
-
# The `database_resolver` class is used by the middleware to determine which
|
76
|
-
# database is appropriate to use based on the time delay.
|
77
|
-
#
|
78
|
-
# The `database_resolver_context` class is used by the middleware to set
|
79
|
-
# timestamps for the last write to the primary. The resolver uses the context
|
80
|
-
# class timestamps to determine how long to wait before reading from the
|
81
|
-
# replica.
|
82
|
-
#
|
83
|
-
# By default Rails will store a last write timestamp in the session. The
|
84
|
-
# DatabaseSelector middleware is designed as such you can define your own
|
85
|
-
# strategy for connection switching and pass that into the middleware through
|
86
|
-
# these configuration options.
|
87
|
-
# config.active_record.database_selector = { delay: 2.seconds }
|
88
|
-
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
89
|
-
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
90
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# The test environment is used exclusively to run your application's
|
4
|
-
# test suite. You never need to work with it otherwise. Remember that
|
5
|
-
# your test database is "scratch space" for the test suite and is wiped
|
6
|
-
# and recreated between test runs. Don't rely on the data there!
|
7
|
-
|
8
|
-
Rails.application.configure do
|
9
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
10
|
-
|
11
|
-
config.cache_classes = false
|
12
|
-
config.action_view.cache_template_loading = true
|
13
|
-
|
14
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
15
|
-
# just for the purpose of running a single test. If you are using a tool that
|
16
|
-
# preloads Rails for running tests, you may have to set it to true.
|
17
|
-
config.eager_load = false
|
18
|
-
|
19
|
-
# Configure public file server for tests with Cache-Control for performance.
|
20
|
-
config.public_file_server.enabled = true
|
21
|
-
config.public_file_server.headers = {
|
22
|
-
'Cache-Control' => "public, max-age=#{1.hour.to_i}",
|
23
|
-
}
|
24
|
-
|
25
|
-
# Show full error reports and disable caching.
|
26
|
-
config.consider_all_requests_local = true
|
27
|
-
config.action_controller.perform_caching = false
|
28
|
-
config.cache_store = :null_store
|
29
|
-
|
30
|
-
# Raise exceptions instead of rendering exception templates.
|
31
|
-
config.action_dispatch.show_exceptions = false
|
32
|
-
|
33
|
-
# Disable request forgery protection in test environment.
|
34
|
-
config.action_controller.allow_forgery_protection = false
|
35
|
-
|
36
|
-
# Print deprecation notices to the stderr.
|
37
|
-
config.active_support.deprecation = :stderr
|
38
|
-
|
39
|
-
# Raises error for missing translations.
|
40
|
-
# config.action_view.raise_on_missing_translations = true
|
41
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Be sure to restart your server when you modify this file.
|
3
|
-
|
4
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
5
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
6
|
-
|
7
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
8
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1,17 +0,0 @@
|
|
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
|
@@ -1,17 +0,0 @@
|
|
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
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Be sure to restart your server when you modify this file.
|
4
|
-
|
5
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
6
|
-
# is enabled by default.
|
7
|
-
|
8
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
9
|
-
ActiveSupport.on_load(:action_controller) do
|
10
|
-
wrap_parameters format: [:json]
|
11
|
-
end
|
@@ -1,33 +0,0 @@
|
|
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"
|
@@ -1 +0,0 @@
|
|
1
|
-
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
@@ -1,14 +0,0 @@
|
|
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
|
@@ -1,13 +0,0 @@
|
|
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
|