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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/weekdone/api.rb +12 -4
- data/lib/weekdone/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 147a06ce9bb051b9f2e357a2436b8f7e0ff23e69
|
4
|
+
data.tar.gz: 8095f1494ec5a66f29942b4cc394c1dd386de5c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51d2c19de54c9d0d0bdfda0d38d06c0a46383ff8d06f3fc3a59e5f69f2f9c70525769ad1346e7aad55b5f6e6b95af4cecb27fc439c94d7cc01a2c1fef83cae6c
|
7
|
+
data.tar.gz: 055c9c94e967a89d23df5af8ef004d5506c12da0ce9b88db0ea23436ee851cb3c0e067c241d1458803bd2767186a0dccaf3a16e1ac822a2728d74ed9236ad8ea
|
data/Gemfile.lock
CHANGED
data/lib/weekdone/api.rb
CHANGED
@@ -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
|
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
|
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
|
-
|
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 =
|
42
|
+
@token_code = token_client.token
|
35
43
|
end
|
36
44
|
|
37
45
|
def searchForItems(user_id: nil, team_id: nil, period: nil)
|
data/lib/weekdone/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|