oauth2_api_client 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b846fd82d5e91d799c60adb483691d92a8ee508e3d602c624f9dea0f7d924af5
4
- data.tar.gz: 983f980480afb33623d5733ab5cafc019d6e9e2b93048cd5f6a3e9536acd7dc8
3
+ metadata.gz: bf92b6840d7440d512d8d0b7586acfe9751c38e6c99e4ab9f83cd9893cf9f13e
4
+ data.tar.gz: 2e79b922b01af914adef3bacc2f415af62d26e3c8ad95b699daa63147842410a
5
5
  SHA512:
6
- metadata.gz: 457d37f335df145f62464d7d380fbf2506bd8003ef38e2f471073513a38851dbe8ef5ad78d9763065e4bb0fa48f83fff832686705c50005b49f26a92c0c41e41
7
- data.tar.gz: 4b8f9a70d1afc7de2890196d34bef86e1006dae031ea60b7cef075442281bad8f3a3156bbb33fece19de67fcff404fbfdd834518388ac37f315daba4e7ea4b27
6
+ metadata.gz: 0b782f564cde4d121868f274946df14af27ab13d7e1d501367451b571ada534696027c8ae51e8705315ad35a5a43b04d800d3209a6c70a6eaedf0a1a5f077ca1
7
+ data.tar.gz: f2c3a469a6a189c6a0c986182ab2a53eb268a851882406d1d7de00cc32556f5a7ebb9e9dcc6732fd370ff9ce905a90a714ddea0649e33ada8eeea2dcb7a74be7
@@ -7,12 +7,12 @@ jobs:
7
7
  fail-fast: false
8
8
  matrix:
9
9
  ruby:
10
- - 2.6
11
- - 2.7
12
- - 3.0
10
+ - "2.7"
11
+ - "3.0"
12
+ - "3.1"
13
13
  steps:
14
14
  - uses: actions/checkout@v1
15
- - uses: actions/setup-ruby@v1
15
+ - uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
18
18
  - run: gem install bundler
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
2
  # CHANGELOG
3
3
 
4
+ # v3.4.0
5
+
6
+ * Add PATCH method
7
+
4
8
  # v3.3.0
5
9
 
6
10
  * Add Oauth2ApiClient#params to set default query params
data/Gemfile CHANGED
@@ -1,3 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ gem "bundler"
6
+ gem "rspec"
7
+ gem "rubocop"
8
+ gem "timecop"
9
+ gem "webmock"
@@ -1,3 +1,3 @@
1
1
  class Oauth2ApiClient
2
- VERSION = "3.3.0"
2
+ VERSION = "3.4.0"
3
3
  end
@@ -72,7 +72,7 @@ class Oauth2ApiClient
72
72
  ruby2_keywords method
73
73
  end
74
74
 
75
- [:get, :post, :put, :delete, :head, :options].each do |method|
75
+ [:get, :post, :put, :patch, :delete, :head, :options].each do |method|
76
76
  define_method method do |path, options = {}|
77
77
  execute(method, path, options)
78
78
  end
@@ -17,12 +17,6 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler"
21
- spec.add_development_dependency "rspec"
22
- spec.add_development_dependency "rubocop"
23
- spec.add_development_dependency "timecop"
24
- spec.add_development_dependency "webmock"
25
-
26
20
  spec.add_dependency "activesupport"
27
21
  spec.add_dependency "http"
28
22
  spec.add_dependency "oauth2", ">= 1.4.2"
@@ -140,6 +140,19 @@ RSpec.describe Oauth2ApiClient do
140
140
  expect(client.get("/path", params: { key: "value" }).to_s).to eq("ok")
141
141
  end
142
142
 
143
+ [:get, :post, :put, :patch, :delete, :head, :options].each do |method|
144
+ describe "##{method}" do
145
+ it "calls with body" do
146
+ stub_request(method, "http://localhost/api/path").with(body: { key: "value" }.to_json)
147
+ .to_return(status: 200, body: "ok")
148
+
149
+ client = described_class.new(base_url: "http://localhost/api", token: "token")
150
+
151
+ expect(client.send(method, "/path", headers: { "Content-Type" => "application/json" }, body: { key: "value" }.to_json).to_s).to eq("ok")
152
+ end
153
+ end
154
+ end
155
+
143
156
  it "passes the token in the authorization header" do
144
157
  stub_request(:get, "http://localhost/api/path")
145
158
  .with(headers: { "Authorization" => "Bearer access_token" })
metadata CHANGED
@@ -1,85 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth2_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Vetter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-22 00:00:00.000000000 Z
11
+ date: 2023-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: timecop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: webmock
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
13
  - !ruby/object:Gem::Dependency
84
14
  name: activesupport
85
15
  requirement: !ruby/object:Gem::Requirement