relaton-bipm 1.10.2 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +1 -1
- data/lib/relaton_bipm/bipm_bibliography.rb +7 -2
- data/lib/relaton_bipm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82921528d18ccbfc6bbba60ae832fd711d92c9d338b887c19b500d81f911098b
|
4
|
+
data.tar.gz: 21db3cbf7e095003a51224b8c7c8a11f0b46164d52f161f45c83acd5677b65ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5df3c90e1dce934b765a738283b8cefc1de1516ffc869698bc5c161ca5a3ae290a30f799c00de19fe67513d589934ea469d3a9a4c5c3144e1afc6ca3174eea7b
|
7
|
+
data.tar.gz: 5516be3766704271ef92b49621fdf4ee38e01520ba986917f8ff0a8fd4d34eabb3530dadb8fc500dbbedf762d0128115c3987476cb430930c21cbe516e248cab
|
data/README.adoc
CHANGED
@@ -8,7 +8,7 @@ image:https://codeclimate.com/github/relaton/relaton-bipm/badges/gpa.svg["Code C
|
|
8
8
|
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-bipm.svg["Pull Requests", link="https://github.com/relaton/relaton-bipm/pulls"]
|
9
9
|
image:https://img.shields.io/github/commits-since/relaton/relaton-bipm/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-bipm/releases"]
|
10
10
|
|
11
|
-
|
11
|
+
RelatonBipm is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model].
|
12
12
|
|
13
13
|
You can use it to retrieve metadata of BIPM Standards from https://www.bipm.org, and access such metadata through the `BipmBibliographicItem` object.
|
14
14
|
|
@@ -39,13 +39,18 @@ module RelatonBipm
|
|
39
39
|
# @param ref [String]
|
40
40
|
# @param agent [Mechanize]
|
41
41
|
# @return [RelatonBipm::BipmBibliographicItem]
|
42
|
-
def get_bipm(ref, agent)
|
42
|
+
def get_bipm(ref, agent) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
43
43
|
url = "#{GH_ENDPOINT}#{ref.upcase.split.join '-'}.yaml"
|
44
44
|
resp = agent.get url
|
45
45
|
check_response resp
|
46
46
|
return unless resp.code == "200"
|
47
47
|
|
48
|
-
|
48
|
+
yaml = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("3.1.0.pre1")
|
49
|
+
YAML.safe_load(resp.body, permitted_classes: [Date])
|
50
|
+
else
|
51
|
+
YAML.safe_load(resp.body, [Date])
|
52
|
+
end
|
53
|
+
bib_hash = HashConverter.hash_to_bib yaml
|
49
54
|
BipmBibliographicItem.new(**bib_hash)
|
50
55
|
end
|
51
56
|
|
data/lib/relaton_bipm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.3
|
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-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|