relaton-bipm 1.11.0 → 1.11.3

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: 9a82c0e9b55d960a68829f47fe01690401a924a1b61df376e6834a107159b488
4
- data.tar.gz: 007aee78882b5e154ff6219d1b1429b727110600f254be691e8dced237e1120d
3
+ metadata.gz: 90b15ba099e66ff04bb59b8e79fb61a97a6ee82b93cdc4025f64e0489590b9bb
4
+ data.tar.gz: '09d38f02f831f995b5cc1e3fd99291480ddf7b06272374569954915a21d4d0e4'
5
5
  SHA512:
6
- metadata.gz: 81058113d2ba56ea79734d19f9c1bb45e4cbcb71df6d7fc8fb14b5ab09d8c55924dda3118db4d6588a15d0790e55b5cc393a41e67539c4f9b5d78c31d9663a69
7
- data.tar.gz: 1fc0397bb7b6b693fe8233d9577214684a72af2ec3c2a8fef5b130a3a4d10413c6980aefe4c7c638b9dfe0ba6726d1aa612577e63a853ec232827e8b16f673c0
6
+ metadata.gz: 300fb81135a9fc290b07b3bacdd43c1a126c131a0f52da8ddb249be79d87ced921b772b2b0623552e9d7d3f3ded76f107457c2d5f8864c91e1751d6d0876509f
7
+ data.tar.gz: 23a157ad9db09dd266d0eaae6c29b6198483530d80e04beb2b7bd88a05d45115a4f5d4d995752b2ab7a71b0e1e593a3204ba9be6d1e698b651b1fdd264efb852
@@ -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
@@ -53,17 +53,43 @@ bib = RelatonBipm::BipmBibliography.get "BIPM Metrologia 29 6 373"
53
53
  ...
54
54
 
55
55
  # get CGPM resolutions
56
- RelatonBipm::BipmBibliography.get "BIPM CR 01"
57
- [relaton-bipm] ("BIPM CR 01") fetching...
58
- [relaton-bipm] ("BIPM CR 01") found BIPM CR 01
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 PV 101(I)"
64
- [relaton-bipm] ("BIPM PV 101(I)") fetching...
65
- [relaton-bipm] ("BIPM PV 101(I)") found BIPM PV 101(I)
66
- => #<RelatonBipm::BipmBibliographicItem:0x00007fd5072301c0
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 0 (1889)
66
+ => #<RelatonBipm::BipmBibliographicItem:0x00007ff0d1ffae50
67
+ ...
68
+
69
+ # get CIPM decision
70
+ RelatonBipm::BipmBibliography.get "CIPM Decision 2012-01"
71
+ [relaton-bipm] ("CIPM Decision 2012-01") fetching...
72
+ [relaton-bipm] ("CIPM Decision 2012-01") found CIPM Decision 1 (2012)
73
+ => #<RelatonBipm::BipmBibliographicItem:0x00007ff0f10dc548
74
+ ...
75
+
76
+ RelatonBipm::BipmBibliography.get "CIPM Decision 1 (2012)"
77
+ [relaton-bipm] ("CIPM Decision 1 (2012)") fetching...
78
+ [relaton-bipm] ("CIPM Decision 1 (2012)") found CIPM Decision 1 (2012)
79
+ => #<RelatonBipm::BipmBibliographicItem:0x00007fb6b9bbec08
80
+ ...
81
+
82
+ # get CIPM recommendation
83
+ RelatonBipm::BipmBibliography.get "CIPM Recommendation (1948)"
84
+ [relaton-bipm] ("CIPM Recommendation (1948)") fetching...
85
+ [relaton-bipm] ("CIPM Recommendation (1948)") found CIPM Recommendation (1948)
86
+ => #<RelatonBipm::BipmBibliographicItem:0x00007ff0a18a6aa8
87
+ ...
88
+
89
+ RelatonBipm::BipmBibliography.get "CIPM Recommendation 1948"
90
+ [relaton-bipm] ("CIPM Recommendation 1948") fetching...
91
+ [relaton-bipm] ("CIPM Recommendation 1948") found CIPM Recommendation (1948)
92
+ => #<RelatonBipm::BipmBibliographicItem:0x00007ff0f1164150
67
93
  ...
68
94
  ----
69
95
 
data/grammars/biblio.rng CHANGED
@@ -527,7 +527,7 @@
527
527
  </define>
528
528
  <define name="LocalityType">
529
529
  <data type="string">
530
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
530
+ <param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
531
531
  </data>
532
532
  </define>
533
533
  <define name="referenceFrom">
@@ -851,17 +851,46 @@
851
851
  </define>
852
852
  <define name="bplace">
853
853
  <element name="place">
854
- <optional>
855
- <attribute name="uri">
856
- <data type="anyURI"/>
857
- </attribute>
858
- </optional>
859
- <optional>
860
- <attribute name="region"/>
861
- </optional>
854
+ <choice>
855
+ <text/>
856
+ <group>
857
+ <ref name="bibliocity"/>
858
+ <zeroOrMore>
859
+ <ref name="biblioregion"/>
860
+ </zeroOrMore>
861
+ <zeroOrMore>
862
+ <ref name="bibliocountry"/>
863
+ </zeroOrMore>
864
+ </group>
865
+ </choice>
866
+ </element>
867
+ </define>
868
+ <define name="bibliocity">
869
+ <element name="city">
862
870
  <text/>
863
871
  </element>
864
872
  </define>
873
+ <define name="biblioregion">
874
+ <element name="region">
875
+ <ref name="RegionType"/>
876
+ </element>
877
+ </define>
878
+ <define name="bibliocountry">
879
+ <element name="country">
880
+ <ref name="RegionType"/>
881
+ </element>
882
+ </define>
883
+ <define name="RegionType">
884
+ <optional>
885
+ <attribute name="iso"/>
886
+ </optional>
887
+ <optional>
888
+ <attribute name="recommended">
889
+ <data type="boolean"/>
890
+ </attribute>
891
+ </optional>
892
+ <text/>
893
+ </define>
865
894
  <define name="bprice">
866
895
  <element name="price">
867
896
  <attribute name="currency"/>
@@ -40,7 +40,10 @@ 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.gsub(/[()]/, "").upcase.split.join '-'}.yaml"
43
+ rf = ref.sub(/(\d{1,2})\s\((\d{4})\)/) { "#{$2}-#{$1.rjust(2, '0')}" }.sub(/\((\d{4})\)/, "\\1")
44
+ path_parts = rf.split.map &:downcase
45
+ path_parts.insert(1, "meetings") unless path_parts[1] == "meetings"
46
+ url = "#{GH_ENDPOINT}#{path_parts.join '/'}.yaml"
44
47
  resp = agent.get url
45
48
  check_response resp
46
49
  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.0".freeze
2
+ VERSION = "1.11.3".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.0
4
+ version: 1.11.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-04-10 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