tanita-api-client 0.2.1 → 0.2.2

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: 902f4a01534de8014c0a33f6ace1dea8bb166b55251893eb804563e85ce413bd
4
- data.tar.gz: a6515502c062eb473d687c50a83d1e20ff729d328a9a5771bc7f4b471de9ad4a
3
+ metadata.gz: 7abd65d845038f6e657b6e8346fe9839f9e8d148162d60683187a4346f7e5694
4
+ data.tar.gz: b45424da19973f3b269ce3a3a2999f6ec66eda06e67a9891d52fbbbfeb83fec3
5
5
  SHA512:
6
- metadata.gz: 0600c56a65654e1321beb64bfcfd743f131337b882a35b8e20ee5d059515ddac74c099f227ba8ee2367735b69c65fda28846d255e01a1555591538b48c80370c
7
- data.tar.gz: 8ea6ac953207e9b4f139f2aec31a5748eb6a5d2cde99de643ab2329ecf88a24b0ce64469e4e4d133ee970cace1629834e2ec882f7591f06233686405a484c230
6
+ metadata.gz: f10078889601e85d091d6c9248e8a0f8eeb4135695430f9eb3d92103188bb114a19f322767086088a4485dd72f2098884750c2e6fccfab76294238b496d8befe
7
+ data.tar.gz: 61c0b620234eb935ffae62fe91445be0f13c40a5c961b90fce6048058457233c787cb7f55956b47681fc9a0b472d8d6ddb1965c1b7f7b359eeff67ea9629c2df
@@ -1,7 +1,15 @@
1
+ # 0.2.2
2
+
3
+ * define constants
4
+ * `Tanita::Api::Client::AUTH_URL`
5
+ * `Tanita::Api::Client::AUTH_URL_PATH`
6
+ * `Tanita::Api::Client::TOKEN_URL`
7
+ * `Tanita::Api::Client::TOKEN_URL_PATH`
8
+
1
9
 
2
10
  # 0.2.1
3
11
 
4
- * rename constant
12
+ * rename constant
5
13
  * from `Tanita::Api::Client::HttpHelper::BASE_URL` to `Tanita::Api::Client::BASE_URL`
6
14
 
7
15
  # 0.2.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tanita-api-client (0.2.1)
4
+ tanita-api-client (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -37,7 +37,7 @@ module Tanita
37
37
  :scope => @scopes.join(','),
38
38
  :response_type => 'code'
39
39
  }
40
- generate_uri('/oauth/auth', params)
40
+ generate_uri(AUTH_URL_PATH, params)
41
41
  end
42
42
 
43
43
  def exchange_token(auth_code:)
@@ -48,7 +48,7 @@ module Tanita
48
48
  :code => auth_code,
49
49
  :grant_type => 'authorization_code'
50
50
  }
51
- res = request('/oauth/token', params)
51
+ res = request(TOKEN_URL_PATH, params)
52
52
  token = parse_json(res.body)
53
53
 
54
54
  raise Error.new("#{self.class}.#{__method__}: #{token[:error]}") if token.key? :error
@@ -7,6 +7,13 @@ module Tanita
7
7
  module Api
8
8
  module Client
9
9
  BASE_URL = 'https://www.healthplanet.jp'
10
+
11
+ AUTH_URL_PATH = '/oauth/auth'
12
+ AUTH_URL = "#{BASE_URL}#{AUTH_URL_PATH}"
13
+
14
+ TOKEN_URL_PATH = '/oauth/token'
15
+ TOKEN_URL = "#{BASE_URL}#{TOKEN_URL_PATH}"
16
+
10
17
  DEFAULT_REDIRECT_URI = "#{BASE_URL}/success.html"
11
18
 
12
19
  module HttpHelper
@@ -3,7 +3,7 @@
3
3
  module Tanita
4
4
  module Api
5
5
  module Client
6
- VERSION = '0.2.1'
6
+ VERSION = '0.2.2'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanita-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Koshikawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-10 00:00:00.000000000 Z
11
+ date: 2020-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler