relaton-cen 1.14.1 → 1.16.1
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 +1 -0
- data/.github/workflows/release.yml +2 -1
- data/.gitignore +1 -0
- data/Gemfile +2 -2
- data/README.adoc +39 -8
- data/grammars/biblio.rng +1 -1
- data/lib/relaton_cen/cen_bibliography.rb +3 -2
- data/lib/relaton_cen/hit_collection.rb +2 -2
- data/lib/relaton_cen/version.rb +1 -1
- data/relaton_cen.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a64d7b3c77fcd73b38bc5ce62313141e51da3b0f784532b6ff10da1069a7c528
|
4
|
+
data.tar.gz: 6186b2913635bc27fc7cf8ea86961985a809063dc36ca60d75a78976b89949b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae0b06db552199faef6afda209aa35918b4b486a04e8979c4554527443ac29122e4c6dcb0597e6438898a4dbda24596e7ea436b4810e4becd57eda9415b23e5b
|
7
|
+
data.tar.gz: 7a7644ba895afbfe99c9b5601a1cff601ebd7ee00f5ff842507d3f36f2ecd3ae53ecf054c162ac7d852ad435536997df827040604b15fa5f1f7039bb04b024fb
|
data/.github/workflows/rake.yml
CHANGED
@@ -7,7 +7,8 @@ on:
|
|
7
7
|
inputs:
|
8
8
|
next_version:
|
9
9
|
description: |
|
10
|
-
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
|
11
|
+
Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
|
11
12
|
required: true
|
12
13
|
default: 'skip'
|
13
14
|
repository_dispatch:
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.adoc
CHANGED
@@ -10,7 +10,7 @@ RelatonCen is a Ruby gem that implements the https://github.com/metanorma/metano
|
|
10
10
|
|
11
11
|
== Installation
|
12
12
|
|
13
|
-
Add this line to your application's Gemfile
|
13
|
+
Add this line to your application's `Gemfile`:
|
14
14
|
|
15
15
|
[source,ruby]
|
16
16
|
----
|
@@ -19,14 +19,22 @@ gem 'relaton-cen'
|
|
19
19
|
|
20
20
|
And then execute:
|
21
21
|
|
22
|
-
|
22
|
+
[source,sh]
|
23
|
+
----
|
24
|
+
$ bundle install
|
25
|
+
----
|
23
26
|
|
24
27
|
Or install it yourself as:
|
25
28
|
|
26
|
-
|
29
|
+
[source,sh]
|
30
|
+
----
|
31
|
+
$ gem install relaton-cen
|
32
|
+
----
|
27
33
|
|
28
34
|
== Usage
|
29
35
|
|
36
|
+
For CENELEC standards, use references with the prefix `CEN/CLC`. For example, `CEN/CLC Guide 6`.
|
37
|
+
|
30
38
|
=== Search for a standard using keywords
|
31
39
|
|
32
40
|
[source,ruby]
|
@@ -42,7 +50,24 @@ item = hit_collection[0].fetch
|
|
42
50
|
...
|
43
51
|
----
|
44
52
|
|
53
|
+
=== Get a standard by its code
|
54
|
+
|
55
|
+
[source,ruby]
|
56
|
+
----
|
57
|
+
> RelatonCen::CenBibliography.get "CEN/CLC Guide 6"
|
58
|
+
[relaton-cen] (CEN/CLC Guide 6) fetching...
|
59
|
+
[isoics] code not found in ICS list
|
60
|
+
[relaton-cen] (CEN/CLC Guide 6) `found CEN/CLC Guide 6`
|
61
|
+
=>
|
62
|
+
#<RelatonCen::BibliographicItem:0x000000011371cb90
|
63
|
+
@abstract=
|
64
|
+
[#<RelatonBib::FormattedString:0x000000011371c5f0
|
65
|
+
@content=
|
66
|
+
"ISO/IEC Guide 71:2014 provides guidance to standards..."
|
67
|
+
----
|
68
|
+
|
45
69
|
=== XML serialization
|
70
|
+
|
46
71
|
[source,ruby]
|
47
72
|
----
|
48
73
|
item.to_xml
|
@@ -53,7 +78,9 @@ item.to_xml
|
|
53
78
|
</bibitem>"
|
54
79
|
----
|
55
80
|
|
56
|
-
With `bibdata: true` option XML output wrapped with `bibdata` element and `ext`
|
81
|
+
With `bibdata: true` option XML output wrapped with `bibdata` element and `ext`
|
82
|
+
element added.
|
83
|
+
|
57
84
|
[source,ruby]
|
58
85
|
----
|
59
86
|
item.to_xml bibdata: true
|
@@ -79,22 +106,24 @@ item.link
|
|
79
106
|
----
|
80
107
|
|
81
108
|
=== Get code, and year
|
109
|
+
|
82
110
|
[source,ruby]
|
83
111
|
----
|
84
112
|
RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7:2019"
|
85
|
-
[relaton-cen] (
|
86
|
-
[relaton-cen] (
|
113
|
+
[relaton-cen] (CEN ISO/TS 21003-7) fetching...
|
114
|
+
[relaton-cen] (CEN ISO/TS 21003-7) found CEN `ISO/TS 21003-7:2019`
|
87
115
|
=> #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd596c58
|
88
116
|
...
|
89
117
|
|
90
118
|
RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7", "2019"
|
91
|
-
[relaton-cen] (
|
92
|
-
[relaton-cen] (
|
119
|
+
[relaton-cen] (CEN ISO/TS 21003-7) fetching...
|
120
|
+
[relaton-cen] (CEN ISO/TS 21003-7) found CEN `ISO/TS 21003-7:2019`
|
93
121
|
=> #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd5df9f8
|
94
122
|
...
|
95
123
|
----
|
96
124
|
|
97
125
|
=== Create bibliographic item form YAML
|
126
|
+
|
98
127
|
[source,ruby]
|
99
128
|
----
|
100
129
|
hash = YAML.load_file 'spec/fixtures/bibdata.yaml'
|
@@ -107,6 +136,7 @@ hash = YAML.load_file 'spec/fixtures/bibdata.yaml'
|
|
107
136
|
----
|
108
137
|
|
109
138
|
=== Create bibliographic item from XML
|
139
|
+
|
110
140
|
[source,ruby]
|
111
141
|
----
|
112
142
|
RelatonCen::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml", encoding: "UTF-8")
|
@@ -114,6 +144,7 @@ RelatonCen::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml", encoding:
|
|
114
144
|
...
|
115
145
|
----
|
116
146
|
|
147
|
+
|
117
148
|
== Development
|
118
149
|
|
119
150
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/grammars/biblio.rng
CHANGED
@@ -101,8 +101,9 @@ module RelatonCen
|
|
101
101
|
result = search_filter(code) || return
|
102
102
|
ret = isobib_results_filter(result, year)
|
103
103
|
if ret[:ret]
|
104
|
-
|
105
|
-
|
104
|
+
bib = year ? ret[:ret] : ret[:ret].to_most_recent_reference
|
105
|
+
warn "[relaton-cen] (#{code}) found `#{bib.docidentifier.first&.id}`"
|
106
|
+
bib
|
106
107
|
else
|
107
108
|
fetch_ref_err(code, year, ret[:years])
|
108
109
|
end
|
@@ -22,7 +22,7 @@ module RelatonCen
|
|
22
22
|
search_page = agent.get "#{DOMAIN}f?p=205:105:0:::::"
|
23
23
|
form = search_page.at "//form[@id='wwvFlowForm']"
|
24
24
|
skip_inputs = %w[f11 essentialCookies]
|
25
|
-
req_body = form.xpath(".//input").
|
25
|
+
req_body = form.xpath(".//input").filter_map do |f|
|
26
26
|
next if f[:name].empty? || skip_inputs.include?(f[:name])
|
27
27
|
|
28
28
|
val = case f[:value]
|
@@ -39,7 +39,7 @@ module RelatonCen
|
|
39
39
|
else
|
40
40
|
"#{f[:name]}=#{val}"
|
41
41
|
end
|
42
|
-
end.
|
42
|
+
end.join("&")
|
43
43
|
resp = agent.post form[:action], req_body
|
44
44
|
@array = hits resp
|
45
45
|
sort
|
data/lib/relaton_cen/version.rb
CHANGED
data/relaton_cen.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
34
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
35
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.
|
35
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.16.0"
|
36
36
|
|
37
37
|
# For more information and examples about making a new gem, checkout our
|
38
38
|
# guide at: https://bundler.io/guides/creating_gem.html
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-cen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.16.0
|
34
34
|
type: :runtime
|
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: 1.
|
40
|
+
version: 1.16.0
|
41
41
|
description: 'RelatonCen: retrieve Cenelec Standards for bibliographic use using the
|
42
42
|
IsoBibliographicItem model'
|
43
43
|
email:
|