klaro-client 0.5.1 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/klaro/client/request_handler.rb +11 -6
- data/lib/klaro/client/resource/story.rb +12 -6
- data/lib/klaro/client/version.rb +1 -1
- metadata +5 -12
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e82871ec2a932573304a87dd1b95d3c8cd0a3bcbbc3716f9e5cc078f2cebb50
|
4
|
+
data.tar.gz: b26f00ca41e2d1d0e1efa7b2cee647e085b58f5752c8661c978ed48994f5080d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd41f3a9b4883e60b8aa21b4503f49b7007a7d4e89f7c7d9d90e2a2ae852ab73587290cd8258a2e886f3e90d5eacbcc0008636beadfa73fd7e4d8b6ea0bc1766
|
7
|
+
data.tar.gz: 726d3e81ead2cab64c9fcea8debfb4c63e52638ced761278f303a9ee0c67789e3a1311d0085113f7cc4e28074f882738e2687ccc266bb4a596d3da4b3479182e
|
@@ -9,6 +9,7 @@ module Klaro
|
|
9
9
|
@base_url = url.gsub(/\/api\/?$/, "")
|
10
10
|
@token = nil
|
11
11
|
@subdomain = nil
|
12
|
+
@workspace = nil
|
12
13
|
end
|
13
14
|
|
14
15
|
def authenticated?
|
@@ -25,12 +26,15 @@ module Klaro
|
|
25
26
|
self
|
26
27
|
end
|
27
28
|
|
28
|
-
def authenticate(user, password)
|
29
|
-
@
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
def authenticate(user, password, workspace = nil)
|
30
|
+
@workspace = workspace
|
31
|
+
@token = get_token(
|
32
|
+
Http
|
33
|
+
.headers({
|
34
|
+
'Content-Type' => 'application/json'
|
35
|
+
})
|
36
|
+
.post("#{base_url}/api/auth/tokens/", payload(user, password))
|
37
|
+
)
|
34
38
|
end
|
35
39
|
|
36
40
|
def get(endpoint, raw = false)
|
@@ -80,6 +84,7 @@ module Klaro
|
|
80
84
|
"Content-Type" => "application/json"
|
81
85
|
}
|
82
86
|
hs['Klaro-Project-Subdomain'] = @subdomain if @subdomain
|
87
|
+
hs['X-Klaro-ViewAs'] = @workspace if @workspace
|
83
88
|
hs
|
84
89
|
end
|
85
90
|
|
@@ -2,18 +2,23 @@ module Klaro
|
|
2
2
|
class Client
|
3
3
|
class Story < Resource
|
4
4
|
|
5
|
+
def _title
|
6
|
+
self[:title] || self[:description]
|
7
|
+
end
|
8
|
+
|
5
9
|
def title
|
6
|
-
@title ||= MdText.new(self.
|
10
|
+
@title ||= MdText.new(self._title.split("\n").first, :summary)
|
7
11
|
end
|
8
12
|
|
9
13
|
def summary
|
10
|
-
@summary ||= MdText.new(self.
|
14
|
+
@summary ||= MdText.new(self._title.split("\n")[1..-1].join("\n"), :summary)
|
11
15
|
end
|
12
16
|
|
13
|
-
def
|
14
|
-
|
17
|
+
def details
|
18
|
+
details = self[:details] || self[:specification]
|
19
|
+
@specification ||= MdText.new(details, :details)
|
15
20
|
end
|
16
|
-
alias :
|
21
|
+
alias :specification :details
|
17
22
|
|
18
23
|
def linked_cards
|
19
24
|
@linked_cards ||= (self.linked || []).map{|s| Story.dress(s, @client) }
|
@@ -42,7 +47,8 @@ module Klaro
|
|
42
47
|
url = attachment.url
|
43
48
|
url += "?n=" + URI.encode_www_form_component(attachment.filename) unless url =~ /\?n=/
|
44
49
|
path = handle_image(url, root_path, target_folder, client)
|
45
|
-
attachment.
|
50
|
+
attachment.url = path
|
51
|
+
attachment
|
46
52
|
end
|
47
53
|
self.class.dress(self.to_h.merge(
|
48
54
|
attachments: as
|
data/lib/klaro/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- enspirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -44,20 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '3.4'
|
47
|
+
version: 3.5.1
|
51
48
|
type: :runtime
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
54
51
|
requirements:
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '3.4'
|
54
|
+
version: 3.5.1
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: i18n
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +116,6 @@ extra_rdoc_files: []
|
|
122
116
|
files:
|
123
117
|
- Gemfile
|
124
118
|
- Rakefile
|
125
|
-
- VERSION
|
126
119
|
- lib/klaro/client.rb
|
127
120
|
- lib/klaro/client/errors.rb
|
128
121
|
- lib/klaro/client/request_handler.rb
|
@@ -155,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
148
|
- !ruby/object:Gem::Version
|
156
149
|
version: '0'
|
157
150
|
requirements: []
|
158
|
-
rubygems_version: 3.1.
|
151
|
+
rubygems_version: 3.1.6
|
159
152
|
signing_key:
|
160
153
|
specification_version: 4
|
161
154
|
summary: Klaro Client
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.3.0
|