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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54667fabd1bba720bee0b48f06b3b458848d4a6c89fc2a0555885fa6212dca97
4
- data.tar.gz: e0d420d06f919d06a33ed4ab4320bb694a44000f938e084027c215b232a9f6a7
3
+ metadata.gz: 6c99d22b17ba2b1fec0e6d5a431e62bedb02975235412664aab41e7b820e4568
4
+ data.tar.gz: '08b2a568aa7a590fa5424399e02573c15af4809e64a71432c2b12283b0d8d0ad'
5
5
  SHA512:
6
- metadata.gz: 7eae47d9090069b8e31e1bd727572efe05573ad60f01bc18ee69658b493c91b5f399b807789ca5fd9b1982aba2e467a69dbbf5f94ff49000d228fc91cf46c2c8
7
- data.tar.gz: 106659a3ca72d394e31b1fa6e56e7d60b807f9e95d3e58147f9d963d30d178efe3afc0934ebc82f13f13efbc2756961791de87845bcf0e480944efcede357ed0
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
- RENDERER = Redcarpet::Render::HTML.new({
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
- MARKDOWN = Redcarpet::Markdown.new(RENDERER)
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
- MARKDOWN.render(to_s).strip
36
+ @renderer.render(to_s).strip
26
37
  end
27
38
 
28
39
  end # class MdText
@@ -3,7 +3,7 @@ module Klaro
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- TINY = 2
6
+ TINY = 3
7
7
  end
8
8
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
9
9
  end # class Client
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.2
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-07 00:00:00.000000000 Z
11
+ date: 2020-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv