leankit_connect 0.2

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5ad73fcd23150c0612e74c5f0144a0f785c9735e16a94ec87a4c3891c3852cf0
4
+ data.tar.gz: e6fd9ed9c8f1b6a69c4886e404942f212da1cbf0835794fab21bd51b4441fdd7
5
+ SHA512:
6
+ metadata.gz: 7268d755104ddff5ddefd6de30664a042d94a599eae8b4beed0eeab48c3fe62a0cbeeaedf2e1ede9dc984c74dffad27ffe970b98dc5e19a8cb8cc353f292ca94
7
+ data.tar.gz: 4a18c881f6f6def5709e23bce1df249bc487a1ced0d0c859eb5fb8027fb348eecafd2c83697de4773e1da45c96d9ed545476f0e1287d5feb70026eb4aa548345
@@ -0,0 +1,49 @@
1
+ class GetLeankitBoard
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
+
10
+
11
+ =begin
12
+ unless status == 200
13
+
14
+ puts "ERROR in the application #{status}"
15
+ #"@responseview = #{status}"
16
+ " #{response}, #{status}"
17
+ end
18
+ =end
19
+ end
20
+
21
+ def errors(response,status)
22
+ $stderr.puts "Leankit connection failed response:#{response}, status:#{status}"
23
+ # rescue LoadError => e
24
+ # puts " this is EXPECTION #{e}"
25
+ # raise response
26
+
27
+ "failed response:#{response}, status:#{status}"
28
+
29
+ end
30
+
31
+ def get_json(id)
32
+ url = "#{Settings.boardurl}#{id}"
33
+ uri = URI(url)
34
+ response = api.get(uri)
35
+ #[JSON.parse(response.body), response.status]
36
+ puts "STATUS==#{response.status}"
37
+ puts "BODY==#{response.body}"
38
+ puts "THIS IS SETTING== #{Settings.userid}, #{Settings.password}"
39
+
40
+ [response.body , response.status]
41
+ end
42
+
43
+ def api
44
+ begin
45
+ LeankitConnect.api
46
+ end
47
+ end
48
+ end
49
+ 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,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: leankit_connect
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ platform: ruby
6
+ authors:
7
+ - Asha
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-17 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This program connect to Leankit API
14
+ email: abangalore@rentpath.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/assets/get_leankit_board.rb
20
+ - lib/assets/leankit_connect.rb
21
+ homepage: https://rentpath.leankit.com/
22
+ licenses:
23
+ - Rentpath
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.7.3
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: LeankitConnectAPIs
45
+ test_files: []