relaton-cli 0.1.0 → 0.1.1

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: 955aa89130cdc27beb7c60651296accf1d6b4cc228ed8537ac918564ab24597b
4
- data.tar.gz: d2f35c792f49d76f473c38e342f8b9f0ad4556a327923cc8b07cfbddd61d6ab2
3
+ metadata.gz: 04d8382b4df126c9cf97b5023c57fe0a21baa72b49a7e1a5e0720e32d9605bc8
4
+ data.tar.gz: 763637577152158f00ad709ea9356971005bbf057e120c796d7c3a1869dc2471
5
5
  SHA512:
6
- metadata.gz: 87b103454be67f4133d7180d5a6833435af3fd08a0648a15d991cbcefbe0d6b0c2df95913fe0e91934113a9b2be750f5172d4444790ddcf7ac978316716af587
7
- data.tar.gz: 5ce899e400ccd55afc531f6213749a176c17c947812c6c2a33dcac9081329d7ad0ea3d14951246c877644f29ee65694909a6472de436237ad842e555bbb6a8a8
6
+ metadata.gz: 0e58eb85e22293f1b9a840a5084463c7d762c72b1ef49fc05d9cbb46b6f7f2e7bce03aeb1df167ac2980c9a770010bebb1377e0f53553b65aa05e791268c174c
7
+ data.tar.gz: 84276b69b1d35f12af984eaa0dfff7b8c6fdaf68572c156410ffe74e9d74753eb6725f8610a666b16b0e705177bb31afcbbe4a4c5cff8664ad852de0ddb70615
data/exe/relaton-xml-html CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  # Invoke as: ./relaton-doc FILENAME STYLESHEET RELATON-ROOT
3
4
  require "nokogiri"
4
5
  require "relaton/cli"
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) || item.is_a?(Bibdata)
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
@@ -1,6 +1,7 @@
1
+
1
2
  module Relaton
2
3
  class Bibdata
3
- attr_accessor *%i[
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)
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "0.1.0".freeze
3
+ VERSION = "0.1.1".freeze
4
4
  end
5
5
  end
@@ -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}/id/#{id_code}.xml") } do |a|
252
+ d2.a **{ href: URI.escape("#{relaton_root}/#{id_code}.xml") } do |a|
253
253
  a << "Relaton XML"
254
254
  end
255
255
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.