rentpath_leankit 0.2 → 0.3
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/lib/get_leankit_board.rb +13 -16
- data/lib/get_leankit_cards.rb +9 -13
- data/lib/get_leankit_cards_by_boardId.rb +35 -0
- data/lib/leankit_connect.rb +3 -3
- metadata +2 -2
- data/lib/get_leankit_tasks.rb +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9055020c5f48ce52d8f1e297523cbfdf0d8e101953c45617a9dcecdb8ef75bc0
|
|
4
|
+
data.tar.gz: b6aa5adde623b8bda29be9b364a16f6f307a52f838131c15eb47bccad3ae2fdc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5856728029eeae6fd8758f872b879d78374040f4ba982dfb7020dee34c86114879de620e7b16e57b14f236011e10c38b23dd685e79ebd42d2cbe8054c8e2f6ef
|
|
7
|
+
data.tar.gz: fa9a8883e755ff98771825f43b979ce3ee0b972036d65862c1797ba1798ba44aee3a9a48080c33f5910f51ae1748609b2a95fa0dd12d3824b843f50dce2bb753
|
data/lib/get_leankit_board.rb
CHANGED
|
@@ -3,32 +3,29 @@ class GetLeankitBoard
|
|
|
3
3
|
class << self
|
|
4
4
|
|
|
5
5
|
def get(id)
|
|
6
|
-
|
|
7
6
|
response, status = get_json(id)
|
|
8
|
-
status == 200 ? response : errors(response,status)
|
|
9
|
-
|
|
7
|
+
status == 200 ? response : errors(response, status)
|
|
8
|
+
[response, status]
|
|
10
9
|
end
|
|
11
10
|
|
|
12
|
-
def errors(response,status)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
def errors(response, status)
|
|
12
|
+
warn "Leankit connection failed response:#{response}, status:#{status}"
|
|
13
|
+
# rescue LoadError => e
|
|
14
|
+
# puts " this is EXPECTION #{e}"
|
|
15
|
+
# raise response
|
|
18
16
|
"failed response:#{response}, status:#{status}"
|
|
19
|
-
|
|
20
17
|
end
|
|
21
18
|
|
|
22
19
|
def get_json(id)
|
|
23
20
|
url = "#{Settings.boardurl}#{id}"
|
|
24
21
|
uri = URI(url)
|
|
25
22
|
response = api.get(uri)
|
|
26
|
-
#[JSON.parse(response.body), response.status]
|
|
27
|
-
|
|
28
|
-
puts "
|
|
29
|
-
puts "
|
|
30
|
-
|
|
31
|
-
[response.body
|
|
23
|
+
# [JSON.parse(response.body), response.status]
|
|
24
|
+
# TODO convert to logs
|
|
25
|
+
# puts "STATUS==#{response.status}"
|
|
26
|
+
# puts "BODY==#{response.body}"
|
|
27
|
+
# puts "THIS IS SETTING== #{Settings.userid}, #{Settings.password}"
|
|
28
|
+
[response.body, response.status]
|
|
32
29
|
end
|
|
33
30
|
|
|
34
31
|
def api
|
data/lib/get_leankit_cards.rb
CHANGED
|
@@ -2,32 +2,28 @@ class GetLeankitCards
|
|
|
2
2
|
class << self
|
|
3
3
|
|
|
4
4
|
def get(id)
|
|
5
|
-
|
|
6
5
|
response, status = get_json(id)
|
|
7
|
-
status == 200 ? response : errors(response,status)
|
|
8
|
-
[response
|
|
6
|
+
status == 200 ? response : errors(response, status)
|
|
7
|
+
[response, status]
|
|
9
8
|
end
|
|
10
9
|
|
|
11
|
-
def errors(response,status)
|
|
12
|
-
|
|
10
|
+
def errors(response, status)
|
|
11
|
+
warn "Leankit connection failed response:#{response}, status:#{status}"
|
|
13
12
|
# rescue LoadError => e
|
|
14
13
|
# puts " this is EXPECTION #{e}"
|
|
15
14
|
# raise response
|
|
16
|
-
|
|
17
15
|
"failed response:#{response}, status:#{status}"
|
|
18
|
-
|
|
19
16
|
end
|
|
20
17
|
|
|
21
18
|
def get_json(id)
|
|
22
19
|
url = "#{Settings.cardurl}#{id}"
|
|
23
20
|
uri = URI(url)
|
|
24
21
|
response = api.get(uri)
|
|
25
|
-
#[JSON.parse(response.body), response.status]
|
|
26
|
-
#TODO convert to logs
|
|
27
|
-
puts "STATUS==#{response.status}"
|
|
28
|
-
puts "BODY==#{response.body}"
|
|
29
|
-
|
|
30
|
-
[response.body , response.status]
|
|
22
|
+
# [JSON.parse(response.body), response.status]
|
|
23
|
+
# TODO convert to logs
|
|
24
|
+
# puts "STATUS==#{response.status}"
|
|
25
|
+
# puts "BODY==#{response.body}"
|
|
26
|
+
[response.body, response.status]
|
|
31
27
|
end
|
|
32
28
|
|
|
33
29
|
def api
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
class GetLeankitCardsByBoardId
|
|
2
|
+
class << self
|
|
3
|
+
|
|
4
|
+
def get(id)
|
|
5
|
+
response, status = get_json(id)
|
|
6
|
+
status == 200 ? response : errors(response, status)
|
|
7
|
+
[response, status]
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def errors(response, status)
|
|
11
|
+
warn "Leankit connection failed response:#{response}, status:#{status}"
|
|
12
|
+
# rescue LoadError => e
|
|
13
|
+
# puts " this is EXPECTION #{e}"
|
|
14
|
+
# raise response
|
|
15
|
+
"failed response:#{response}, status:#{status}"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_json(id)
|
|
19
|
+
url = "#{Settings.cardurl}?board=#{id}"
|
|
20
|
+
uri = URI(url)
|
|
21
|
+
response = api.get(uri)
|
|
22
|
+
# [JSON.parse(response.body), response.status]
|
|
23
|
+
# TODO convert to logs
|
|
24
|
+
puts "STATUS==#{response.status}"
|
|
25
|
+
puts "BODY==#{response.body}"
|
|
26
|
+
[response.body, response.status]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def api
|
|
30
|
+
begin
|
|
31
|
+
LeankitConnect.api
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/leankit_connect.rb
CHANGED
|
@@ -4,12 +4,12 @@ require 'json'
|
|
|
4
4
|
class LeankitConnect
|
|
5
5
|
|
|
6
6
|
def self.api
|
|
7
|
-
Faraday.new(url:
|
|
7
|
+
Faraday.new(url: Settings.leankiturl.to_s) do |conn|
|
|
8
8
|
conn.response :logger
|
|
9
9
|
conn.adapter Faraday.default_adapter
|
|
10
10
|
conn.headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
11
|
-
conn.basic_auth(
|
|
12
|
-
#conn.token_auth('bearer11230e5ae75b4c0b68c554a2109a230423889073a3de22f58425c44f39cff301597b1fb63e4724486806da5e7e1db33d4f178d0b6b4792b592b08fe6103161a4')
|
|
11
|
+
conn.basic_auth(Settings.userid.to_s, Settings.password.to_s)
|
|
12
|
+
# conn.token_auth('bearer11230e5ae75b4c0b68c554a2109a230423889073a3de22f58425c44f39cff301597b1fb63e4724486806da5e7e1db33d4f178d0b6b4792b592b08fe6103161a4')
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rentpath_leankit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Asha
|
|
@@ -18,7 +18,7 @@ extra_rdoc_files: []
|
|
|
18
18
|
files:
|
|
19
19
|
- lib/get_leankit_board.rb
|
|
20
20
|
- lib/get_leankit_cards.rb
|
|
21
|
-
- lib/
|
|
21
|
+
- lib/get_leankit_cards_by_boardId.rb
|
|
22
22
|
- lib/leankit_connect.rb
|
|
23
23
|
homepage: https://rentpath.leankit.com/
|
|
24
24
|
licenses:
|
data/lib/get_leankit_tasks.rb
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
class GetLeankitTasks
|
|
2
|
-
class << self
|
|
3
|
-
|
|
4
|
-
def get(id)
|
|
5
|
-
|
|
6
|
-
response, status = get_json(id)
|
|
7
|
-
status == 200 ? response : errors(response,status)
|
|
8
|
-
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def errors(response,status)
|
|
12
|
-
$stderr.puts "Leankit connection failed response:#{response}, status:#{status}"
|
|
13
|
-
# rescue LoadError => e
|
|
14
|
-
# puts " this is EXPECTION #{e}"
|
|
15
|
-
# raise response
|
|
16
|
-
|
|
17
|
-
"failed response:#{response}, status:#{status}"
|
|
18
|
-
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def get_json(id)
|
|
22
|
-
url = "#{Settings.taskurl}#{id}/tasks"
|
|
23
|
-
uri = URI(url)
|
|
24
|
-
response = api.get(uri)
|
|
25
|
-
#[JSON.parse(response.body), response.status]
|
|
26
|
-
puts "STATUS==#{response.status}"
|
|
27
|
-
puts "BODY==#{response.body}"
|
|
28
|
-
puts "THIS IS SETTING== #{Settings.userid}, #{Settings.password}"
|
|
29
|
-
|
|
30
|
-
[response.body , response.status]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def api
|
|
34
|
-
begin
|
|
35
|
-
LeankitConnect.api
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|