relaton-jis 1.16.2 → 1.16.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: 0f553d8895e1407f6efa8f149be93c2923b89a6a8e8c1a104098b9b8c3a56055
4
- data.tar.gz: ec304140ac64f7173e592661d0f183d1b1285d09164fc4b472d53154758f045b
3
+ metadata.gz: 637bc94d43f604b252d2515dbc7cc727e2ec1021cb29720b73193bfe8dca4c99
4
+ data.tar.gz: a4eadba51c57fdb56a79d3dc095869d363f6a48defd31476f04c3a986e52dbea
5
5
  SHA512:
6
- metadata.gz: df6a1896c95ab8245adc1647b530c7fa821bf1f7c9da679805005f28acf396b8c6acc33ed63ad80fe1dfc85635fce7bf287da13d7a9c7ad32fc7cbd52f0bd7c2
7
- data.tar.gz: 78dfe40b2cdcb55c4ae4215a4bd3ad95f6181cd16284956963d00501c4527d5945b7f806e6206a637d93e6ae029ca3e5df893713020328407e95547b8a9499f4
6
+ metadata.gz: e70ee1f1d77824d4392749303d2fdf9ecc9c4f9010e8b6efe46fd2e6e5de9011500035c266b1669467878afbc85bfa424e7c12d786ab7f1ecccf1cca0bb960d8
7
+ data.tar.gz: 790770f4b8a955c33ebd3b0f430caaf92e8ad19b4cc547803439495e6bbecc6198e14fed611d38adeebf7970a9f960d00558e3dc759f13ab9580007e2fc4282f
data/README.adoc CHANGED
@@ -80,6 +80,29 @@ item.docidentifier[0].id
80
80
  => "JIS X 0208:1997"
81
81
  ----
82
82
 
83
+ === Fetch all parts of a standard
84
+
85
+ [source,ruby]
86
+ ----
87
+ item = RelatonJis::Bibliography.get "JIS B 0060 (all parts)"
88
+ [relaton-jis] (JIS B 0060 (all parts)) Fetching from webdesk.jsa.or.jp ...
89
+ [relaton-jis] (JIS B 0060 (all parts)) Found: `JIS B 0060 (all parts)`
90
+ => #<RelatonJis::BibliographicItem:0x000000010c3e2300
91
+ ...
92
+
93
+ item.docidentifier
94
+ => [#<RelatonBib::DocumentIdentifier:0x000000010c5905f8 @id="JIS B 0060 (all parts)", @language=nil, @primary=true, @scope=nil, @script=nil, @type="JIS">]
95
+
96
+ item = RelatonJis::Bibliography.get "JIS B 0060 (規格群)"
97
+ [relaton-jis] (JIS B 0060 (規格群)) Fetching from webdesk.jsa.or.jp ...
98
+ [relaton-jis] (JIS B 0060 (規格群)) Found: `JIS B 0060 (all parts)`
99
+ => #<RelatonJis::BibliographicItem:0x000000010c3ceb20
100
+ ...
101
+
102
+ item.docidentifier
103
+ => [#<RelatonBib::DocumentIdentifier:0x000000010c8d9b10 @id="JIS B 0060 (all parts)", @language=nil, @primary=true, @scope=nil, @script=nil, @type="JIS">]
104
+ ----
105
+
83
106
  === XML serialization
84
107
 
85
108
  Possible options:
@@ -89,7 +112,7 @@ Possible options:
89
112
  [source,ruby]
90
113
  ----
91
114
  item.to_xml
92
- => "<bibitem id="JISX0208-1997" type="standard" schema-version="v1.2.4">
115
+ => "<bibitem id="JISX0208-1997" type="standard" schema-version="v1.2.5">
93
116
  <fetched>2023-03-18</fetched>
94
117
  <title format="text/plain" language="ja" script="Jpan">7ビット及び8ビットの2バイト情報交換用符号化漢字集合</title>
95
118
  <title format="text/plain" language="en" script="Lant">7-bit and 8-bit double byte coded KANJI sets for information interchange</title>
@@ -97,12 +120,12 @@ item.to_xml
97
120
  </bibitem>"
98
121
 
99
122
  item.to_xml bibdata: true
100
- => "<bibdata type="standard" schema-version="v1.2.4">
123
+ => "<bibdata type="standard" schema-version="v1.2.5">
101
124
  <fetched>2023-03-18</fetched>
102
125
  <title format="text/plain" language="ja" script="Jpan">7ビット及び8ビットの2バイト情報交換用符号化漢字集合</title>
103
126
  <title format="text/plain" language="en" script="Lant">7-bit and 8-bit double byte coded KANJI sets for information interchange</title>
104
127
  ...
105
- <ext schema-version="">
128
+ <ext schema-version="v0.0.1">
106
129
  <doctype>standard</doctype>
107
130
  <editorialgroup>
108
131
  <technical-committee>一般財団法人 日本規格協会</technical-committee>
@@ -346,6 +346,8 @@
346
346
  <ref name="keyword"/>
347
347
  <ref name="xref"/>
348
348
  <ref name="hyperlink"/>
349
+ <ref name="index"/>
350
+ <ref name="index-xref"/>
349
351
  </choice>
350
352
  </oneOrMore>
351
353
  </element>
@@ -623,6 +625,8 @@
623
625
  <ref name="eref"/>
624
626
  <ref name="xref"/>
625
627
  <ref name="hyperlink"/>
628
+ <ref name="index"/>
629
+ <ref name="index-xref"/>
626
630
  </choice>
627
631
  </zeroOrMore>
628
632
  </element>
@@ -636,6 +640,8 @@
636
640
  <ref name="eref"/>
637
641
  <ref name="xref"/>
638
642
  <ref name="hyperlink"/>
643
+ <ref name="index"/>
644
+ <ref name="index-xref"/>
639
645
  </choice>
640
646
  </zeroOrMore>
641
647
  </element>
@@ -648,6 +654,8 @@
648
654
  <ref name="eref"/>
649
655
  <ref name="xref"/>
650
656
  <ref name="hyperlink"/>
657
+ <ref name="index"/>
658
+ <ref name="index-xref"/>
651
659
  </choice>
652
660
  </zeroOrMore>
653
661
  </element>
@@ -655,7 +663,11 @@
655
663
  <define name="keyword">
656
664
  <element name="keyword">
657
665
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
666
+ <choice>
667
+ <ref name="PureTextElement"/>
668
+ <ref name="index"/>
669
+ <ref name="index-xref"/>
670
+ </choice>
659
671
  </zeroOrMore>
660
672
  </element>
661
673
  </define>
@@ -676,7 +688,11 @@
676
688
  <define name="strike">
677
689
  <element name="strike">
678
690
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
691
+ <choice>
692
+ <ref name="PureTextElement"/>
693
+ <ref name="index"/>
694
+ <ref name="index-xref"/>
695
+ </choice>
680
696
  </zeroOrMore>
681
697
  </element>
682
698
  </define>
data/grammars/biblio.rng CHANGED
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <value>copied</value>
@@ -14,15 +14,13 @@ module RelatonJis
14
14
  #
15
15
  def search(code, year = nil)
16
16
  agent = Mechanize.new
17
- resp = agent.post "#{SOURCE}0010/searchByKeyword", search_type: "JIS",
18
- keyword: code
17
+ resp = agent.post "#{SOURCE}0270/index", dantai: "JIS", bunsyo_id: code, searchtype2: "1", status_1: "1", status_2: "1"
19
18
  disp = JSON.parse resp.body
20
19
  # raise RelatonBib::RequestError, "No results found for #{code}" if disp["disp_screen"].nil?
21
- return if disp["disp_screen"].nil?
20
+ return unless disp["status"]
22
21
 
23
- result = agent.get "#{SOURCE}#{disp['disp_screen']}/index"
24
- HitCollection.new code, year,
25
- result: result.xpath("//div[@class='blockGenaral']")
22
+ result = agent.get "#{SOURCE}0070/index"
23
+ HitCollection.new code, year, result: result.xpath("//div[@class='blockGenaral']")
26
24
  end
27
25
 
28
26
  #
@@ -38,6 +38,8 @@ module RelatonJis
38
38
 
39
39
  def find_all_years # rubocop:disable Metrics/AbcSize
40
40
  hits = @array.select { |hit| hit.eq? ref_parts }
41
+ return [] if hits.empty?
42
+
41
43
  item = hits.max_by { |i| i.id_parts[:year].to_i }.fetch
42
44
  item_id = item.docidentifier.first.id
43
45
  parent = item.to_most_recent_reference
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonJis
4
- VERSION = "1.16.2"
4
+ VERSION = "1.16.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 1.16.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: 2023-10-15 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize