relaton-cen 1.14.1 → 1.16.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 +1 -0
- data/.github/workflows/release.yml +2 -1
- data/.gitignore +1 -0
- data/README.adoc +31 -4
- data/grammars/biblio.rng +1 -1
- 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: b5f0cd6a09da357f5ca19fe9d38430f7880d9b9658ee89bbcdf56a7c081342f1
|
4
|
+
data.tar.gz: c3645683652f184f5d037de48065b3e31dc173e84230de6f00d1f253f607febf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71f1f8971c40519883ead3fcd2a436a05c7d3826be5d1e1e3d3eae3e7d095a4b2c549228e918c18eff2df744fa4bd61297ec78a6c8481624b5106165aa7e8213
|
7
|
+
data.tar.gz: 13f632f4e026a41ebce994abbf3e9ca9505b51ecc551ed44bb325681427aae678305b7ed9b955db674dd6a8c3dc132971408060c51bf269262df33ad3b9f7248
|
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/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,11 +19,17 @@ 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
|
|
@@ -42,7 +48,22 @@ item = hit_collection[0].fetch
|
|
42
48
|
...
|
43
49
|
----
|
44
50
|
|
51
|
+
[source,ruby]
|
52
|
+
----
|
53
|
+
> RelatonCen::CenBibliography.get "CEN/CLC Guide 6"
|
54
|
+
[relaton-cen] ("CEN/CLC Guide 6") fetching...
|
55
|
+
[isoics] code not found in ICS list
|
56
|
+
[relaton-cen] ("CEN/CLC Guide 6") found CEN/CLC Guide 6:2014
|
57
|
+
=>
|
58
|
+
#<RelatonCen::BibliographicItem:0x000000011371cb90
|
59
|
+
@abstract=
|
60
|
+
[#<RelatonBib::FormattedString:0x000000011371c5f0
|
61
|
+
@content=
|
62
|
+
"ISO/IEC Guide 71:2014 provides guidance to standards..."
|
63
|
+
----
|
64
|
+
|
45
65
|
=== XML serialization
|
66
|
+
|
46
67
|
[source,ruby]
|
47
68
|
----
|
48
69
|
item.to_xml
|
@@ -53,7 +74,9 @@ item.to_xml
|
|
53
74
|
</bibitem>"
|
54
75
|
----
|
55
76
|
|
56
|
-
With `bibdata: true` option XML output wrapped with `bibdata` element and `ext`
|
77
|
+
With `bibdata: true` option XML output wrapped with `bibdata` element and `ext`
|
78
|
+
element added.
|
79
|
+
|
57
80
|
[source,ruby]
|
58
81
|
----
|
59
82
|
item.to_xml bibdata: true
|
@@ -79,6 +102,7 @@ item.link
|
|
79
102
|
----
|
80
103
|
|
81
104
|
=== Get code, and year
|
105
|
+
|
82
106
|
[source,ruby]
|
83
107
|
----
|
84
108
|
RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7:2019"
|
@@ -95,6 +119,7 @@ RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7", "2019"
|
|
95
119
|
----
|
96
120
|
|
97
121
|
=== Create bibliographic item form YAML
|
122
|
+
|
98
123
|
[source,ruby]
|
99
124
|
----
|
100
125
|
hash = YAML.load_file 'spec/fixtures/bibdata.yaml'
|
@@ -107,6 +132,7 @@ hash = YAML.load_file 'spec/fixtures/bibdata.yaml'
|
|
107
132
|
----
|
108
133
|
|
109
134
|
=== Create bibliographic item from XML
|
135
|
+
|
110
136
|
[source,ruby]
|
111
137
|
----
|
112
138
|
RelatonCen::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml", encoding: "UTF-8")
|
@@ -114,6 +140,7 @@ RelatonCen::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml", encoding:
|
|
114
140
|
...
|
115
141
|
----
|
116
142
|
|
143
|
+
|
117
144
|
== Development
|
118
145
|
|
119
146
|
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
@@ -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.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: 2023-
|
11
|
+
date: 2023-09-03 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:
|