my_api_client 0.9.1 → 0.9.2
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 +25 -5
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +23 -2
- data/Gemfile +3 -0
- data/Gemfile.lock +30 -29
- data/README.jp.md +2 -2
- data/README.md +1 -1
- data/gemfiles/rails_6.0.gemfile +15 -0
- data/lib/my_api_client/config.rb +13 -3
- data/lib/my_api_client/rspec/stub.rb +0 -34
- data/lib/my_api_client/version.rb +1 -1
- data/my_api_client.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 796e9513f74e5c4fa6366ac0a67b5eea77a9e0c32f39325acc8a8702ef9852f1
|
4
|
+
data.tar.gz: 274bd8ec8be1b10cc1b39ae683579dfb0e2f72dac7a1eab2a8cc018baf3c5335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2fbd02137213962a81a896d930a046360134b0c1cf600f0cf2f2f6b0e5d44d12b94a560c903d80e215dda9374fe4cca9bd558bafe887974de8ba5a1ceaa19ca
|
7
|
+
data.tar.gz: c1fe1f75598e3f597e3c52f32b6b32aee80ec4d9cfd061dcb2a1765955020b5b35cd161112a6d57121b72917773558f065b097bac4324e6aa5c1df3f18f3390d
|
data/.circleci/config.yml
CHANGED
@@ -17,7 +17,7 @@ references:
|
|
17
17
|
- &rails_version
|
18
18
|
rails_version:
|
19
19
|
type: enum
|
20
|
-
enum: ['4.2', '5.0', '5.1', '5.2']
|
20
|
+
enum: ['4.2', '5.0', '5.1', '5.2', '6.0']
|
21
21
|
default: '4.2'
|
22
22
|
- &bundler_options
|
23
23
|
bundler_options:
|
@@ -42,10 +42,11 @@ commands:
|
|
42
42
|
cp gemfiles/rails_<< parameters.rails_version >>.gemfile Gemfile
|
43
43
|
bundle update activesupport
|
44
44
|
run_rspec:
|
45
|
-
description:
|
45
|
+
description: Run RSpec
|
46
46
|
steps:
|
47
|
+
- code-climate/install
|
47
48
|
- run:
|
48
|
-
name:
|
49
|
+
name: Execute RSpec
|
49
50
|
command: |
|
50
51
|
mkdir /tmp/test-results
|
51
52
|
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
@@ -124,7 +125,6 @@ commands:
|
|
124
125
|
steps:
|
125
126
|
- modify_active_support_version:
|
126
127
|
rails_version: << parameters.rails_version >>
|
127
|
-
- code-climate/install
|
128
128
|
- run_rspec
|
129
129
|
- rake_build
|
130
130
|
|
@@ -151,7 +151,7 @@ jobs:
|
|
151
151
|
- code-climate/install
|
152
152
|
- code-climate/sum-coverage:
|
153
153
|
input: codeclimate.*.json
|
154
|
-
parts:
|
154
|
+
parts: 16
|
155
155
|
- code-climate/upload-coverage
|
156
156
|
rubocop:
|
157
157
|
executor: default
|
@@ -211,6 +211,10 @@ workflows:
|
|
211
211
|
name: build_on_ruby_2.5_and_rails_5.2
|
212
212
|
ruby_version: '2.5'
|
213
213
|
rails_version: '5.2'
|
214
|
+
- build:
|
215
|
+
name: build_on_ruby_2.5_and_rails_6.0
|
216
|
+
ruby_version: '2.5'
|
217
|
+
rails_version: '6.0'
|
214
218
|
- build:
|
215
219
|
name: build_on_ruby_2.6_and_rails_4.2
|
216
220
|
ruby_version: '2.6'
|
@@ -233,6 +237,16 @@ workflows:
|
|
233
237
|
ruby_version: '2.6'
|
234
238
|
rails_version: '5.2'
|
235
239
|
bundler_options: '--without integrations'
|
240
|
+
- build:
|
241
|
+
name: build_on_ruby_2.6_and_rails_6.0_with_integrations
|
242
|
+
ruby_version: '2.6'
|
243
|
+
rails_version: '6.0'
|
244
|
+
bundler_options: '--with integrations'
|
245
|
+
- build:
|
246
|
+
name: build_on_ruby_2.6_and_rails_6.0_without_integrations
|
247
|
+
ruby_version: '2.6'
|
248
|
+
rails_version: '6.0'
|
249
|
+
bundler_options: '--without integrations'
|
236
250
|
- rubocop
|
237
251
|
- yardoc
|
238
252
|
- upload-coverage:
|
@@ -245,11 +259,14 @@ workflows:
|
|
245
259
|
- build_on_ruby_2.5_and_rails_5.0
|
246
260
|
- build_on_ruby_2.5_and_rails_5.1
|
247
261
|
- build_on_ruby_2.5_and_rails_5.2
|
262
|
+
- build_on_ruby_2.5_and_rails_6.0
|
248
263
|
- build_on_ruby_2.6_and_rails_4.2
|
249
264
|
- build_on_ruby_2.6_and_rails_5.0
|
250
265
|
- build_on_ruby_2.6_and_rails_5.1
|
251
266
|
- build_on_ruby_2.6_and_rails_5.2_with_integrations
|
252
267
|
- build_on_ruby_2.6_and_rails_5.2_without_integrations
|
268
|
+
- build_on_ruby_2.6_and_rails_6.0_with_integrations
|
269
|
+
- build_on_ruby_2.6_and_rails_6.0_without_integrations
|
253
270
|
- release:
|
254
271
|
context: RubyGems API Key
|
255
272
|
requires:
|
@@ -261,11 +278,14 @@ workflows:
|
|
261
278
|
- build_on_ruby_2.5_and_rails_5.0
|
262
279
|
- build_on_ruby_2.5_and_rails_5.1
|
263
280
|
- build_on_ruby_2.5_and_rails_5.2
|
281
|
+
- build_on_ruby_2.5_and_rails_6.0
|
264
282
|
- build_on_ruby_2.6_and_rails_4.2
|
265
283
|
- build_on_ruby_2.6_and_rails_5.0
|
266
284
|
- build_on_ruby_2.6_and_rails_5.1
|
267
285
|
- build_on_ruby_2.6_and_rails_5.2_with_integrations
|
268
286
|
- build_on_ruby_2.6_and_rails_5.2_without_integrations
|
287
|
+
- build_on_ruby_2.6_and_rails_6.0_with_integrations
|
288
|
+
- build_on_ruby_2.6_and_rails_6.0_without_integrations
|
269
289
|
- rubocop
|
270
290
|
filters:
|
271
291
|
branches:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-
|
3
|
+
# on 2019-09-30 23:40:39 +0000 using RuboCop version 0.75.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,31 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## 0.9.2 (Oct 8, 2019)
|
4
|
+
|
5
|
+
### Bugfix
|
6
|
+
|
7
|
+
* Fix endpoint parsing when including port number ([#117](https://github.com/ryz310/my_api_client/pull/117))
|
8
|
+
* Fixes: Can't request to URL which includes port numbert ([#116](https://github.com/ryz310/my_api_client/pull/116))
|
9
|
+
|
10
|
+
### Misc
|
11
|
+
|
12
|
+
* Re-generate .rubocop_todo.yml with RuboCop v0.74.0 ([#100](https://github.com/ryz310/my_api_client/pull/100))
|
13
|
+
* Re-generate .rubocop_todo.yml with RuboCop v0.75.0 ([#112](https://github.com/ryz310/my_api_client/pull/112))
|
14
|
+
* Support Rails 6.0 ([#101](https://github.com/ryz310/my_api_client/pull/101))
|
15
|
+
|
16
|
+
* deprecated/my_api_client_stub ([#102](https://github.com/ryz310/my_api_client/pull/102))
|
17
|
+
* dependabot/bundler/rake-tw-13.0 ([#105](https://github.com/ryz310/my_api_client/pull/105))
|
18
|
+
* dependabot/bundler/webmock-3.7.5 ([#108](https://github.com/ryz310/my_api_client/pull/108))
|
19
|
+
* dependabot/bundler/bugsnag-6.12.1 ([#109](https://github.com/ryz310/my_api_client/pull/109))
|
20
|
+
* dependabot/bundler/simplecov-0.17.1 ([#110](https://github.com/ryz310/my_api_client/pull/110))
|
21
|
+
* dependabot/bundler/rubocop-rspec-1.36.0 ([#111](https://github.com/ryz310/my_api_client/pull/111))
|
22
|
+
* dependabot/bundler/rubocop-performance-1.5.0 ([#115](https://github.com/ryz310/my_api_client/pull/115))
|
23
|
+
|
3
24
|
## 0.9.1 (July 25, 2019)
|
4
25
|
|
5
26
|
### Bugfix
|
6
27
|
|
7
|
-
* Fix
|
28
|
+
* Fix forbid nil option ([#97](https://github.com/ryz310/my_api_client/pull/97)) **Breaking Changes**
|
8
29
|
|
9
30
|
## 0.9.0 (July 25, 2019)
|
10
31
|
|
@@ -47,7 +68,7 @@
|
|
47
68
|
### Bug fixes
|
48
69
|
|
49
70
|
* Fix logger setter on the template ([#76](https://github.com/ryz310/my_api_client/pull/76))
|
50
|
-
*
|
71
|
+
* Fixes: The logger does not work... ([#54](https://github.com/ryz310/my_api_client/pull/54))
|
51
72
|
|
52
73
|
## 0.6.1 (July 03, 2019)
|
53
74
|
|
data/Gemfile
CHANGED
@@ -4,6 +4,9 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
6
|
|
7
|
+
# Workaound for ruby 2.4. Because activesupport v6.0.0 requires ruby 2.5 over.
|
8
|
+
gem 'activesupport', '< 6.0.0'
|
9
|
+
|
7
10
|
group :integrations, optional: true do
|
8
11
|
gem 'bugsnag', '>= 6.11.0'
|
9
12
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
my_api_client (0.9.
|
4
|
+
my_api_client (0.9.2)
|
5
5
|
activesupport (>= 4.2.0)
|
6
6
|
jsonpath
|
7
7
|
sawyer (>= 0.8.2)
|
@@ -14,10 +14,10 @@ GEM
|
|
14
14
|
i18n (>= 0.7, < 2)
|
15
15
|
minitest (~> 5.1)
|
16
16
|
tzinfo (~> 1.1)
|
17
|
-
addressable (2.
|
18
|
-
public_suffix (>= 2.0.2, <
|
17
|
+
addressable (2.7.0)
|
18
|
+
public_suffix (>= 2.0.2, < 5.0)
|
19
19
|
ast (2.4.0)
|
20
|
-
bugsnag (6.
|
20
|
+
bugsnag (6.12.1)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
22
|
byebug (11.0.1)
|
23
23
|
coderay (1.1.2)
|
@@ -26,10 +26,10 @@ GEM
|
|
26
26
|
safe_yaml (~> 1.0.0)
|
27
27
|
diff-lcs (1.3)
|
28
28
|
docile (1.3.2)
|
29
|
-
faraday (0.
|
29
|
+
faraday (0.17.0)
|
30
30
|
multipart-post (>= 1.2, < 3)
|
31
31
|
hashdiff (1.0.0)
|
32
|
-
i18n (1.
|
32
|
+
i18n (1.7.0)
|
33
33
|
concurrent-ruby (~> 1.0)
|
34
34
|
jaro_winkler (1.5.3)
|
35
35
|
json (2.2.0)
|
@@ -37,11 +37,11 @@ GEM
|
|
37
37
|
multi_json
|
38
38
|
to_regexp (~> 0.2.1)
|
39
39
|
method_source (0.9.2)
|
40
|
-
minitest (5.
|
40
|
+
minitest (5.12.2)
|
41
41
|
multi_json (1.13.1)
|
42
42
|
multipart-post (2.1.1)
|
43
|
-
parallel (1.
|
44
|
-
parser (2.6.
|
43
|
+
parallel (1.18.0)
|
44
|
+
parser (2.6.5.0)
|
45
45
|
ast (~> 2.4.0)
|
46
46
|
pry (0.12.2)
|
47
47
|
coderay (~> 1.1.0)
|
@@ -49,41 +49,41 @@ GEM
|
|
49
49
|
pry-byebug (3.7.0)
|
50
50
|
byebug (~> 11.0)
|
51
51
|
pry (~> 0.10)
|
52
|
-
public_suffix (
|
52
|
+
public_suffix (4.0.1)
|
53
53
|
rainbow (3.0.0)
|
54
|
-
rake (
|
55
|
-
rspec (3.
|
56
|
-
rspec-core (~> 3.
|
57
|
-
rspec-expectations (~> 3.
|
58
|
-
rspec-mocks (~> 3.
|
59
|
-
rspec-core (3.
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-expectations (3.
|
54
|
+
rake (13.0.0)
|
55
|
+
rspec (3.9.0)
|
56
|
+
rspec-core (~> 3.9.0)
|
57
|
+
rspec-expectations (~> 3.9.0)
|
58
|
+
rspec-mocks (~> 3.9.0)
|
59
|
+
rspec-core (3.9.0)
|
60
|
+
rspec-support (~> 3.9.0)
|
61
|
+
rspec-expectations (3.9.0)
|
62
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-mocks (3.
|
63
|
+
rspec-support (~> 3.9.0)
|
64
|
+
rspec-mocks (3.9.0)
|
65
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
-
rspec-support (~> 3.
|
67
|
-
rspec-support (3.
|
66
|
+
rspec-support (~> 3.9.0)
|
67
|
+
rspec-support (3.9.0)
|
68
68
|
rspec_junit_formatter (0.4.1)
|
69
69
|
rspec-core (>= 2, < 4, != 2.12.0)
|
70
|
-
rubocop (0.
|
70
|
+
rubocop (0.75.0)
|
71
71
|
jaro_winkler (~> 1.5.1)
|
72
72
|
parallel (~> 1.10)
|
73
73
|
parser (>= 2.6)
|
74
74
|
rainbow (>= 2.2.2, < 4.0)
|
75
75
|
ruby-progressbar (~> 1.7)
|
76
76
|
unicode-display_width (>= 1.4.0, < 1.7)
|
77
|
-
rubocop-performance (1.
|
77
|
+
rubocop-performance (1.5.0)
|
78
78
|
rubocop (>= 0.71.0)
|
79
|
-
rubocop-rspec (1.
|
80
|
-
rubocop (>= 0.
|
79
|
+
rubocop-rspec (1.36.0)
|
80
|
+
rubocop (>= 0.68.1)
|
81
81
|
ruby-progressbar (1.10.1)
|
82
82
|
safe_yaml (1.0.5)
|
83
83
|
sawyer (0.8.2)
|
84
84
|
addressable (>= 2.3.5)
|
85
85
|
faraday (> 0.8, < 2.0)
|
86
|
-
simplecov (0.17.
|
86
|
+
simplecov (0.17.1)
|
87
87
|
docile (~> 1.1)
|
88
88
|
json (>= 1.8, < 3)
|
89
89
|
simplecov-html (~> 0.10.0)
|
@@ -93,7 +93,7 @@ GEM
|
|
93
93
|
tzinfo (1.2.5)
|
94
94
|
thread_safe (~> 0.1)
|
95
95
|
unicode-display_width (1.6.0)
|
96
|
-
webmock (3.6
|
96
|
+
webmock (3.7.6)
|
97
97
|
addressable (>= 2.3.6)
|
98
98
|
crack (>= 0.3.2)
|
99
99
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -103,11 +103,12 @@ PLATFORMS
|
|
103
103
|
ruby
|
104
104
|
|
105
105
|
DEPENDENCIES
|
106
|
+
activesupport (< 6.0.0)
|
106
107
|
bugsnag (>= 6.11.0)
|
107
108
|
bundler (~> 1.16)
|
108
109
|
my_api_client!
|
109
110
|
pry-byebug
|
110
|
-
rake (~>
|
111
|
+
rake (~> 13.0)
|
111
112
|
rspec
|
112
113
|
rspec_junit_formatter
|
113
114
|
rubocop
|
data/README.jp.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![CircleCI](https://circleci.com/gh/ryz310/my_api_client.svg?style=svg)](https://circleci.com/gh/ryz310/my_api_client) [![Gem Version](https://badge.fury.io/rb/my_api_client.svg)](https://badge.fury.io/rb/my_api_client) [![Maintainability](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/maintainability)](https://codeclimate.com/github/ryz310/my_api_client/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/test_coverage)](https://codeclimate.com/github/ryz310/my_api_client/test_coverage)
|
1
|
+
[![CircleCI](https://circleci.com/gh/ryz310/my_api_client.svg?style=svg)](https://circleci.com/gh/ryz310/my_api_client) [![Gem Version](https://badge.fury.io/rb/my_api_client.svg)](https://badge.fury.io/rb/my_api_client) [![Maintainability](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/maintainability)](https://codeclimate.com/github/ryz310/my_api_client/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/test_coverage)](https://codeclimate.com/github/ryz310/my_api_client/test_coverage) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ryz310/my_api_client)](https://dependabot.com)
|
2
2
|
|
3
3
|
# MyApiClient
|
4
4
|
|
@@ -11,7 +11,7 @@ MyApiClient は API リクエストクラスを作成するための汎用的な
|
|
11
11
|
## Supported Versions
|
12
12
|
|
13
13
|
* Ruby 2.4, 2.5, 2.6
|
14
|
-
* Rails 4.2, 5.0, 5.1, 5.2
|
14
|
+
* Rails 4.2, 5.0, 5.1, 5.2, 6.0
|
15
15
|
|
16
16
|
## Installation
|
17
17
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![CircleCI](https://circleci.com/gh/ryz310/my_api_client.svg?style=svg)](https://circleci.com/gh/ryz310/my_api_client) [![Gem Version](https://badge.fury.io/rb/my_api_client.svg)](https://badge.fury.io/rb/my_api_client) [![Maintainability](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/maintainability)](https://codeclimate.com/github/ryz310/my_api_client/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/test_coverage)](https://codeclimate.com/github/ryz310/my_api_client/test_coverage)
|
1
|
+
[![CircleCI](https://circleci.com/gh/ryz310/my_api_client.svg?style=svg)](https://circleci.com/gh/ryz310/my_api_client) [![Gem Version](https://badge.fury.io/rb/my_api_client.svg)](https://badge.fury.io/rb/my_api_client) [![Maintainability](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/maintainability)](https://codeclimate.com/github/ryz310/my_api_client/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/861a2c8f168bbe995107/test_coverage)](https://codeclimate.com/github/ryz310/my_api_client/test_coverage) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ryz310/my_api_client)](https://dependabot.com)
|
2
2
|
|
3
3
|
日本語ドキュメントは [こちら](README.jp.md)
|
4
4
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file was generated by Appraisal
|
4
|
+
|
5
|
+
source 'https://rubygems.org'
|
6
|
+
|
7
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
8
|
+
|
9
|
+
gem 'activesupport', '~> 6.0.0'
|
10
|
+
|
11
|
+
group :integrations, optional: true do
|
12
|
+
gem 'bugsnag', '>= 6.11.0'
|
13
|
+
end
|
14
|
+
|
15
|
+
gemspec
|
data/lib/my_api_client/config.rb
CHANGED
@@ -23,8 +23,11 @@ module MyApiClient
|
|
23
23
|
# schema_and_hostname # => 'https://example.com'
|
24
24
|
# @return [String] description_of_returned_object
|
25
25
|
def schema_and_hostname
|
26
|
-
|
27
|
-
|
26
|
+
if _uri.default_port == _uri.port
|
27
|
+
"#{_uri.scheme}://#{_uri.host}"
|
28
|
+
else
|
29
|
+
"#{_uri.scheme}://#{_uri.host}:#{_uri.port}"
|
30
|
+
end
|
28
31
|
end
|
29
32
|
|
30
33
|
# Extracts pathname from endpoint
|
@@ -33,7 +36,14 @@ module MyApiClient
|
|
33
36
|
# common_path # => 'path/to/api'
|
34
37
|
# @return [String] The pathanem
|
35
38
|
def common_path
|
36
|
-
|
39
|
+
_uri.path
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
# @return [URI] Returns a memoized URI instance
|
45
|
+
def _uri
|
46
|
+
@_uri ||= URI.parse(endpoint)
|
37
47
|
end
|
38
48
|
end
|
39
49
|
end
|
@@ -52,40 +52,6 @@ module MyApiClient
|
|
52
52
|
instance
|
53
53
|
end
|
54
54
|
|
55
|
-
# Provides stubbing feature for `MyApiClient`.
|
56
|
-
#
|
57
|
-
# @param klass [Class]
|
58
|
-
# Stubbing target class.
|
59
|
-
# @param action [Symbol]
|
60
|
-
# Stubbing target method name.
|
61
|
-
# @param response [Object, nil]
|
62
|
-
# Stubbed ApiClient will return parameters set by `response`.
|
63
|
-
# default: nil
|
64
|
-
# @param raise [Class, MyApiClient::Error, nil]
|
65
|
-
# Stubbed ApiClient will raise exception set by `raise`.
|
66
|
-
# You can set either exception class or exception instance.
|
67
|
-
# default: nil
|
68
|
-
# @return [InstanceDouble]
|
69
|
-
# Returns a spy object for the ApiClient.
|
70
|
-
# rubocop:disable Metrics/AbcSize
|
71
|
-
def my_api_client_stub(klass, action, response: nil, raise: nil)
|
72
|
-
ActiveSupport::Deprecation.warn(<<~MSG)
|
73
|
-
`my_api_client_stub` is deprecated. Please use `stub_api_client` or `stub_api_client_all`.
|
74
|
-
MSG
|
75
|
-
|
76
|
-
instance = instance_double(klass)
|
77
|
-
allow(klass).to receive(:new).and_return(instance)
|
78
|
-
if raise.present?
|
79
|
-
allow(instance).to receive(action).and_raise(process_raise_option(raise))
|
80
|
-
elsif block_given?
|
81
|
-
allow(instance).to receive(action) { |*request| stub_as_sawyer(yield(*request)) }
|
82
|
-
else
|
83
|
-
allow(instance).to receive(action).and_return(stub_as_sawyer(response))
|
84
|
-
end
|
85
|
-
instance
|
86
|
-
end
|
87
|
-
# rubocop:enable Metrics/AbcSize
|
88
|
-
|
89
55
|
private
|
90
56
|
|
91
57
|
# rubocop:disable Metrics/AbcSize
|
data/my_api_client.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
30
30
|
spec.add_development_dependency 'pry-byebug'
|
31
|
-
spec.add_development_dependency 'rake', '~>
|
31
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
32
32
|
spec.add_development_dependency 'rspec'
|
33
33
|
spec.add_development_dependency 'rspec_junit_formatter'
|
34
34
|
spec.add_development_dependency 'rubocop'
|
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.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryz310
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '13.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '13.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- gemfiles/rails_5.0.gemfile
|
235
235
|
- gemfiles/rails_5.1.gemfile
|
236
236
|
- gemfiles/rails_5.2.gemfile
|
237
|
+
- gemfiles/rails_6.0.gemfile
|
237
238
|
- lib/generators/generator_helper.rb
|
238
239
|
- lib/generators/rails/USAGE
|
239
240
|
- lib/generators/rails/api_client_generator.rb
|