klaro-client 0.4.2 → 0.4.3
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/resource/story.rb +3 -3
- data/lib/klaro/client/support/md_text.rb +17 -6
- data/lib/klaro/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c99d22b17ba2b1fec0e6d5a431e62bedb02975235412664aab41e7b820e4568
|
4
|
+
data.tar.gz: '08b2a568aa7a590fa5424399e02573c15af4809e64a71432c2b12283b0d8d0ad'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c31ae21e22413d7f6109fcc18ddce898101a440c98c69cab705c021444647116025a336e108a1caf2b19b7bc8e181f8177749a5e63f7754f9ac1608794a01bc
|
7
|
+
data.tar.gz: 48a49aa2448c7064696d79075b64e7a682caa33ea884287a957f4e5ed2a9f98b5506da9b3ff02063db71af6e2652d2c179270df1227c6d2d0fe5c501a9ad3770
|
@@ -3,15 +3,15 @@ module Klaro
|
|
3
3
|
class Story < Resource
|
4
4
|
|
5
5
|
def title
|
6
|
-
@title ||= MdText.new(self.description.split("\n").first)
|
6
|
+
@title ||= MdText.new(self.description.split("\n").first, :summary)
|
7
7
|
end
|
8
8
|
|
9
9
|
def summary
|
10
|
-
@summary ||= MdText.new(self.description.split("\n")[1..-1].join("\n"))
|
10
|
+
@summary ||= MdText.new(self.description.split("\n")[1..-1].join("\n"), :summary)
|
11
11
|
end
|
12
12
|
|
13
13
|
def specification
|
14
|
-
@specification ||= MdText.new(super)
|
14
|
+
@specification ||= MdText.new(super, :details)
|
15
15
|
end
|
16
16
|
alias :details :specification
|
17
17
|
|
@@ -2,19 +2,30 @@ module Klaro
|
|
2
2
|
class Client
|
3
3
|
class MdText
|
4
4
|
|
5
|
-
|
5
|
+
SHARED_OPTIONS = {
|
6
6
|
filter_html: true,
|
7
|
-
hard_wrap: true,
|
8
7
|
no_links: false,
|
9
8
|
no_styles: true,
|
10
9
|
safe_links_only: true,
|
11
10
|
with_toc_data: false
|
12
|
-
}
|
11
|
+
}
|
13
12
|
|
14
|
-
|
13
|
+
VARIANTS = {
|
14
|
+
:summary => Redcarpet::Markdown.new(
|
15
|
+
Redcarpet::Render::HTML.new(SHARED_OPTIONS.merge({
|
16
|
+
hard_wrap: true,
|
17
|
+
}))
|
18
|
+
),
|
19
|
+
:details => Redcarpet::Markdown.new(
|
20
|
+
Redcarpet::Render::HTML.new(SHARED_OPTIONS.merge({
|
21
|
+
hard_wrap: false,
|
22
|
+
}))
|
23
|
+
)
|
24
|
+
}
|
15
25
|
|
16
|
-
def initialize(src)
|
26
|
+
def initialize(src, variant)
|
17
27
|
@src = src
|
28
|
+
@renderer = VARIANTS[variant]
|
18
29
|
end
|
19
30
|
|
20
31
|
def to_s
|
@@ -22,7 +33,7 @@ module Klaro
|
|
22
33
|
end
|
23
34
|
|
24
35
|
def to_html
|
25
|
-
|
36
|
+
@renderer.render(to_s).strip
|
26
37
|
end
|
27
38
|
|
28
39
|
end # class MdText
|
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.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- enspirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|