rentpath_leankit 0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3ddc164c3024f0cc5c99491a308512d9ea1808584ff6db838c1bb724aa40d87b
4
+ data.tar.gz: 9985c9173964adff2a917fcaf511f31f690f12d81f01b1770b4d5609db453ea5
5
+ SHA512:
6
+ metadata.gz: 567d98a11246861453df57cc289229433c6cc3e748bc7f61651558d59ec42876894abd29bfa36bc9d5381a80f432ccee7327dd211bfe13f504fa8440dafb86f6
7
+ data.tar.gz: 48ff73b4879c2c1ef4e4da35f56dc14399f18b60dd20cdd121c8cf596b131bcce976bc5d01e127338303c62b601891dc9f7062b737c6c16550d5272791a18ea9
@@ -0,0 +1,40 @@
1
+
2
+ class GetLeankitBoard
3
+ class << self
4
+
5
+ def get(id)
6
+
7
+ response, status = get_json(id)
8
+ status == 200 ? response : errors(response,status)
9
+ [response ,status]
10
+ end
11
+
12
+ def errors(response,status)
13
+ $stderr.puts "Leankit connection failed response:#{response}, status:#{status}"
14
+ # rescue LoadError => e
15
+ # puts " this is EXPECTION #{e}"
16
+ # raise response
17
+
18
+ "failed response:#{response}, status:#{status}"
19
+
20
+ end
21
+
22
+ def get_json(id)
23
+ url = "#{Settings.boardurl}#{id}"
24
+ uri = URI(url)
25
+ response = api.get(uri)
26
+ #[JSON.parse(response.body), response.status]
27
+ puts "STATUS==#{response.status}"
28
+ puts "BODY==#{response.body}"
29
+ puts "THIS IS SETTING== #{Settings.userid}, #{Settings.password}"
30
+
31
+ [response.body , response.status]
32
+ end
33
+
34
+ def api
35
+ begin
36
+ LeankitConnect.api
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,39 @@
1
+ class GetLeankitCards
2
+ class << self
3
+
4
+ def get(id)
5
+
6
+ response, status = get_json(id)
7
+ status == 200 ? response : errors(response,status)
8
+ [response ,status]
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.cardurl}#{id}"
23
+ uri = URI(url)
24
+ 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]
31
+ end
32
+
33
+ def api
34
+ begin
35
+ LeankitConnect.api
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,39 @@
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
@@ -0,0 +1,15 @@
1
+ require 'faraday'
2
+ require 'json'
3
+
4
+ class LeankitConnect
5
+
6
+ def self.api
7
+ Faraday.new(url: "#{Settings.LEANKITURL}") do |conn|
8
+ conn.response :logger
9
+ conn.adapter Faraday.default_adapter
10
+ conn.headers['Content-Type'] = 'application/json; charset=utf-8'
11
+ conn.basic_auth("#{Settings.userid}","#{Settings.password}")
12
+ #conn.token_auth('bearer11230e5ae75b4c0b68c554a2109a230423889073a3de22f58425c44f39cff301597b1fb63e4724486806da5e7e1db33d4f178d0b6b4792b592b08fe6103161a4')
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rentpath_leankit
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Asha
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This program connect to Leankit and pull the data by using APIs
14
+ email: abangalore@rentpath.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/get_leankit_board.rb
20
+ - lib/get_leankit_cards.rb
21
+ - lib/get_leankit_tasks.rb
22
+ - lib/leankit_connect.rb
23
+ homepage: https://rentpath.leankit.com/
24
+ licenses:
25
+ - Rentpath
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.7.3
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: LeankitAPIs
47
+ test_files: []