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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0916d1d6fef45c2de0f3d48059ac096c8999968f07932501958b8a1a19fd69
4
- data.tar.gz: 48f4cd861c5b449a15a8752237ccef556a2213e7c7e5676c97eb53350668d53a
3
+ metadata.gz: 06df07e066e1a948056b44297e588302b2638c6ccdcd51c3cdaabf08cae52d35
4
+ data.tar.gz: a4e4c343228b83d0cf8b275a774c829a878492a233777ca5c06d7b8f555ae2e8
5
5
  SHA512:
6
- metadata.gz: b0bdbb4bcf160f3360e7c336fe68ec02d30f5ed23caef2ad94f1cfc08725b61b6774eaba5cd7f10fb3630c4cbe1b99bcec1268ac603d4b38106003652d72c351
7
- data.tar.gz: 1ae1189d0e97dac1d1d46c567b16f45dd0a3493fc15437812840a1ea3fac06cf163f504431a421f21760f1dd19bce9f1fc9c857504c5e1d21985ce39447ac607
6
+ metadata.gz: 109b7223d5bcd7984e1557420c57529647caf1667b30f0f371d63c7a25541dab840da76968e882e06b76bc2096a66566317634e51c3b540de7ef1ec92f696239
7
+ data.tar.gz: b69daf5854b6c0b484ebcfbfffe79932aede75fc8ed63221d8d2ded7cbf7bafcfc5144fe9e75ba5412a64cb2be548585041a8177ca38f4b5a82053902c4c6804
@@ -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.4".freeze
3
+ VERSION = "1.0.0".freeze
4
4
  end
5
5
  end
@@ -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
- if key == "title" && value.is_a?(Array)
66
- title = value.detect { |t| t["type"] == "main" } || value.first
67
- v = title ? title["content"] : nil
68
- elsif key == "title" && value.is_a?(Hash)
69
- v = value["content"]
70
- else
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
@@ -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.4
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-03-09 00:00:00.000000000 Z
11
+ date: 2020-04-25 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: 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: '0'
180
+ version: 1.0.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
  - - ">="