base-api-client 0.2.1.beta → 0.2.2.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0979ae0a06c3cf15f643909d2b2589127dc43530
|
4
|
+
data.tar.gz: 8959a94a002f8933ceec0995865c6e194cbff2d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8374dbf348bfe74bc204dbdf23a823a74311d92f5d58e6c9a1fa5452966f607d8ae01d3a3f1290cd551463aa6fb8904beceb06990fc411bac1299af35db07904
|
7
|
+
data.tar.gz: 8d345f490a01b9b40f76e55507399221c9630d2129c51cf6d161700c4283d52433fb5299ef83462ab90c3bde85ec6cd2fef873c666855a7b65dcd2962747f168
|
data/base-api-client.gemspec
CHANGED
data/config/client_secret.json
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
"client_secret": "ad493e7ada7eb96a6f71d1ccb100966b",
|
4
4
|
"code": "",
|
5
5
|
"redirect_uri": "http://localhost.local",
|
6
|
-
"
|
7
|
-
|
8
|
-
"client_secret": "214b4134022df8bf0230f5a077c772d9"
|
9
|
-
}
|
6
|
+
"search_client_id": "623f75000821c16163ec570ca6469539",
|
7
|
+
"search_client_secret": "214b4134022df8bf0230f5a077c772d9"
|
10
8
|
}
|
@@ -18,15 +18,14 @@ module Base
|
|
18
18
|
:search_client_id,
|
19
19
|
:search_client_secret
|
20
20
|
|
21
|
-
def initialize(
|
22
|
-
|
23
|
-
|
24
|
-
@
|
25
|
-
@
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@search_client_secret ||= app_info['search']['client_secret']
|
21
|
+
def initialize(args = nil)
|
22
|
+
opt = args || load_file
|
23
|
+
@client_id ||= opt['client_id']
|
24
|
+
@client_secret ||= opt['client_secret']
|
25
|
+
@code ||= opt['code']
|
26
|
+
@redirect_uri ||= opt['redirect_uri']
|
27
|
+
@search_client_id ||= opt['search_client_id']
|
28
|
+
@search_client_secret ||= opt['search_client_secret']
|
30
29
|
end
|
31
30
|
|
32
31
|
def update!
|
@@ -56,25 +56,30 @@ RSpec.describe Base::APIClient::ClientSecret do
|
|
56
56
|
|
57
57
|
describe 'without parameters' do
|
58
58
|
it 'instance variables have correct values' do
|
59
|
-
expect(subject.client_id).to eq
|
60
|
-
|
61
|
-
expect(subject.
|
62
|
-
|
63
|
-
expect(subject.
|
64
|
-
|
59
|
+
expect(subject.client_id).to eq \
|
60
|
+
'fake_client_id'
|
61
|
+
expect(subject.client_secret).to eq \
|
62
|
+
'fake_client_secret'
|
63
|
+
expect(subject.code).to eq \
|
64
|
+
'fake_code'
|
65
|
+
expect(subject.redirect_uri).to eq \
|
66
|
+
'http://fake_redirect_uri.com'
|
67
|
+
expect(subject.search_client_id).to eq \
|
68
|
+
'fake_search_client_id'
|
69
|
+
expect(subject.search_client_secret).to eq \
|
70
|
+
'fake_search_client_secret'
|
65
71
|
end
|
66
72
|
end
|
67
73
|
|
68
74
|
describe 'with parameters' do
|
69
75
|
subject do
|
70
|
-
Base::APIClient::ClientSecret.new
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
end
|
76
|
+
Base::APIClient::ClientSecret.new(
|
77
|
+
'client_id' => 'optional_client_id',
|
78
|
+
'client_secret' => 'optional_client_secret',
|
79
|
+
'code' => 'optional_code',
|
80
|
+
'redirect_uri' => 'optional_redirect_uri',
|
81
|
+
'search_client_id' => 'optional_search_client_id',
|
82
|
+
'search_client_secret' => 'optional_search_client_secret')
|
78
83
|
end
|
79
84
|
|
80
85
|
describe 'content of variables' do
|
@@ -91,8 +96,8 @@ RSpec.describe Base::APIClient::ClientSecret do
|
|
91
96
|
end
|
92
97
|
end
|
93
98
|
|
94
|
-
describe '#update' do
|
95
|
-
|
99
|
+
describe '#update!' do
|
100
|
+
before(:each) do
|
96
101
|
subject.update! do |zelf|
|
97
102
|
zelf.client_id = 'updated_client_id'
|
98
103
|
zelf.client_secret = 'updated_client_secret'
|
@@ -101,13 +106,16 @@ RSpec.describe Base::APIClient::ClientSecret do
|
|
101
106
|
zelf.search_client_id = 'updated_search_client_id'
|
102
107
|
zelf.search_client_secret = 'updated_search_client_secret'
|
103
108
|
end
|
109
|
+
end
|
104
110
|
|
111
|
+
it 'update values of instance variables' do
|
105
112
|
expect(subject.client_id).to eq 'updated_client_id'
|
106
113
|
expect(subject.client_secret).to eq 'updated_client_secret'
|
107
114
|
expect(subject.code).to eq 'updated_code'
|
108
115
|
expect(subject.redirect_uri).to eq 'updated_redirect_uri'
|
109
116
|
expect(subject.search_client_id).to eq 'updated_search_client_id'
|
110
|
-
expect(subject.search_client_secret).to eq
|
117
|
+
expect(subject.search_client_secret).to eq \
|
118
|
+
'updated_search_client_secret'
|
111
119
|
end
|
112
120
|
end
|
113
121
|
|
@@ -3,8 +3,6 @@
|
|
3
3
|
"client_secret": "fake_client_secret",
|
4
4
|
"code": "fake_code",
|
5
5
|
"redirect_uri": "http://fake_redirect_uri.com",
|
6
|
-
"
|
7
|
-
|
8
|
-
"client_secret": "fake_search_client_secret"
|
9
|
-
}
|
6
|
+
"search_client_id": "fake_search_client_id",
|
7
|
+
"search_client_secret": "fake_search_client_secret"
|
10
8
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ysksn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: os
|