relaton-cli 0.8.2 → 0.8.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: 9da6c727a7b4f3bc908bfdf55bd193031658692f31bcf9696dab25e304a46049
4
- data.tar.gz: a0f8aca569ff13335574f9580544ac275a9a9f465c311c66d6bf2d4121da4884
3
+ metadata.gz: f9ef325f58cbd1c5b987d475ecfc30db467eb859e81b6bd8e8ea8de88653a12b
4
+ data.tar.gz: 7288906a83d3c57a3e8c3cc9812a99ccd5fd4f46df08dbde3da79ac8d19737dc
5
5
  SHA512:
6
- metadata.gz: '08e5e8e13d9734b8f9e0fcbed5f7e541128f73cc65435fb819256be0658601caff498c3bb72a1be77288956bd434ab08c433c09c094961f435544bd14fe7424a'
7
- data.tar.gz: '01469ce2191c15337a194f0945486d2994d63c93dd5789f7e5673d8ba910c314e887792e99def4e346c8a75c63acd1ae44525bf4571acecadac663c548cd6901'
6
+ metadata.gz: a1ec9ae007dbed7d763af7d7359771ef65ddb968acde5fd7e835b2f52909b399b31f5afdeb50e61b8146b602f043403160acec6268a22207df32336ac316d351
7
+ data.tar.gz: f3570c164895b873e37e41c65679ae4ea7ea0ddbf1dc452d6513e66dbb3c2067d463e4f9f14950470d755968fd3f223767d3071ab512749799c3ba6a0abf36b1
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "0.8.2".freeze
3
+ VERSION = "0.8.3".freeze
4
4
  end
5
5
  end
@@ -61,7 +61,15 @@ module Relaton::Cli
61
61
 
62
62
  # TODO: This should be recursive, but it's not
63
63
  def hash_to_liquid(hash)
64
- hash.map { |key, value| [key.to_s, empty2nil(value)] }.to_h
64
+ hash.map do |key, value|
65
+ if key == "title" && value.is_a?(Array)
66
+ title = value.detect { |t| t["type"] == "main" } || value.first
67
+ v = title ? title["content"] : nil
68
+ else
69
+ v = value
70
+ end
71
+ [key.to_s, empty2nil(v)]
72
+ end.to_h
65
73
  end
66
74
 
67
75
  def empty2nil(value)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake