relaton-cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/relaton-xml-html +1 -0
- data/exe/relaton-yaml-xml +2 -1
- data/lib/relaton/bibcollection.rb +7 -4
- data/lib/relaton/bibdata.rb +4 -1
- data/lib/relaton/cli/version.rb +1 -1
- data/lib/relaton/cli/xml_to_html_renderer.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04d8382b4df126c9cf97b5023c57fe0a21baa72b49a7e1a5e0720e32d9605bc8
|
4
|
+
data.tar.gz: 763637577152158f00ad709ea9356971005bbf057e120c796d7c3a1869dc2471
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e58eb85e22293f1b9a840a5084463c7d762c72b1ef49fc05d9cbb46b6f7f2e7bce03aeb1df167ac2980c9a770010bebb1377e0f53553b65aa05e791268c174c
|
7
|
+
data.tar.gz: 84276b69b1d35f12af984eaa0dfff7b8c6fdaf68572c156410ffe74e9d74753eb6725f8610a666b16b0e705177bb31afcbbe4a4c5cff8664ad852de0ddb70615
|
data/exe/relaton-xml-html
CHANGED
data/exe/relaton-yaml-xml
CHANGED
@@ -5,6 +5,7 @@ require "optparse"
|
|
5
5
|
# require "metanorma"
|
6
6
|
# require "byebug"
|
7
7
|
require "fileutils"
|
8
|
+
require "relaton/cli"
|
8
9
|
|
9
10
|
|
10
11
|
options = {}
|
@@ -48,7 +49,7 @@ if options[:require]
|
|
48
49
|
end
|
49
50
|
|
50
51
|
index_input = YAML.load_file(options[:filename])
|
51
|
-
index_collection = Bibcollection.new(index_input["root"])
|
52
|
+
index_collection = ::Relaton::Bibcollection.new(index_input["root"])
|
52
53
|
|
53
54
|
# TODO real lookup of namespaces and root elements
|
54
55
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
module Relaton
|
2
3
|
class Bibcollection
|
3
4
|
ATTRIBS = %i[
|
@@ -22,7 +23,9 @@ module Relaton
|
|
22
23
|
|
23
24
|
# puts items.inspect
|
24
25
|
self.items = self.items.inject([]) do |acc,item|
|
25
|
-
acc << if item.is_a?(Bibcollection) ||
|
26
|
+
acc << if item.is_a?(::Relaton::Bibcollection) ||
|
27
|
+
item.is_a?(::Relaton::Bibdata)
|
28
|
+
|
26
29
|
item
|
27
30
|
else
|
28
31
|
# puts "item.inspect #{item.inspect}"
|
@@ -36,16 +39,16 @@ module Relaton
|
|
36
39
|
|
37
40
|
def new_bib_item_class(options)
|
38
41
|
if options["items"]
|
39
|
-
Bibcollection.new(options)
|
42
|
+
::Relaton::Bibcollection.new(options)
|
40
43
|
else
|
41
|
-
Bibdata.new(options)
|
44
|
+
::Relaton::Bibdata.new(options)
|
42
45
|
end
|
43
46
|
end
|
44
47
|
|
45
48
|
def items_flattened
|
46
49
|
|
47
50
|
items.inject([]) do |acc,item|
|
48
|
-
if item.is_a? Bibcollection
|
51
|
+
if item.is_a? ::Relaton::Bibcollection
|
49
52
|
acc << item.items_flattened
|
50
53
|
else
|
51
54
|
acc << item
|
data/lib/relaton/bibdata.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
|
1
2
|
module Relaton
|
2
3
|
class Bibdata
|
3
|
-
|
4
|
+
ATTRIBS = %i[
|
4
5
|
docid
|
5
6
|
doctype
|
6
7
|
title
|
@@ -12,6 +13,8 @@ module Relaton
|
|
12
13
|
technical_committee
|
13
14
|
]
|
14
15
|
|
16
|
+
attr_accessor *ATTRIBS
|
17
|
+
|
15
18
|
def initialize(options)
|
16
19
|
options.each_pair do |k,v|
|
17
20
|
send("#{k.to_s}=", v)
|
data/lib/relaton/cli/version.rb
CHANGED
@@ -249,7 +249,7 @@ module Relaton::Cli
|
|
249
249
|
if id
|
250
250
|
d.div **{ class: "doc-bib" } do |d1|
|
251
251
|
d1.div **{ class: "doc-bib-relaton" } do |d2|
|
252
|
-
d2.a **{ href: URI.escape("#{relaton_root}
|
252
|
+
d2.a **{ href: URI.escape("#{relaton_root}/#{id_code}.xml") } do |a|
|
253
253
|
a << "Relaton XML"
|
254
254
|
end
|
255
255
|
end
|