relaton-bipm 1.11.1 → 1.11.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7aff4405e5c4f5c22dd1dcb4a01fc8d7c26d16b0dbff5d3e194e29ea3b245af
4
- data.tar.gz: a9a5c5d7bb80c5ab3c5f5a414f36b42d0b468b179b510759baa30396016b032a
3
+ metadata.gz: 48b49b85ee677df9306a704d0b33a2b90460435ae807c03020e5d101f19cd429
4
+ data.tar.gz: 9d20d295e87eefc521522d45ffa0ae91a47afabba05c976572240cbaa07c362a
5
5
  SHA512:
6
- metadata.gz: 5b77c6c27b1ea7df08b8436ab6730ef60d7ed0c119c60ac2399c4366e7c3caf0a07a152929b003f331e4e4fd148bd5908bbfe8ffea017eacf37038a03c5c2093
7
- data.tar.gz: 4906d0bf50841a154634c1b44161be904142880669ad8c1ba1b82b30eace2d3a4acdf9594f973f64af80bcc812afb754078fed025b4871fbe686ad98cc8f8cc2
6
+ metadata.gz: 37cfcbf1cc3bb77c6fd162fed2580e7844308a8baf1f172ab10c041b6576bedbcb902baf763da699de9b5f32359fbcd5a390a1d482d9793d6e7fd089698c682c
7
+ data.tar.gz: e00b2c77e4fe20599959e855423d3775d3e8992d74240cabb4e01a6e0a0dde7386ff02b5e61a57c6181733fbb11efc40d0cc1a02b578fccdf5ced7d8aa8d9a59
@@ -10,27 +10,4 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
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,18 +52,56 @@ bib = RelatonBipm::BipmBibliography.get "BIPM Metrologia 29 6 373"
52
52
  => #<RelatonBipm::BipmBibliographicItem:0x007f8857f94d40
53
53
  ...
54
54
 
55
- # get CGPM resolutions
56
- RelatonBipm::BipmBibliography.get "BIPM CGPM Resolution 1"
57
- [relaton-bipm] ("BIPM CGPM Resolution 1") fetching...
58
- [relaton-bipm] ("BIPM CGPM Resolution 1") found BIPM CR 01
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 CIPM resolutions
63
- RelatonBipm::BipmBibliography.get "BIPM CIPM Decision 101-1"
64
- [relaton-bipm] ("BIPM CIPM Decision 101-1") fetching...
65
- [relaton-bipm] ("BIPM CIPM Decision 101-1") found BIPM CIPM Decision 101-1
66
- => #<RelatonBipm::BipmBibliographicItem:0x00007fed16dfcfe0
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
+ ...
68
+
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
79
+ ...
80
+
81
+ # get CIPM decision
82
+ RelatonBipm::BipmBibliography.get "CIPM Decision 2012-01"
83
+ [relaton-bipm] ("CIPM Decision 2012-01") fetching...
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
92
+ ...
93
+
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
99
+ ...
100
+
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
67
105
  ...
68
106
  ----
69
107
 
@@ -40,7 +40,12 @@ module RelatonBipm
40
40
  # @param agent [Mechanize]
41
41
  # @return [RelatonBipm::BipmBibliographicItem]
42
42
  def get_bipm(ref, agent) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
43
- url = "#{GH_ENDPOINT}#{ref.downcase.split.join '/'}.yaml"
43
+ rf = ref.sub(/(?:(\d{1,2})\s)?\(?(\d{4})(?!-)\)?/) do
44
+ "#{$2}-#{$1.to_s.rjust(2, '0')}"
45
+ end
46
+ path_parts = rf.split.map &:downcase
47
+ path_parts.insert(1, "meetings") unless path_parts[1] == "meetings"
48
+ url = "#{GH_ENDPOINT}#{path_parts.join '/'}.yaml"
44
49
  resp = agent.get url
45
50
  check_response resp
46
51
  return unless resp.code == "200"
@@ -0,0 +1,9 @@
1
+ module RelatonBipm
2
+ class DataFetcher
3
+ def initialize(output, format)
4
+ @output = output
5
+ @format = format
6
+ @ext = format.sub(/^bib/, "")
7
+ end
8
+ end
9
+ end
@@ -7,7 +7,7 @@ module RelatonBipm
7
7
  def initialize
8
8
  @short = :relaton_bipm
9
9
  @prefix = "BIPM"
10
- @defaultprefix = %r{^BIPM\s}
10
+ @defaultprefix = %r{^(?:BIPM|CCTF|CGPM|CIPM)\s}
11
11
  @idtype = "BIPM"
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module RelatonBipm
2
- VERSION = "1.11.1".freeze
2
+ VERSION = "1.11.4".freeze
3
3
  end
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.1
4
+ version: 1.11.4
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-04-26 00:00:00.000000000 Z
11
+ date: 2022-05-31 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