relaton-cli 0.8.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton/bibcollection.rb +0 -1
- data/lib/relaton/bibdata.rb +1 -1
- data/lib/relaton/cli/_document.liquid +8 -8
- data/lib/relaton/cli/version.rb +1 -1
- data/lib/relaton/cli/xml_to_html_renderer.rb +14 -7
- data/relaton-cli.gemspec +7 -8
- data/templates/_document.liquid +6 -6
- data/templates/index-style.css +1 -1
- metadata +46 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06df07e066e1a948056b44297e588302b2638c6ccdcd51c3cdaabf08cae52d35
|
4
|
+
data.tar.gz: a4e4c343228b83d0cf8b275a774c829a878492a233777ca5c06d7b8f555ae2e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 109b7223d5bcd7984e1557420c57529647caf1667b30f0f371d63c7a25541dab840da76968e882e06b76bc2096a66566317634e51c3b540de7ef1ec92f696239
|
7
|
+
data.tar.gz: b69daf5854b6c0b484ebcfbfffe79932aede75fc8ed63221d8d2ded7cbf7bafcfc5144fe9e75ba5412a64cb2be548585041a8177ca38f4b5a82053902c4c6804
|
data/lib/relaton/bibdata.rb
CHANGED
@@ -8,16 +8,16 @@
|
|
8
8
|
<div class="doc-identifier">
|
9
9
|
<h{{ depth }}>
|
10
10
|
{% if document.html == "" %}
|
11
|
-
{{ document.
|
11
|
+
{{ document.docid.id }}
|
12
12
|
{% else %}
|
13
|
-
<a href="{{ document.html }}">{{ document.
|
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.
|
20
|
-
{{ document.
|
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">
|
data/lib/relaton/cli/version.rb
CHANGED
@@ -62,13 +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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
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
|
72
79
|
end
|
73
80
|
[key.to_s, empty2nil(v)]
|
74
81
|
end.to_h
|
data/relaton-cli.gemspec
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require "relaton/cli/version"
|
5
4
|
|
@@ -23,19 +22,19 @@ Gem::Specification.new do |spec|
|
|
23
22
|
spec.require_paths = ["lib"]
|
24
23
|
spec.required_ruby_version = ">= 2.4.0"
|
25
24
|
|
25
|
+
spec.add_development_dependency "byebug", "~> 10.0"
|
26
|
+
spec.add_development_dependency "debase"
|
27
|
+
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
28
|
+
spec.add_development_dependency "pry"
|
26
29
|
spec.add_development_dependency "rake", "~> 12.0"
|
27
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
-
spec.add_development_dependency "byebug", "~> 10.0"
|
29
31
|
spec.add_development_dependency "rspec-command", "~> 1.0.3"
|
30
|
-
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
31
32
|
spec.add_development_dependency "rspec-core", "~> 3.4"
|
32
|
-
spec.add_development_dependency "pry"
|
33
33
|
spec.add_development_dependency "ruby-debug-ide"
|
34
|
-
spec.add_development_dependency "debase"
|
35
34
|
spec.add_development_dependency "simplecov"
|
36
35
|
|
37
|
-
spec.add_runtime_dependency "relaton", "~> 0.10.0"
|
38
|
-
spec.add_runtime_dependency "thor"
|
39
36
|
spec.add_runtime_dependency "liquid"
|
37
|
+
spec.add_runtime_dependency "relaton", "~> 1.0.0"
|
38
|
+
spec.add_runtime_dependency "thor"
|
40
39
|
# spec.add_runtime_dependency 'byebug'
|
41
40
|
end
|
data/templates/_document.liquid
CHANGED
@@ -16,8 +16,8 @@
|
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<div class="doc-type-wrap">
|
19
|
-
<div class="doc-type {{ document.
|
20
|
-
{{ document.
|
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">
|
data/templates/index-style.css
CHANGED
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.
|
4
|
+
version: 1.0.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-
|
11
|
+
date: 2020-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: byebug
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
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: '
|
26
|
+
version: '10.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: debase
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
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: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: equivalent-xml
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
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: '
|
54
|
+
version: '0.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
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
|
82
|
+
version: '12.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
84
|
+
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
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.
|
96
|
+
version: '3.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rspec-command
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
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:
|
110
|
+
version: 1.0.3
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rspec-core
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
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: '
|
124
|
+
version: '3.4'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
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:
|
154
|
+
name: liquid
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 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
|
166
|
+
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: relaton
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 1.0.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:
|
180
|
+
version: 1.0.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
182
|
+
name: thor
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - ">="
|