relaton-ecma 1.12.0 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +0 -1
- data/.github/workflows/release.yml +22 -0
- data/Gemfile +1 -1
- data/README.adoc +23 -37
- data/grammars/basicdoc.rng +3 -27
- data/grammars/biblio-standoc.rng +164 -0
- data/grammars/biblio.rng +90 -24
- data/grammars/relaton-ecma-compile.rng +11 -0
- data/grammars/relaton-ecma.rng +4 -0
- data/lib/relaton_ecma/bibliographic_item.rb +12 -0
- data/lib/relaton_ecma/ecma_bibliography.rb +1 -1
- data/lib/relaton_ecma/hash_converter.rb +11 -0
- data/lib/relaton_ecma/processor.rb +5 -5
- data/lib/relaton_ecma/scrapper.rb +4 -2
- data/lib/relaton_ecma/version.rb +1 -1
- data/lib/relaton_ecma/xml_parser.rb +13 -0
- data/lib/relaton_ecma.rb +3 -0
- data/relaton_ecma.gemspec +1 -1
- metadata +11 -6
- data/grammars/isodoc.rng +0 -2781
- data/grammars/reqt.rng +0 -223
@@ -12,21 +12,21 @@ module RelatonEcma
|
|
12
12
|
# @param code [String]
|
13
13
|
# @param date [String, NilClass] year
|
14
14
|
# @param opts [Hash]
|
15
|
-
# @return [
|
15
|
+
# @return [RelatonEcma::BibliographicItem]
|
16
16
|
def get(code, date, opts)
|
17
17
|
::RelatonEcma::EcmaBibliography.get(code, date, opts)
|
18
18
|
end
|
19
19
|
|
20
20
|
# @param xml [String]
|
21
|
-
# @return [
|
21
|
+
# @return [RelatonEcma::BibliographicItem]
|
22
22
|
def from_xml(xml)
|
23
|
-
::
|
23
|
+
::RelatonEcma::XMLParser.from_xml xml
|
24
24
|
end
|
25
25
|
|
26
26
|
# @param hash [Hash]
|
27
|
-
# @return [
|
27
|
+
# @return [RelatonEcma::BibliographicItem]
|
28
28
|
def hash_to_bib(hash)
|
29
|
-
::
|
29
|
+
::RelatonEcma::BibliographicItem.new hash
|
30
30
|
end
|
31
31
|
|
32
32
|
# Returns hash of XML grammar
|
@@ -17,10 +17,12 @@ module RelatonEcma
|
|
17
17
|
private
|
18
18
|
|
19
19
|
# @param url [String]
|
20
|
-
# @retrurn [
|
20
|
+
# @retrurn [RelatonEcma::BibliographicItem]
|
21
21
|
def parse_page(url)
|
22
22
|
doc = OpenURI.open_uri url
|
23
|
-
|
23
|
+
hash = YAML.safe_load(doc)
|
24
|
+
hash["fetched"] = Date.today.to_s
|
25
|
+
BibliographicItem.from_hash hash
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
data/lib/relaton_ecma/version.rb
CHANGED
data/lib/relaton_ecma.rb
CHANGED
@@ -3,6 +3,9 @@ require "open-uri"
|
|
3
3
|
require "yaml"
|
4
4
|
require "relaton_bib"
|
5
5
|
require "relaton_ecma/version"
|
6
|
+
require "relaton_ecma/bibliographic_item"
|
7
|
+
require "relaton_ecma/xml_parser"
|
8
|
+
require "relaton_ecma/hash_converter"
|
6
9
|
require "relaton_ecma/scrapper"
|
7
10
|
require "relaton_ecma/ecma_bibliography"
|
8
11
|
|
data/relaton_ecma.gemspec
CHANGED
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
37
37
|
spec.add_development_dependency "vcr"
|
38
38
|
spec.add_development_dependency "webmock"
|
39
39
|
|
40
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
40
|
+
spec.add_dependency "relaton-bib", "~> 1.14.0"
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ecma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.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: 2022-
|
11
|
+
date: 2022-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.14.0
|
118
118
|
type: :runtime
|
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: 1.
|
124
|
+
version: 1.14.0
|
125
125
|
description: "RelatonEcma: retrieve ECMA Standards for bibliographic use \nusing the
|
126
126
|
BibliographicItem model.\n"
|
127
127
|
email:
|
@@ -131,6 +131,7 @@ extensions: []
|
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
133
|
- ".github/workflows/rake.yml"
|
134
|
+
- ".github/workflows/release.yml"
|
134
135
|
- ".gitignore"
|
135
136
|
- ".rspec"
|
136
137
|
- ".rubocop.yml"
|
@@ -141,14 +142,18 @@ files:
|
|
141
142
|
- bin/rspec
|
142
143
|
- bin/setup
|
143
144
|
- grammars/basicdoc.rng
|
145
|
+
- grammars/biblio-standoc.rng
|
144
146
|
- grammars/biblio.rng
|
145
|
-
- grammars/
|
146
|
-
- grammars/
|
147
|
+
- grammars/relaton-ecma-compile.rng
|
148
|
+
- grammars/relaton-ecma.rng
|
147
149
|
- lib/relaton_ecma.rb
|
150
|
+
- lib/relaton_ecma/bibliographic_item.rb
|
148
151
|
- lib/relaton_ecma/ecma_bibliography.rb
|
152
|
+
- lib/relaton_ecma/hash_converter.rb
|
149
153
|
- lib/relaton_ecma/processor.rb
|
150
154
|
- lib/relaton_ecma/scrapper.rb
|
151
155
|
- lib/relaton_ecma/version.rb
|
156
|
+
- lib/relaton_ecma/xml_parser.rb
|
152
157
|
- relaton_ecma.gemspec
|
153
158
|
homepage: https://github.com/metanorma/relaton-ecma
|
154
159
|
licenses:
|