weekdone-sdk 0.3.0 → 0.3.1

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: 15784162103a609dca138f8d60eb2be34b504fad
4
- data.tar.gz: 58c057c30ea6bb9d9eefca8b0cfbef3a7a5eba39
3
+ metadata.gz: 147a06ce9bb051b9f2e357a2436b8f7e0ff23e69
4
+ data.tar.gz: 8095f1494ec5a66f29942b4cc394c1dd386de5c0
5
5
  SHA512:
6
- metadata.gz: e62e5b87af587a9450e88b8a5a87cd071f1c3602f0c65fe3df303af69379079a632ad97e56bb51b0b788d9dd4dfa1fb1e4bbf25613a2de0036fa5098489cd7ed
7
- data.tar.gz: f56a1a792d69eb20d3ecdb13e5d40720a27ce21db5ce7d2b5f216eee94aa048a827c4fd7dd1e06a5b5b7a4fc5135d34d0b72db10e4340a914978c0237256fc0f
6
+ metadata.gz: 51d2c19de54c9d0d0bdfda0d38d06c0a46383ff8d06f3fc3a59e5f69f2f9c70525769ad1346e7aad55b5f6e6b95af4cecb27fc439c94d7cc01a2c1fef83cae6c
7
+ data.tar.gz: 055c9c94e967a89d23df5af8ef004d5506c12da0ce9b88db0ea23436ee851cb3c0e067c241d1458803bd2767186a0dccaf3a16e1ac822a2728d74ed9236ad8ea
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weekdone-sdk (0.3.0)
4
+ weekdone-sdk (0.3.1)
5
5
  faraday (~> 1.0)
6
6
  oauth2 (~> 1.4)
7
7
 
@@ -5,7 +5,8 @@ require 'faraday'
5
5
 
6
6
  class Weekdone::Api
7
7
  API_URL = 'https://api.weekdone.com'
8
- attr_reader :client, :token_client, :token_code
8
+ attr_reader :client
9
+ attr_accessor :token_code
9
10
 
10
11
  def initialize(client_id, client_secret)
11
12
  @client = OAuth2::Client.new(
@@ -21,17 +22,24 @@ class Weekdone::Api
21
22
 
22
23
  def authenticate
23
24
  puts "open URL to authorize:"
24
- puts client.auth_code.authorize_url
25
+ puts authorization_request
25
26
 
26
27
  print "\ninput authorization code: "
27
28
  auth_code = gets.chomp
29
+ authorization_grant(auth_code)
30
+ end
31
+
32
+ def authorization_request
33
+ @client.auth_code.authorize_url
34
+ end
28
35
 
29
- @token_client = client.auth_code.get_token(
36
+ def authorization_grant(auth_code)
37
+ token_client = client.auth_code.get_token(
30
38
  auth_code,
31
39
  redirect_uri: 'http://localhost:8080/oauth2/authorized'
32
40
  )
33
41
 
34
- @token_code = @token_client.token
42
+ @token_code = token_client.token
35
43
  end
36
44
 
37
45
  def searchForItems(user_id: nil, team_id: nil, period: nil)
@@ -1,3 +1,3 @@
1
1
  module Weekdone
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weekdone-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thaim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-08 00:00:00.000000000 Z
11
+ date: 2020-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2