relaton-bipm 1.11.2 → 1.11.5
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 -24
- data/README.adoc +37 -24
- data/lib/relaton_bipm/bipm_bibliography.rb +14 -2
- data/lib/relaton_bipm/data_fetcher.rb +9 -0
- data/lib/relaton_bipm/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9822a21eb0d3947f49b05a86cf1df7052ea0ff0b5647b1deff72a8c1a0baa615
|
4
|
+
data.tar.gz: aaac7bd97c5b86e084badcb0e3428c3cb8f3b72570e80f0a26f5499e5f6be6c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '039efcd3fff34694d66b65ec2183fefa2bccd0e7730d1de17ff090c78c0819faf17a26942df134d9b31c2faf02f5bd17d102c5166168ea47c34ed3dbd45111d9'
|
7
|
+
data.tar.gz: aa6cf69ed87904d7775ad614c6392ca2b5d56f7b4db579fdec4d82d88752a015adbc509626b4db0967de360d5a172750b280e7f814d2800016302cadacef48a4
|
data/.github/workflows/rake.yml
CHANGED
@@ -10,27 +10,4 @@ on:
|
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
rake:
|
13
|
-
|
14
|
-
runs-on: ${{ matrix.os }}
|
15
|
-
continue-on-error: ${{ matrix.experimental }}
|
16
|
-
strategy:
|
17
|
-
fail-fast: false
|
18
|
-
matrix:
|
19
|
-
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
|
-
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
|
-
experimental: [ false ]
|
22
|
-
steps:
|
23
|
-
- uses: actions/checkout@v2
|
24
|
-
with:
|
25
|
-
submodules: true
|
26
|
-
|
27
|
-
# https://github.com/ruby-debug/debase/issues/89#issuecomment-686827382
|
28
|
-
- if: matrix.os == 'macos-latest' && matrix.ruby == '2.5'
|
29
|
-
run: echo BUNDLE_BUILD__DEBASE="--with-cflags=\"-Wno-error=implicit-function-declaration\"" >> $GITHUB_ENV
|
30
|
-
|
31
|
-
- uses: ruby/setup-ruby@v1
|
32
|
-
with:
|
33
|
-
ruby-version: ${{ matrix.ruby }}
|
34
|
-
bundler-cache: true
|
35
|
-
|
36
|
-
- run: bundle exec rake
|
13
|
+
uses: relaton/support/.github/workflows/rake.yml@master
|
data/README.adoc
CHANGED
@@ -52,43 +52,56 @@ bib = RelatonBipm::BipmBibliography.get "BIPM Metrologia 29 6 373"
|
|
52
52
|
=> #<RelatonBipm::BipmBibliographicItem:0x007f8857f94d40
|
53
53
|
...
|
54
54
|
|
55
|
-
# get CGPM
|
56
|
-
RelatonBipm::BipmBibliography.get "CGPM
|
57
|
-
[relaton-bipm] ("CGPM
|
58
|
-
[relaton-bipm] ("CGPM
|
55
|
+
# get CGPM meetings
|
56
|
+
RelatonBipm::BipmBibliography.get "CGPM Meetings 1"
|
57
|
+
[relaton-bipm] ("CGPM Meetings 1") fetching...
|
58
|
+
[relaton-bipm] ("CGPM Meetings 1") found CGPM Meetings 1
|
59
59
|
=> #<RelatonBipm::BipmBibliographicItem:0x00007fd4f7cba038
|
60
60
|
...
|
61
61
|
|
62
|
-
# get
|
63
|
-
RelatonBipm::BipmBibliography.get "
|
64
|
-
[relaton-bipm] ("
|
65
|
-
[relaton-bipm] ("
|
66
|
-
=> #<RelatonBipm::BipmBibliographicItem:
|
62
|
+
# get CGPM resolutions
|
63
|
+
RelatonBipm::BipmBibliography.get "CGPM Resolution 1889-00"
|
64
|
+
[relaton-bipm] ("CGPM Resolution 1889-00") fetching...
|
65
|
+
[relaton-bipm] ("CGPM Resolution 1889-00") found CGPM Resolution (1889)
|
66
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007ff0d1ffae50
|
67
67
|
...
|
68
68
|
|
69
|
-
RelatonBipm::BipmBibliography.get "
|
70
|
-
[relaton-bipm] ("
|
71
|
-
[relaton-bipm] ("
|
72
|
-
=> #<RelatonBipm::BipmBibliographicItem:
|
69
|
+
RelatonBipm::BipmBibliography.get "CGPM Resolution (1889)"
|
70
|
+
[relaton-bipm] ("CGPM Resolution (1889)") fetching...
|
71
|
+
[relaton-bipm] ("CGPM Resolution (1889)") found CGPM Resolution (1889)
|
72
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007ff0d1ffae50
|
73
|
+
...
|
74
|
+
|
75
|
+
RelatonBipm::BipmBibliography.get "CGPM Resolution 1889"
|
76
|
+
[relaton-bipm] ("CGPM Resolution 1889") fetching...
|
77
|
+
[relaton-bipm] ("CGPM Resolution 1889") found CGPM Resolution (1889)
|
78
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007ff0d1ffae50
|
73
79
|
...
|
74
80
|
|
81
|
+
# get CIPM decision
|
75
82
|
RelatonBipm::BipmBibliography.get "CIPM Decision 2012-01"
|
76
83
|
[relaton-bipm] ("CIPM Decision 2012-01") fetching...
|
77
|
-
[relaton-bipm] ("CIPM Decision 2012-01") found CIPM Decision
|
78
|
-
=> #<RelatonBipm::BipmBibliographicItem:
|
84
|
+
[relaton-bipm] ("CIPM Decision 2012-01") found CIPM Decision 1 (2012)
|
85
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007ff0f10dc548
|
86
|
+
...
|
87
|
+
|
88
|
+
RelatonBipm::BipmBibliography.get "CIPM Decision 1 (2012)"
|
89
|
+
[relaton-bipm] ("CIPM Decision 1 (2012)") fetching...
|
90
|
+
[relaton-bipm] ("CIPM Decision 1 (2012)") found CIPM Decision 1 (2012)
|
91
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007fb6b9bbec08
|
79
92
|
...
|
80
93
|
|
81
|
-
# get CIPM
|
82
|
-
RelatonBipm::BipmBibliography.get "CIPM
|
83
|
-
[relaton-bipm] ("CIPM
|
84
|
-
[relaton-bipm] ("CIPM
|
85
|
-
=> #<RelatonBipm::BipmBibliographicItem:
|
94
|
+
# get CIPM recommendation
|
95
|
+
RelatonBipm::BipmBibliography.get "CIPM Recommendation (1948)"
|
96
|
+
[relaton-bipm] ("CIPM Recommendation (1948)") fetching...
|
97
|
+
[relaton-bipm] ("CIPM Recommendation (1948)") found CIPM Recommendation (1948)
|
98
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007ff0a18a6aa8
|
86
99
|
...
|
87
100
|
|
88
|
-
RelatonBipm::BipmBibliography.get "CIPM
|
89
|
-
[relaton-bipm] ("CIPM
|
90
|
-
[relaton-bipm] ("CIPM
|
91
|
-
=> #<RelatonBipm::BipmBibliographicItem:
|
101
|
+
RelatonBipm::BipmBibliography.get "CIPM Recommendation 1948"
|
102
|
+
[relaton-bipm] ("CIPM Recommendation 1948") fetching...
|
103
|
+
[relaton-bipm] ("CIPM Recommendation 1948") found CIPM Recommendation (1948)
|
104
|
+
=> #<RelatonBipm::BipmBibliographicItem:0x00007ff0f1164150
|
92
105
|
...
|
93
106
|
----
|
94
107
|
|
@@ -4,6 +4,13 @@ module RelatonBipm
|
|
4
4
|
class BipmBibliography
|
5
5
|
GH_ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-bipm/master/data/".freeze
|
6
6
|
IOP_DOMAIN = "https://iopscience.iop.org".freeze
|
7
|
+
TYPES = {
|
8
|
+
"Déclaration" => "Declaration",
|
9
|
+
"Réunions" => "Meetings",
|
10
|
+
"Recommandation" => "Recommandation",
|
11
|
+
"Résolution" => "Resolution",
|
12
|
+
"Décision" => "Decision",
|
13
|
+
}.freeze
|
7
14
|
|
8
15
|
class << self
|
9
16
|
# @param text [String]
|
@@ -40,8 +47,13 @@ module RelatonBipm
|
|
40
47
|
# @param agent [Mechanize]
|
41
48
|
# @return [RelatonBipm::BipmBibliographicItem]
|
42
49
|
def get_bipm(ref, agent) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
43
|
-
rf = ref.sub(/(\d{2})\s
|
44
|
-
|
50
|
+
rf = ref.sub(/(?:(\d{1,2})\s)?\(?(\d{4})(?!-)\)?/) do
|
51
|
+
"#{$2}-#{$1.to_s.rjust(2, '0')}"
|
52
|
+
end
|
53
|
+
TYPES.each { |fr, en| rf.sub! fr, en }
|
54
|
+
path_parts = rf.split.map &:downcase
|
55
|
+
path_parts.insert(1, "meetings") unless path_parts[1] == "meetings"
|
56
|
+
url = "#{GH_ENDPOINT}#{path_parts.join '/'}.yaml"
|
45
57
|
resp = agent.get url
|
46
58
|
check_response resp
|
47
59
|
return unless resp.code == "200"
|
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.11.
|
4
|
+
version: 1.11.5
|
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-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- lib/relaton_bipm/bipm_bibliography.rb
|
182
182
|
- lib/relaton_bipm/comment_periond.rb
|
183
183
|
- lib/relaton_bipm/committee.rb
|
184
|
+
- lib/relaton_bipm/data_fetcher.rb
|
184
185
|
- lib/relaton_bipm/document_relation.rb
|
185
186
|
- lib/relaton_bipm/editorial_group.rb
|
186
187
|
- lib/relaton_bipm/hash_converter.rb
|