relaton-jis 1.14.4 → 1.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +2 -2
- data/grammars/biblio.rng +1 -1
- data/lib/relaton_jis/bibliography.rb +7 -6
- data/lib/relaton_jis/config.rb +10 -0
- data/lib/relaton_jis/hit_collection.rb +1 -1
- data/lib/relaton_jis/util.rb +9 -0
- data/lib/relaton_jis/version.rb +1 -1
- data/lib/relaton_jis.rb +6 -4
- data/relaton_jis.gemspec +1 -2
- metadata +6 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ee66af10fcc5b78823a228bc7ac31263f8cd52f9e8fbbfdfb47ac500eb9c4a
|
4
|
+
data.tar.gz: 68ddb0faf39ad33cd96edd29f072e41787b7c9fa262c5647768f12a481f5e2a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c365ed292ca2405923fc74b5f9f3682bf7c95aef6cf2caa4a54e7d479203b617a530a19bf17c5ff9efb9365781f5c4b603ae7d1ec51fd467ff235eb4eed230
|
7
|
+
data.tar.gz: 74d12f5337f22272db21fb76264a18b8d2be376d96f116ae6235f712388e4eb074d8c6a7806a24860be3ac560ff4d983899a043cf02d3b2183a03a0b2c39ce3f
|
data/README.adoc
CHANGED
@@ -78,7 +78,7 @@ Possible options:
|
|
78
78
|
[source,ruby]
|
79
79
|
----
|
80
80
|
item.to_xml
|
81
|
-
=> "<bibitem id="JISX0208-1997" type="standard" schema-version="v1.2.
|
81
|
+
=> "<bibitem id="JISX0208-1997" type="standard" schema-version="v1.2.4">
|
82
82
|
<fetched>2023-03-18</fetched>
|
83
83
|
<title format="text/plain" language="ja" script="Jpan">7ビット及び8ビットの2バイト情報交換用符号化漢字集合</title>
|
84
84
|
<title format="text/plain" language="en" script="Lant">7-bit and 8-bit double byte coded KANJI sets for information interchange</title>
|
@@ -86,7 +86,7 @@ item.to_xml
|
|
86
86
|
</bibitem>"
|
87
87
|
|
88
88
|
item.to_xml bibdata: true
|
89
|
-
=> "<bibdata type="standard" schema-version="v1.2.
|
89
|
+
=> "<bibdata type="standard" schema-version="v1.2.4">
|
90
90
|
<fetched>2023-03-18</fetched>
|
91
91
|
<title format="text/plain" language="ja" script="Jpan">7ビット及び8ビットの2バイト情報交換用符号化漢字集合</title>
|
92
92
|
<title format="text/plain" language="en" script="Lant">7-bit and 8-bit double byte coded KANJI sets for information interchange</title>
|
data/grammars/biblio.rng
CHANGED
@@ -36,7 +36,7 @@ module RelatonJis
|
|
36
36
|
def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
37
37
|
code = ref.sub(/\s\((all parts|規格群)\)/, "")
|
38
38
|
opts[:all_parts] ||= !$1.nil?
|
39
|
-
warn "
|
39
|
+
Util.warn "(#{ref}) fetching..."
|
40
40
|
hits = search(code, year)
|
41
41
|
unless hits
|
42
42
|
hint [], ref, year
|
@@ -44,7 +44,7 @@ module RelatonJis
|
|
44
44
|
end
|
45
45
|
result = opts[:all_parts] ? hits.find_all_parts : hits.find
|
46
46
|
if result.is_a? RelatonJis::BibliographicItem
|
47
|
-
warn "
|
47
|
+
Util.warn "(#{ref}) found `#{result.docidentifier[0].id}`"
|
48
48
|
return result
|
49
49
|
end
|
50
50
|
hint result, ref, year
|
@@ -58,12 +58,13 @@ module RelatonJis
|
|
58
58
|
# @param [String, nil] year year to search
|
59
59
|
#
|
60
60
|
def hint(result, ref, year)
|
61
|
-
warn "
|
62
|
-
|
61
|
+
Util.warn "(#{ref}) not found. The identifier must be " \
|
62
|
+
"exactly as shown on the webdesk.jsa.or.jp website."
|
63
63
|
if result.any?
|
64
|
-
warn "
|
65
|
-
|
64
|
+
Util.warn "(#{ref}) TIP: No match for edition year `#{year}`, " \
|
65
|
+
"but matches exist for `#{result.uniq.join('`, `')}`."
|
66
66
|
end
|
67
|
+
nil
|
67
68
|
end
|
68
69
|
end
|
69
70
|
end
|
@@ -64,7 +64,7 @@ module RelatonJis
|
|
64
64
|
docid = RelatonBib::DocumentIdentifier.new id: hit.hit[:id], type: "JIS", primary: true
|
65
65
|
fref = RelatonBib::FormattedRef.new content: hit.hit[:id]
|
66
66
|
bibitem = BibliographicItem.new docid: [docid], formattedref: fref
|
67
|
-
RelatonBib::DocumentRelation.new(type: "
|
67
|
+
RelatonBib::DocumentRelation.new(type: "instanceOf", bibitem: bibitem)
|
68
68
|
end
|
69
69
|
|
70
70
|
#
|
data/lib/relaton_jis/version.rb
CHANGED
data/lib/relaton_jis.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require "mechanize"
|
4
4
|
require "relaton_iso_bib"
|
5
5
|
require_relative "relaton_jis/version"
|
6
|
+
require_relative "relaton_jis/config"
|
7
|
+
require_relative "relaton_jis/util"
|
6
8
|
require_relative "relaton_jis/bibliographic_item"
|
7
9
|
require_relative "relaton_jis/xml_parser"
|
8
10
|
require_relative "relaton_jis/hash_converter"
|
@@ -17,9 +19,9 @@ module RelatonJis
|
|
17
19
|
# Returns hash of XML reammar
|
18
20
|
# @return [String]
|
19
21
|
def self.grammar_hash
|
20
|
-
gem_path = File.expand_path "..", __dir__
|
21
|
-
grammars_path = File.join gem_path, "grammars", "*"
|
22
|
-
grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
23
|
-
Digest::MD5.hexdigest grammars
|
22
|
+
# gem_path = File.expand_path "..", __dir__
|
23
|
+
# grammars_path = File.join gem_path, "grammars", "*"
|
24
|
+
# grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
25
|
+
Digest::MD5.hexdigest RelatonJis::VERSION + RelatonIsoBib::VERSION + RelatonBib::VERSION # grammars
|
24
26
|
end
|
25
27
|
end
|
data/relaton_jis.gemspec
CHANGED
@@ -35,8 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
# Uncomment to register a new dependency of your gem
|
37
37
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
39
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.14.0"
|
38
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.16.0"
|
40
39
|
|
41
40
|
# For more information and examples about making a new gem, check out our
|
42
41
|
# guide at: https://bundler.io/guides/creating_gem.html
|
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.
|
4
|
+
version: 1.16.1
|
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-
|
11
|
+
date: 2023-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -24,34 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.8.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: relaton-bib
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.14.9
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.14.9
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: relaton-iso-bib
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
33
|
+
version: 1.16.0
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
40
|
+
version: 1.16.0
|
55
41
|
description: 'RelatonJis: retrieve IETF Standards for bibliographic use using the
|
56
42
|
BibliographicItem model'
|
57
43
|
email:
|
@@ -74,11 +60,13 @@ files:
|
|
74
60
|
- lib/relaton_jis.rb
|
75
61
|
- lib/relaton_jis/bibliographic_item.rb
|
76
62
|
- lib/relaton_jis/bibliography.rb
|
63
|
+
- lib/relaton_jis/config.rb
|
77
64
|
- lib/relaton_jis/hash_converter.rb
|
78
65
|
- lib/relaton_jis/hit.rb
|
79
66
|
- lib/relaton_jis/hit_collection.rb
|
80
67
|
- lib/relaton_jis/processor.rb
|
81
68
|
- lib/relaton_jis/scraper.rb
|
69
|
+
- lib/relaton_jis/util.rb
|
82
70
|
- lib/relaton_jis/version.rb
|
83
71
|
- lib/relaton_jis/xml_parser.rb
|
84
72
|
- relaton_jis.gemspec
|