relaton-iso-bib 0.9.2 → 1.0.0
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/grammars/basicdoc.rng +12 -56
- data/grammars/biblio.rng +56 -18
- data/grammars/isodoc.rng +572 -28
- data/grammars/isostandard.rng +137 -472
- data/lib/relaton_iso_bib/version.rb +1 -1
- data/lib/relaton_iso_bib/xml_parser.rb +9 -17
- data/relaton_iso_bib.gemspec +3 -3
- metadata +4 -4
@@ -3,20 +3,6 @@ require "nokogiri"
|
|
3
3
|
module RelatonIsoBib
|
4
4
|
class XMLParser < RelatonBib::XMLParser
|
5
5
|
class << self
|
6
|
-
# Override RelatonBib::XMLParser.form_xml method.
|
7
|
-
# @param xml [String]
|
8
|
-
# @return [RelatonIsoBib::IsoBibliographicItem]
|
9
|
-
def from_xml(xml)
|
10
|
-
doc = Nokogiri::XML(xml)
|
11
|
-
doc.remove_namespaces!
|
12
|
-
isoitem = doc.at "/bibitem|/bibdata"
|
13
|
-
if isoitem
|
14
|
-
IsoBibliographicItem.new item_data(isoitem)
|
15
|
-
else
|
16
|
-
warn "[relato-iso-bib] can't find bibitem or bibdata element in the XML"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
6
|
private
|
21
7
|
|
22
8
|
# Override RelatonBib::XMLParser.item_data method.
|
@@ -34,6 +20,13 @@ module RelatonIsoBib
|
|
34
20
|
data
|
35
21
|
end
|
36
22
|
|
23
|
+
# override RelatonBib::BibliographicItem.bib_item method
|
24
|
+
# @param item_hash [Hash]
|
25
|
+
# @return [RelatonIsoBib::IsoBibliographicItem]
|
26
|
+
def bib_item(item_hash)
|
27
|
+
IsoBibliographicItem.new item_hash
|
28
|
+
end
|
29
|
+
|
37
30
|
# @param ext [Nokogiri::XML::Element]
|
38
31
|
# @return [RelatonIsoBib::StructuredIdentifier]
|
39
32
|
def fetch_structuredidentifier(ext)
|
@@ -77,9 +70,8 @@ module RelatonIsoBib
|
|
77
70
|
sc = eg&.xpath("subcommittee")&.map { |s| iso_subgroup(s) }
|
78
71
|
wg = eg&.xpath("workgroup")&.map { |w| iso_subgroup(w) }
|
79
72
|
sr = eg&.at "secretariat"
|
80
|
-
EditorialGroup.new(
|
81
|
-
|
82
|
-
)
|
73
|
+
EditorialGroup.new(technical_committee: tc, subcommittee: sc,
|
74
|
+
workgroup: wg, secretariat: sr&.text)
|
83
75
|
end
|
84
76
|
|
85
77
|
# @param com [Nokogiri::XML::Element]
|
data/relaton_iso_bib.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path("
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require "relaton_iso_bib/version"
|
6
6
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
# Specify which files should be added to the gem when it is released.
|
19
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
-
spec.files = Dir.chdir(File.expand_path(
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
21
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
22
|
end
|
23
23
|
spec.bindir = "exe"
|
@@ -35,5 +35,5 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency "simplecov"
|
36
36
|
|
37
37
|
spec.add_dependency "isoics", "~> 0.1.6"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 0.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.0.0"
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iso-bib
|
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-04-
|
11
|
+
date: 2020-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 1.0.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 1.0.0
|
153
153
|
description: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
|
154
154
|
email:
|
155
155
|
- open.source@ribose.com
|