relaton-cli 0.8.3 → 0.9.0

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: f9ef325f58cbd1c5b987d475ecfc30db467eb859e81b6bd8e8ea8de88653a12b
4
- data.tar.gz: 7288906a83d3c57a3e8c3cc9812a99ccd5fd4f46df08dbde3da79ac8d19737dc
3
+ metadata.gz: 2b5ed5ee23cfdb909f597d54b0b79588eb229f4ec3801f77b4a5eafc9da583fb
4
+ data.tar.gz: 1410ee321bd05dfe6263e89f35835b748724dc4a209d95404b2aa7205a7f5719
5
5
  SHA512:
6
- metadata.gz: a1ec9ae007dbed7d763af7d7359771ef65ddb968acde5fd7e835b2f52909b399b31f5afdeb50e61b8146b602f043403160acec6268a22207df32336ac316d351
7
- data.tar.gz: f3570c164895b873e37e41c65679ae4ea7ea0ddbf1dc452d6513e66dbb3c2067d463e4f9f14950470d755968fd3f223767d3071ab512749799c3ba6a0abf36b1
6
+ metadata.gz: a3199375c9004358be4ebde9be0595c6aa4230e33d5f67aefb22583035d429a385c38a2e8088ddebf617d6cad7b3cf14b95c3609fddd25bd104410ce28a23f2a
7
+ data.tar.gz: f4372b8f7b815999d897d9706e77a86d86b728c0e86eef671f4c54fa4b007875a3a0ef9f96c31820814907d3b723b7b904e67f87e53e8fefdb66e6fa11118c97
@@ -111,6 +111,5 @@ module Relaton
111
111
 
112
112
  { "root" => a }
113
113
  end
114
-
115
114
  end
116
115
  end
@@ -61,7 +61,7 @@ module Relaton
61
61
  end
62
62
 
63
63
  def to_h
64
- URL_TYPES.reduce(@bibitem.to_hash) do |h, t|
64
+ URL_TYPES.reduce({ items: [] }.merge(@bibitem.to_hash)) do |h, t|
65
65
  value = self.send t
66
66
  h[t.to_s] = value
67
67
  h
@@ -8,16 +8,16 @@
8
8
  <div class="doc-identifier">
9
9
  <h{{ depth }}>
10
10
  {% if document.html == "" %}
11
- {{ document.docidentifier }}
11
+ {{ document.docid.id }}
12
12
  {% else %}
13
- <a href="{{ document.html }}">{{ document.docidentifier }}</a>
13
+ <a href="{{ document.html }}">{{ document.docid.id }}</a>
14
14
  {% endif %}
15
15
  </h{{ depth }}>
16
16
  </div>
17
17
 
18
18
  <div class="doc-type-wrap">
19
- <div class="doc-type {{ document.doctype | downcase | split: " " | join: "-" }}">
20
- {{ document.doctype }}
19
+ <div class="doc-type {{ document.type | downcase | split: " " | join: "-" }}">
20
+ {{ document.type }}
21
21
  </div>
22
22
  </div>
23
23
  </div>
@@ -32,12 +32,12 @@
32
32
  </h{{ depth | plus: 1 }}>
33
33
  </div>
34
34
 
35
- <div class="doc-info {{ document.stage | downcase }}">
36
- <div class="doc-stage {{ document.stage | downcase }}">
37
- {{ document.stage }}
35
+ <div class="doc-info {{ document.docstatus.stage | downcase }}">
36
+ <div class="doc-stage {{ document.docstatus.stage | downcase }}">
37
+ {{ document.docstatus.stage }}
38
38
  </div>
39
39
  <div class="doc-dates">
40
- {% unless document.stage == "published" %}
40
+ {% unless document.docstatus.stage == "published" %}
41
41
  <div class="doc-updated">
42
42
  {% else %}
43
43
  <div class="doc-published">
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "0.8.3".freeze
3
+ VERSION = "0.9.0".freeze
4
4
  end
5
5
  end
@@ -62,11 +62,20 @@ module Relaton::Cli
62
62
  # TODO: This should be recursive, but it's not
63
63
  def hash_to_liquid(hash)
64
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
65
+ case key
66
+ when "title"
67
+ if value.is_a?(Array)
68
+ title = value.detect { |t| t["type"] == "main" } || value.first
69
+ v = title ? title["content"] : nil
70
+ elsif value.is_a?(Hash) then v = value["content"]
71
+ else v = value
72
+ end
73
+ when "docid"
74
+ if value.is_a?(Array)
75
+ v = value.detect { |did| did["id"] !~ /^(http|https):\/\// } || value.first
76
+ else v = value
77
+ end
78
+ else v = value
70
79
  end
71
80
  [key.to_s, empty2nil(v)]
72
81
  end.to_h
data/relaton-cli.gemspec CHANGED
@@ -23,19 +23,19 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
  spec.required_ruby_version = ">= 2.4.0"
25
25
 
26
+ spec.add_development_dependency "byebug", "~> 10.0"
27
+ spec.add_development_dependency "debase"
28
+ spec.add_development_dependency "equivalent-xml", "~> 0.6"
29
+ spec.add_development_dependency "pry"
26
30
  spec.add_development_dependency "rake", "~> 12.0"
27
31
  spec.add_development_dependency "rspec", "~> 3.0"
28
- spec.add_development_dependency "byebug", "~> 10.0"
29
32
  spec.add_development_dependency "rspec-command", "~> 1.0.3"
30
- spec.add_development_dependency "equivalent-xml", "~> 0.6"
31
33
  spec.add_development_dependency "rspec-core", "~> 3.4"
32
- spec.add_development_dependency "pry"
33
34
  spec.add_development_dependency "ruby-debug-ide"
34
- spec.add_development_dependency "debase"
35
35
  spec.add_development_dependency "simplecov"
36
36
 
37
- spec.add_runtime_dependency "relaton", "~> 0.10.0"
38
- spec.add_runtime_dependency "thor"
39
37
  spec.add_runtime_dependency "liquid"
38
+ spec.add_runtime_dependency "relaton", "~> 0.11.0"
39
+ spec.add_runtime_dependency "thor"
40
40
  # spec.add_runtime_dependency 'byebug'
41
41
  end
@@ -16,8 +16,8 @@
16
16
  </div>
17
17
 
18
18
  <div class="doc-type-wrap">
19
- <div class="doc-type {{ document.doctype | downcase | split: " " | join: "-" }}">
20
- {{ document.doctype }}
19
+ <div class="doc-type {{ document.type | downcase | split: " " | join: "-" }}">
20
+ {{ document.type }}
21
21
  </div>
22
22
  </div>
23
23
  </div>
@@ -32,12 +32,12 @@
32
32
  </h{{ depth | plus: 1 }}>
33
33
  </div>
34
34
 
35
- <div class="doc-info {{ document.stage | downcase }}">
36
- <div class="doc-stage {{ document.stage | downcase }}">
37
- {{ document.stage }}
35
+ <div class="doc-info {{ document.docstatus.stage | downcase }}">
36
+ <div class="doc-stage {{ document.docstatus.stage | downcase }}">
37
+ {{ document.docstatus.stage }}
38
38
  </div>
39
39
  <div class="doc-dates">
40
- {% unless document.stage == "published" %}
40
+ {% unless document.docstatus.stage == "published" %}
41
41
  <div class="doc-updated">
42
42
  {% else %}
43
43
  <div class="doc-published">
@@ -757,7 +757,7 @@ body.container {
757
757
  }
758
758
 
759
759
  .doc-line {
760
- padding-top: 1em;
760
+ padding-top: 2em;
761
761
  }
762
762
 
763
763
  .doc-line:after {
metadata CHANGED
@@ -1,129 +1,129 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
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-06 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: byebug
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '12.0'
19
+ version: '10.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '12.0'
26
+ version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: debase
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: byebug
42
+ name: equivalent-xml
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '0.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '0.6'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec-command
56
+ name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.3
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.3
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: equivalent-xml
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.6'
75
+ version: '12.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.6'
82
+ version: '12.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec-core
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.4'
89
+ version: '3.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.4'
96
+ version: '3.0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: pry
98
+ name: rspec-command
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.0.3
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 1.0.3
111
111
  - !ruby/object:Gem::Dependency
112
- name: ruby-debug-ide
112
+ name: rspec-core
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '3.4'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '3.4'
125
125
  - !ruby/object:Gem::Dependency
126
- name: debase
126
+ name: ruby-debug-ide
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -151,35 +151,35 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: relaton
154
+ name: liquid
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.10.0
159
+ version: '0'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 0.10.0
166
+ version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: thor
168
+ name: relaton
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: 0.11.0
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: 0.11.0
181
181
  - !ruby/object:Gem::Dependency
182
- name: liquid
182
+ name: thor
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="