my_api_client 0.18.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +50 -120
  3. data/.gem_comet.yml +13 -2
  4. data/.github/dependabot.yml +32 -0
  5. data/.rubocop.yml +1 -1
  6. data/.rubocop_todo.yml +1 -15
  7. data/CHANGELOG.md +73 -86
  8. data/Gemfile +2 -0
  9. data/Gemfile.lock +75 -57
  10. data/README.jp.md +79 -15
  11. data/README.md +392 -8
  12. data/gemfiles/rails_5.0.gemfile +1 -0
  13. data/gemfiles/rails_5.1.gemfile +1 -0
  14. data/gemfiles/rails_5.2.gemfile +1 -0
  15. data/gemfiles/rails_6.0.gemfile +1 -0
  16. data/gemfiles/rails_6.1.gemfile +15 -0
  17. data/gemfiles/rails_7.0.gemfile +15 -0
  18. data/lib/generators/rails/templates/api_client.rb.erb +3 -5
  19. data/lib/generators/rspec/templates/api_client_spec.rb.erb +0 -8
  20. data/lib/my_api_client/base.rb +2 -9
  21. data/lib/my_api_client/integrations/bugsnag.rb +1 -1
  22. data/lib/my_api_client/request.rb +1 -1
  23. data/lib/my_api_client/rspec/matchers/be_handled_as_an_error.rb +3 -3
  24. data/lib/my_api_client/rspec/matchers/request_to.rb +1 -1
  25. data/lib/my_api_client/rspec/stub.rb +40 -15
  26. data/lib/my_api_client/version.rb +1 -1
  27. data/my_api/.ruby-version +1 -1
  28. data/my_api/Gemfile +3 -0
  29. data/my_api/Gemfile.lock +108 -99
  30. data/my_api/app/controllers/pagination_controller.rb +2 -2
  31. data/my_api/public/index.html +2 -2
  32. data/my_api/spec/spec_helper.rb +1 -1
  33. data/my_api_client.gemspec +6 -3
  34. data/rails_app/rails_5.2/Gemfile.lock +73 -64
  35. data/rails_app/rails_5.2/config/environments/production.rb +1 -1
  36. data/rails_app/rails_6.0/Gemfile.lock +95 -79
  37. data/rails_app/rails_6.0/config/environments/production.rb +1 -1
  38. data/rails_app/rails_6.1/.gitattributes +8 -0
  39. data/rails_app/rails_6.1/.gitignore +28 -0
  40. data/rails_app/rails_6.1/.rspec +3 -0
  41. data/rails_app/rails_6.1/Gemfile +17 -0
  42. data/rails_app/rails_6.1/Gemfile.lock +203 -0
  43. data/rails_app/rails_6.1/README.md +24 -0
  44. data/rails_app/rails_6.1/Rakefile +8 -0
  45. data/rails_app/rails_6.1/app/controllers/application_controller.rb +4 -0
  46. data/rails_app/rails_6.1/app/controllers/concerns/.keep +0 -0
  47. data/rails_app/rails_6.1/app/javascript/.keep +0 -0
  48. data/rails_app/rails_6.1/app/models/application_record.rb +5 -0
  49. data/rails_app/rails_6.1/app/models/concerns/.keep +0 -0
  50. data/rails_app/rails_6.1/bin/bundle +122 -0
  51. data/rails_app/rails_6.1/bin/rails +6 -0
  52. data/rails_app/rails_6.1/bin/rake +6 -0
  53. data/rails_app/rails_6.1/bin/setup +35 -0
  54. data/rails_app/rails_6.1/config/application.rb +42 -0
  55. data/rails_app/rails_6.1/config/boot.rb +5 -0
  56. data/rails_app/rails_6.1/config/credentials.yml.enc +1 -0
  57. data/rails_app/rails_6.1/config/database.yml +25 -0
  58. data/rails_app/rails_6.1/config/environment.rb +7 -0
  59. data/rails_app/rails_6.1/config/environments/development.rb +59 -0
  60. data/rails_app/rails_6.1/config/environments/production.rb +97 -0
  61. data/rails_app/rails_6.1/config/environments/test.rb +51 -0
  62. data/rails_app/rails_6.1/config/initializers/application_controller_renderer.rb +9 -0
  63. data/rails_app/rails_6.1/config/initializers/backtrace_silencers.rb +10 -0
  64. data/rails_app/rails_6.1/config/initializers/cors.rb +17 -0
  65. data/rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb +8 -0
  66. data/rails_app/rails_6.1/config/initializers/inflections.rb +17 -0
  67. data/rails_app/rails_6.1/config/initializers/mime_types.rb +5 -0
  68. data/rails_app/rails_6.1/config/initializers/wrap_parameters.rb +16 -0
  69. data/rails_app/rails_6.1/config/locales/en.yml +33 -0
  70. data/rails_app/rails_6.1/config/routes.rb +5 -0
  71. data/rails_app/rails_6.1/config.ru +8 -0
  72. data/rails_app/rails_6.1/db/seeds.rb +8 -0
  73. data/rails_app/rails_6.1/lib/tasks/.keep +0 -0
  74. data/rails_app/rails_6.1/public/robots.txt +1 -0
  75. data/rails_app/rails_6.1/spec/rails_helper.rb +14 -0
  76. data/rails_app/rails_6.1/spec/spec_helper.rb +13 -0
  77. data/rails_app/rails_6.1/tmp/.keep +0 -0
  78. data/rails_app/rails_6.1/tmp/pids/.keep +0 -0
  79. data/rails_app/rails_6.1/vendor/.keep +0 -0
  80. data/rails_app/rails_7.0/Gemfile +13 -0
  81. data/rails_app/rails_7.0/Gemfile.lock +147 -0
  82. data/rails_app/rails_7.0/README.md +24 -0
  83. data/rails_app/rails_7.0/Rakefile +8 -0
  84. data/rails_app/rails_7.0/app/controllers/application_controller.rb +4 -0
  85. data/rails_app/rails_7.0/app/models/application_record.rb +5 -0
  86. data/rails_app/rails_7.0/bin/bundle +122 -0
  87. data/rails_app/rails_7.0/bin/rails +6 -0
  88. data/rails_app/rails_7.0/bin/rake +6 -0
  89. data/rails_app/rails_7.0/bin/setup +35 -0
  90. data/rails_app/rails_7.0/config/application.rb +41 -0
  91. data/rails_app/rails_7.0/config/boot.rb +5 -0
  92. data/rails_app/rails_7.0/config/credentials.yml.enc +1 -0
  93. data/rails_app/rails_7.0/config/database.yml +25 -0
  94. data/rails_app/rails_7.0/config/environment.rb +7 -0
  95. data/rails_app/rails_7.0/config/environments/development.rb +58 -0
  96. data/rails_app/rails_7.0/config/environments/production.rb +70 -0
  97. data/rails_app/rails_7.0/config/environments/test.rb +52 -0
  98. data/rails_app/rails_7.0/config/initializers/cors.rb +17 -0
  99. data/rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb +8 -0
  100. data/rails_app/rails_7.0/config/initializers/inflections.rb +17 -0
  101. data/rails_app/rails_7.0/config/locales/en.yml +33 -0
  102. data/rails_app/rails_7.0/config/routes.rb +8 -0
  103. data/rails_app/rails_7.0/config.ru +8 -0
  104. data/rails_app/rails_7.0/db/seeds.rb +8 -0
  105. data/rails_app/rails_7.0/public/robots.txt +1 -0
  106. data/rails_app/rails_7.0/spec/rails_helper.rb +14 -0
  107. data/rails_app/rails_7.0/spec/spec_helper.rb +13 -0
  108. metadata +83 -11
  109. data/.dependabot/config.yml +0 -34
  110. data/.rubocop_challenge.yml +0 -5
@@ -18,13 +18,17 @@ module MyApiClient
18
18
  # @example
19
19
  # stub_api_client_all(
20
20
  # ExampleApiClient,
21
+ # get_users: { # Returns an arbitrary pageable response
22
+ # pageable: [ { id: 1 }, { id: 2 }] # for `#pageable_get`.
23
+ # },
21
24
  # get_user: { response: { id: 1 } }, # Returns an arbitrary response.
22
25
  # post_users: { id: 1 }, # You can ommit `response` keyword.
23
26
  # patch_user: ->(params) { { id: params[:id] } }, # Returns calculated result as response.
24
27
  # put_user: { raise: MyApiClient::ClientError } # Raises an arbitrary error.
25
28
  # delete_user: {
26
29
  # raise: MyApiClient::ClientError,
27
- # response: { errors: [{ code: 10 }] }, # You can stub response with exception.
30
+ # response: { errors: [{ code: 10 }] }, # You can stub response and statu code
31
+ # status_code: 429, # with an arbitrary error.
28
32
  # }
29
33
  # )
30
34
  # response = ExampleApiClient.new.get_user(id: 123)
@@ -46,13 +50,17 @@ module MyApiClient
46
50
  # @example
47
51
  # api_client = stub_api_client(
48
52
  # ExampleApiClient,
53
+ # get_users: { # Returns an arbitrary pageable response
54
+ # pageable: [ { id: 1 }, { id: 2 }] # for `#pageable_get`.
55
+ # },
49
56
  # get_user: { response: { id: 1 } }, # Returns an arbitrary response.
50
57
  # post_users: { id: 1 }, # You can ommit `response` keyword.
51
58
  # patch_user: ->(params) { { id: params[:id] } }, # Returns calculated result as response.
52
59
  # put_user: { raise: MyApiClient::ClientError } # Raises an arbitrary error.
53
60
  # delete_user: {
54
61
  # raise: MyApiClient::ClientError,
55
- # response: { errors: [{ code: 10 }] }, # You can stub response with exception.
62
+ # response: { errors: [{ code: 10 }] }, # You can stub response and status code
63
+ # status_code: 403, # with exception.
56
64
  # }
57
65
  # )
58
66
  # response = api_client.get_user(id: 123)
@@ -67,25 +75,40 @@ module MyApiClient
67
75
 
68
76
  private
69
77
 
70
- # rubocop:disable Metrics/AbcSize
71
78
  def stubbing(instance, action, options)
79
+ allow(instance).to receive(action) do |*request|
80
+ generate_stubbed_response(options, *request)
81
+ end
82
+ end
83
+
84
+ def generate_stubbed_response(options, *request) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
72
85
  case options
73
86
  when Proc
74
- allow(instance).to receive(action) { |*request| stub_as_resource(options.call(*request)) }
87
+ stub_as_resource(options.call(*request))
75
88
  when Hash
76
- if options[:raise].present?
77
- exception = process_raise_option(options[:raise], options[:response])
78
- allow(instance).to receive(action).and_raise(exception)
89
+ if options[:raise] # rubocop:disable Style/GuardClause
90
+ raise process_raise_option(options[:raise], options[:response], options[:status_code])
79
91
  elsif options[:response]
80
- allow(instance).to receive(action).and_return(stub_as_resource(options[:response]))
92
+ stub_as_resource(options[:response])
93
+ elsif options[:pageable].is_a?(Enumerable)
94
+ stub_as_pageable_resource(options[:pageable].each, *request)
81
95
  else
82
- allow(instance).to receive(action).and_return(stub_as_resource(options))
96
+ stub_as_resource(options)
83
97
  end
84
98
  else
85
- allow(instance).to receive(action).and_return(stub_as_resource(options))
99
+ stub_as_resource(options)
86
100
  end
87
101
  end
88
- # rubocop:enable Metrics/AbcSize
102
+
103
+ def stub_as_pageable_resource(pager, *request)
104
+ Enumerator.new do |y|
105
+ loop do
106
+ y << generate_stubbed_response(pager.next, *request)
107
+ rescue StopIteration
108
+ break
109
+ end
110
+ end.lazy
111
+ end
89
112
 
90
113
  # Provides a shorthand for `raise` option.
91
114
  # `MyApiClient::Error` requires `MyApiClient::Params::Params` instance on
@@ -93,12 +116,14 @@ module MyApiClient
93
116
  # If given a error instance, it will return raw value without processing.
94
117
  #
95
118
  # @param exception [Clsas, MyApiClient::Error] Processing target.
119
+ # @param response [Hash] describe_response_here
120
+ # @param status_code [Integer] describe_status_code_here
96
121
  # @return [MyApiClient::Error] Processed exception.
97
122
  # @raise [RuntimeError] Unsupported error class was set.
98
- def process_raise_option(exception, response = {})
123
+ def process_raise_option(exception, response, status_code)
99
124
  case exception
100
125
  when Class
101
- params = MyApiClient::Params::Params.new(nil, stub_as_response(response))
126
+ params = MyApiClient::Params::Params.new(nil, stub_as_response(response, status_code))
102
127
  if exception == MyApiClient::NetworkError
103
128
  exception.new(params, Net::OpenTimeout.new)
104
129
  else
@@ -113,10 +138,10 @@ module MyApiClient
113
138
  end
114
139
  end
115
140
 
116
- def stub_as_response(params)
141
+ def stub_as_response(params, status_code)
117
142
  instance_double(
118
143
  Sawyer::Response,
119
- status: 400,
144
+ status: status_code.presence || 400,
120
145
  headers: {},
121
146
  data: stub_as_resource(params),
122
147
  timing: 0.123
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MyApiClient
4
- VERSION = '0.18.0'
4
+ VERSION = '0.22.0'
5
5
  end
data/my_api/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.7
1
+ 2.7.2
data/my_api/Gemfile CHANGED
@@ -6,6 +6,9 @@ gem 'jets'
6
6
 
7
7
  gem 'dynomite'
8
8
 
9
+ # See: https://github.com/boltops-tools/jets/issues/523
10
+ gem 'nokogiri', '~> 1.12.5'
11
+
9
12
  # development and test groups are not bundled as part of the deployment
10
13
  group :development, :test do
11
14
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
data/my_api/Gemfile.lock CHANGED
@@ -1,43 +1,44 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- actionmailer (6.0.3.4)
5
- actionpack (= 6.0.3.4)
6
- actionview (= 6.0.3.4)
7
- activejob (= 6.0.3.4)
4
+ actionmailer (6.1.4.3)
5
+ actionpack (= 6.1.4.3)
6
+ actionview (= 6.1.4.3)
7
+ activejob (= 6.1.4.3)
8
+ activesupport (= 6.1.4.3)
8
9
  mail (~> 2.5, >= 2.5.4)
9
10
  rails-dom-testing (~> 2.0)
10
- actionpack (6.0.3.4)
11
- actionview (= 6.0.3.4)
12
- activesupport (= 6.0.3.4)
13
- rack (~> 2.0, >= 2.0.8)
11
+ actionpack (6.1.4.3)
12
+ actionview (= 6.1.4.3)
13
+ activesupport (= 6.1.4.3)
14
+ rack (~> 2.0, >= 2.0.9)
14
15
  rack-test (>= 0.6.3)
15
16
  rails-dom-testing (~> 2.0)
16
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (6.0.3.4)
18
- activesupport (= 6.0.3.4)
18
+ actionview (6.1.4.3)
19
+ activesupport (= 6.1.4.3)
19
20
  builder (~> 3.1)
20
21
  erubi (~> 1.4)
21
22
  rails-dom-testing (~> 2.0)
22
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- activejob (6.0.3.4)
24
- activesupport (= 6.0.3.4)
24
+ activejob (6.1.4.3)
25
+ activesupport (= 6.1.4.3)
25
26
  globalid (>= 0.3.6)
26
- activemodel (6.0.3.4)
27
- activesupport (= 6.0.3.4)
28
- activerecord (6.0.3.4)
29
- activemodel (= 6.0.3.4)
30
- activesupport (= 6.0.3.4)
31
- activesupport (6.0.3.4)
27
+ activemodel (6.1.4.3)
28
+ activesupport (= 6.1.4.3)
29
+ activerecord (6.1.4.3)
30
+ activemodel (= 6.1.4.3)
31
+ activesupport (= 6.1.4.3)
32
+ activesupport (6.1.4.3)
32
33
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
- i18n (>= 0.7, < 2)
34
- minitest (~> 5.1)
35
- tzinfo (~> 1.1)
36
- zeitwerk (~> 2.2, >= 2.2.2)
37
- addressable (2.7.0)
34
+ i18n (>= 1.6, < 2)
35
+ minitest (>= 5.1)
36
+ tzinfo (~> 2.0)
37
+ zeitwerk (~> 2.3)
38
+ addressable (2.8.0)
38
39
  public_suffix (>= 2.0.2, < 5.0)
39
- aws-eventstream (1.1.0)
40
- aws-mfa-secure (0.4.2)
40
+ aws-eventstream (1.2.0)
41
+ aws-mfa-secure (0.4.3)
41
42
  activesupport
42
43
  aws-sdk-core
43
44
  aws_config
@@ -45,65 +46,68 @@ GEM
45
46
  rainbow
46
47
  thor
47
48
  zeitwerk
48
- aws-partitions (1.358.0)
49
- aws-sdk-apigateway (1.49.0)
50
- aws-sdk-core (~> 3, >= 3.99.0)
49
+ aws-partitions (1.541.0)
50
+ aws-sdk-apigateway (1.71.0)
51
+ aws-sdk-core (~> 3, >= 3.122.0)
51
52
  aws-sigv4 (~> 1.1)
52
- aws-sdk-cloudformation (1.41.0)
53
- aws-sdk-core (~> 3, >= 3.99.0)
53
+ aws-sdk-cloudformation (1.63.0)
54
+ aws-sdk-core (~> 3, >= 3.122.0)
54
55
  aws-sigv4 (~> 1.1)
55
- aws-sdk-cloudwatchlogs (1.34.0)
56
- aws-sdk-core (~> 3, >= 3.99.0)
56
+ aws-sdk-cloudwatchlogs (1.49.0)
57
+ aws-sdk-core (~> 3, >= 3.122.0)
57
58
  aws-sigv4 (~> 1.1)
58
- aws-sdk-core (3.104.4)
59
+ aws-sdk-core (3.124.0)
59
60
  aws-eventstream (~> 1, >= 1.0.2)
60
- aws-partitions (~> 1, >= 1.239.0)
61
+ aws-partitions (~> 1, >= 1.525.0)
61
62
  aws-sigv4 (~> 1.1)
62
63
  jmespath (~> 1.0)
63
- aws-sdk-dynamodb (1.51.0)
64
- aws-sdk-core (~> 3, >= 3.99.0)
64
+ aws-sdk-dynamodb (1.69.0)
65
+ aws-sdk-core (~> 3, >= 3.122.0)
65
66
  aws-sigv4 (~> 1.1)
66
- aws-sdk-kinesis (1.27.0)
67
- aws-sdk-core (~> 3, >= 3.99.0)
67
+ aws-sdk-kinesis (1.38.0)
68
+ aws-sdk-core (~> 3, >= 3.122.0)
68
69
  aws-sigv4 (~> 1.1)
69
- aws-sdk-kms (1.36.0)
70
- aws-sdk-core (~> 3, >= 3.99.0)
70
+ aws-sdk-kms (1.52.0)
71
+ aws-sdk-core (~> 3, >= 3.122.0)
71
72
  aws-sigv4 (~> 1.1)
72
- aws-sdk-lambda (1.48.0)
73
- aws-sdk-core (~> 3, >= 3.99.0)
73
+ aws-sdk-lambda (1.76.0)
74
+ aws-sdk-core (~> 3, >= 3.122.0)
74
75
  aws-sigv4 (~> 1.1)
75
- aws-sdk-s3 (1.78.0)
76
- aws-sdk-core (~> 3, >= 3.104.3)
76
+ aws-sdk-s3 (1.109.0)
77
+ aws-sdk-core (~> 3, >= 3.122.0)
77
78
  aws-sdk-kms (~> 1)
79
+ aws-sigv4 (~> 1.4)
80
+ aws-sdk-sns (1.49.0)
81
+ aws-sdk-core (~> 3, >= 3.122.0)
78
82
  aws-sigv4 (~> 1.1)
79
- aws-sdk-sns (1.29.0)
80
- aws-sdk-core (~> 3, >= 3.99.0)
83
+ aws-sdk-sqs (1.48.0)
84
+ aws-sdk-core (~> 3, >= 3.122.0)
81
85
  aws-sigv4 (~> 1.1)
82
- aws-sdk-sqs (1.30.0)
83
- aws-sdk-core (~> 3, >= 3.99.0)
86
+ aws-sdk-ssm (1.126.0)
87
+ aws-sdk-core (~> 3, >= 3.122.0)
84
88
  aws-sigv4 (~> 1.1)
85
- aws-sdk-ssm (1.86.0)
86
- aws-sdk-core (~> 3, >= 3.99.0)
87
- aws-sigv4 (~> 1.1)
88
- aws-sigv4 (1.2.2)
89
+ aws-sigv4 (1.4.0)
89
90
  aws-eventstream (~> 1, >= 1.0.2)
90
91
  aws_config (0.1.0)
91
92
  builder (3.2.4)
92
93
  byebug (11.1.3)
93
- capybara (3.34.0)
94
+ capybara (3.36.0)
94
95
  addressable
96
+ matrix
95
97
  mini_mime (>= 0.1.3)
96
98
  nokogiri (~> 1.8)
97
99
  rack (>= 1.6.0)
98
100
  rack-test (>= 0.6.3)
99
- regexp_parser (~> 1.5)
101
+ regexp_parser (>= 1.5, < 3.0)
100
102
  xpath (~> 3.2)
103
+ cfn-status (0.4.3)
104
+ aws-sdk-cloudformation
101
105
  cfn_camelizer (0.4.9)
102
106
  activesupport
103
107
  memoist
104
108
  rainbow
105
- cfnresponse (0.4.0)
106
- concurrent-ruby (1.1.7)
109
+ cfn_response (0.2.0)
110
+ concurrent-ruby (1.1.9)
107
111
  crass (1.0.6)
108
112
  diff-lcs (1.4.4)
109
113
  dotenv (2.7.6)
@@ -111,19 +115,19 @@ GEM
111
115
  activesupport
112
116
  aws-sdk-dynamodb
113
117
  rainbow
114
- erubi (1.9.0)
118
+ erubi (1.10.0)
115
119
  gems (1.2.0)
116
- globalid (0.4.2)
117
- activesupport (>= 4.2.0)
118
- hashie (4.1.0)
119
- i18n (1.8.5)
120
+ globalid (1.0.0)
121
+ activesupport (>= 5.0)
122
+ hashie (5.0.0)
123
+ i18n (1.8.11)
120
124
  concurrent-ruby (~> 1.0)
121
- jets (2.3.17)
122
- actionmailer (~> 6.0.0)
123
- actionpack (~> 6.0.0)
124
- actionview (~> 6.0.0)
125
- activerecord (~> 6.0.0)
126
- activesupport (~> 6.0.0)
125
+ jets (3.0.23)
126
+ actionmailer (~> 6.1.0)
127
+ actionpack (~> 6.1.0)
128
+ actionview (~> 6.1.0)
129
+ activerecord (~> 6.1.0)
130
+ activesupport (~> 6.1.0)
127
131
  aws-mfa-secure (~> 0.4.0)
128
132
  aws-sdk-apigateway
129
133
  aws-sdk-cloudformation
@@ -135,69 +139,70 @@ GEM
135
139
  aws-sdk-sns
136
140
  aws-sdk-sqs
137
141
  aws-sdk-ssm
142
+ cfn-status
138
143
  cfn_camelizer (~> 0.4.6)
139
- cfnresponse
144
+ cfn_response
140
145
  dotenv
141
146
  gems
142
147
  hashie
143
- jets-gems
144
148
  jets-html-sanitizer
145
149
  kramdown
146
150
  memoist
147
- mimemagic
151
+ mini_mime
148
152
  rack
149
- railties (~> 6.0.0)
153
+ railties (~> 6.1.0)
150
154
  rainbow
151
155
  recursive-open-struct
156
+ serverlessgems (~> 0.1.4)
152
157
  shotgun
153
158
  text-table
154
159
  thor
155
- zeitwerk
156
- jets-gems (0.2.2)
157
- gems
160
+ zeitwerk (~> 2.4.0)
158
161
  jets-html-sanitizer (1.0.4)
159
162
  loofah (~> 2.2, >= 2.2.2)
160
163
  jmespath (1.4.0)
161
- kramdown (2.3.0)
164
+ kramdown (2.3.1)
162
165
  rexml
163
166
  launchy (2.5.0)
164
167
  addressable (~> 2.7)
165
- loofah (2.7.0)
168
+ loofah (2.13.0)
166
169
  crass (~> 1.0.2)
167
170
  nokogiri (>= 1.5.9)
168
171
  mail (2.7.1)
169
172
  mini_mime (>= 0.1.1)
173
+ matrix (0.4.2)
170
174
  memoist (0.16.2)
171
175
  method_source (1.0.0)
172
- mimemagic (0.3.5)
173
- mini_mime (1.0.2)
174
- mini_portile2 (2.4.0)
175
- minitest (5.14.2)
176
- nio4r (2.5.4)
177
- nokogiri (1.10.10)
178
- mini_portile2 (~> 2.4.0)
176
+ mini_mime (1.1.2)
177
+ mini_portile2 (2.6.1)
178
+ minitest (5.14.4)
179
+ nio4r (2.5.8)
180
+ nokogiri (1.12.5)
181
+ mini_portile2 (~> 2.6.1)
182
+ racc (~> 1.4)
179
183
  public_suffix (4.0.6)
180
- puma (5.1.0)
184
+ puma (5.5.2)
181
185
  nio4r (~> 2.0)
186
+ racc (1.6.0)
182
187
  rack (2.2.3)
183
188
  rack-test (1.1.0)
184
189
  rack (>= 1.0, < 3)
185
190
  rails-dom-testing (2.0.3)
186
191
  activesupport (>= 4.2.0)
187
192
  nokogiri (>= 1.6)
188
- rails-html-sanitizer (1.3.0)
193
+ rails-html-sanitizer (1.4.2)
189
194
  loofah (~> 2.3)
190
- railties (6.0.3.4)
191
- actionpack (= 6.0.3.4)
192
- activesupport (= 6.0.3.4)
195
+ railties (6.1.4.3)
196
+ actionpack (= 6.1.4.3)
197
+ activesupport (= 6.1.4.3)
193
198
  method_source
194
- rake (>= 0.8.7)
195
- thor (>= 0.20.3, < 2.0)
199
+ rake (>= 0.13)
200
+ thor (~> 1.0)
196
201
  rainbow (3.0.0)
197
- rake (13.0.1)
198
- recursive-open-struct (1.1.2)
199
- regexp_parser (1.8.2)
200
- rexml (3.2.4)
202
+ rake (13.0.6)
203
+ recursive-open-struct (1.1.3)
204
+ regexp_parser (2.1.1)
205
+ rexml (3.2.5)
201
206
  rspec (3.10.0)
202
207
  rspec-core (~> 3.10.0)
203
208
  rspec-expectations (~> 3.10.0)
@@ -213,16 +218,19 @@ GEM
213
218
  rspec-support (3.10.0)
214
219
  rspec_junit_formatter (0.4.1)
215
220
  rspec-core (>= 2, < 4, != 2.12.0)
221
+ serverlessgems (0.1.6)
222
+ gems
223
+ memoist
224
+ zeitwerk
216
225
  shotgun (0.9.2)
217
226
  rack (>= 1.0)
218
227
  text-table (1.2.4)
219
- thor (1.0.1)
220
- thread_safe (0.3.6)
221
- tzinfo (1.2.7)
222
- thread_safe (~> 0.1)
228
+ thor (1.1.0)
229
+ tzinfo (2.0.4)
230
+ concurrent-ruby (~> 1.0)
223
231
  xpath (3.2.0)
224
232
  nokogiri (~> 1.8)
225
- zeitwerk (2.4.0)
233
+ zeitwerk (2.4.2)
226
234
 
227
235
  PLATFORMS
228
236
  ruby
@@ -233,6 +241,7 @@ DEPENDENCIES
233
241
  dynomite
234
242
  jets
235
243
  launchy
244
+ nokogiri (~> 1.12.5)
236
245
  puma
237
246
  rack
238
247
  rspec
@@ -4,7 +4,7 @@
4
4
  class PaginationController < ApplicationController
5
5
  # GET pagination
6
6
  def index
7
- case params[:page]
7
+ case params[:page]&.to_s
8
8
  when '1', nil
9
9
  render status: :ok, json: first_page
10
10
  when '2'
@@ -50,7 +50,7 @@ class PaginationController < ApplicationController
50
50
  # but it should be `https://xxxxx.execute-api.ap-northeast-1.amazonaws.com/dev/pagination`.
51
51
  # So this is workaround.
52
52
  def page_link(page)
53
- query_strings = '?' + { page: page }.to_query
53
+ query_strings = "?#{{ page: page }.to_query}"
54
54
  uri = File.join(ENV['JETS_HOST'], ENV['JETS_STAGE'], pagination_path)
55
55
  uri.sub!('http://', 'https://')
56
56
  URI.join(uri, query_strings)
@@ -83,8 +83,8 @@
83
83
  <p>Also check out the <a href="http://rubyonjets.com/reference">Jets CLI reference</a>.</p>
84
84
  </div>
85
85
  <p class="version">
86
- <strong>Jets version:</strong> 2.3.13<br />
87
- <strong>Ruby version:</strong> 2.5.3
86
+ <strong>Jets version:</strong> 3.0.11<br />
87
+ <strong>Ruby version:</strong> 2.7.2
88
88
  </p>
89
89
  </div>
90
90
  </body>
@@ -18,7 +18,7 @@ require 'jets/spec_helpers'
18
18
  # Rspec helper module
19
19
  module Helpers
20
20
  def payload(name)
21
- JSON.parse(IO.read("spec/fixtures/payloads/#{name}.json"))
21
+ JSON.parse(File.read("spec/fixtures/payloads/#{name}.json"))
22
22
  end
23
23
  end
24
24
 
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.required_ruby_version = '>= 2.5.0'
25
+ spec.required_ruby_version = '>= 2.6.0'
26
26
 
27
- spec.add_dependency 'activesupport', '>= 5.0.0'
27
+ spec.add_dependency 'activesupport', '>= 5.2.0'
28
28
  spec.add_dependency 'faraday', '>= 0.17.1'
29
29
  spec.add_dependency 'jsonpath'
30
30
  spec.add_dependency 'sawyer', '>= 0.8.2'
@@ -37,7 +37,10 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'rubocop'
38
38
  spec.add_development_dependency 'rubocop-performance'
39
39
  spec.add_development_dependency 'rubocop-rspec'
40
- spec.add_development_dependency 'simplecov', '0.17.1'
40
+ spec.add_development_dependency 'simplecov', '0.21.2'
41
41
  spec.add_development_dependency 'webmock'
42
42
  spec.add_development_dependency 'yard'
43
+ spec.metadata = {
44
+ 'rubygems_mfa_required' => 'true',
45
+ }
43
46
  end