klaro-client 0.5.2 → 0.5.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/klaro/client.rb +4 -0
- data/lib/klaro/client/request_handler.rb +17 -7
- data/lib/klaro/client/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f20df5ac528c8af7480b9b108e1ecc0e6e173b6dac506d7d2236407f8ecc2f90
|
4
|
+
data.tar.gz: ebd98f26c88b52072c9c4428a3b40c38aa006cce30f2a65570288fb8def60334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e069f401a3c7181d956ccd8fed1135f2512275bbfd0e1f6322851c41c2171b3f5944485dbba5fc3326dd616ced29fa25debfc8a214dcb5e54d2d61be18b874e
|
7
|
+
data.tar.gz: 32069d79b9ab8e4979172f0ebdfcf4c1947aa600e374340aab8fc1139aa0aae1055f102bf4dae130ed70da93534b37a8d1c6da90465386af216f9adb0ff21474
|
data/lib/klaro/client.rb
CHANGED
@@ -6,8 +6,9 @@ module Klaro
|
|
6
6
|
attr_reader :base_url, :token
|
7
7
|
|
8
8
|
def initialize(url)
|
9
|
-
@base_url = url
|
9
|
+
@base_url = url.gsub(/\/api\/?$/, "")
|
10
10
|
@token = nil
|
11
|
+
@subdomain = nil
|
11
12
|
end
|
12
13
|
|
13
14
|
def authenticated?
|
@@ -19,6 +20,11 @@ module Klaro
|
|
19
20
|
self
|
20
21
|
end
|
21
22
|
|
23
|
+
def with_project(subdomain)
|
24
|
+
@subdomain = subdomain
|
25
|
+
self
|
26
|
+
end
|
27
|
+
|
22
28
|
def authenticate(user, password)
|
23
29
|
@token = get_token Http
|
24
30
|
.headers({
|
@@ -65,12 +71,16 @@ module Klaro
|
|
65
71
|
end
|
66
72
|
|
67
73
|
def http
|
68
|
-
Http.headers(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
+
Http.headers(http_headers)
|
75
|
+
end
|
76
|
+
|
77
|
+
def http_headers
|
78
|
+
hs = {
|
79
|
+
"Authorization" => @token,
|
80
|
+
"Content-Type" => "application/json"
|
81
|
+
}
|
82
|
+
hs['Klaro-Project-Subdomain'] = @subdomain if @subdomain
|
83
|
+
hs
|
74
84
|
end
|
75
85
|
|
76
86
|
def info(msg)
|
data/lib/klaro/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klaro-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- enspirit
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-05-07 00:00:00.000000000 Z
|
@@ -108,8 +108,8 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.7'
|
111
|
-
description:
|
112
|
-
email:
|
111
|
+
description:
|
112
|
+
email:
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
@@ -129,11 +129,11 @@ files:
|
|
129
129
|
- lib/klaro/client/resource/story.rb
|
130
130
|
- lib/klaro/client/support/md_text.rb
|
131
131
|
- lib/klaro/client/version.rb
|
132
|
-
homepage:
|
132
|
+
homepage:
|
133
133
|
licenses:
|
134
134
|
- MIT
|
135
135
|
metadata: {}
|
136
|
-
post_install_message:
|
136
|
+
post_install_message:
|
137
137
|
rdoc_options: []
|
138
138
|
require_paths:
|
139
139
|
- lib
|
@@ -148,8 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
152
|
-
signing_key:
|
151
|
+
rubygems_version: 3.0.8
|
152
|
+
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Klaro Client
|
155
155
|
test_files: []
|