relaton-jis 1.16.0 → 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/lib/relaton_jis/bibliography.rb +7 -6
- data/lib/relaton_jis/config.rb +10 -0
- data/lib/relaton_jis/util.rb +9 -0
- data/lib/relaton_jis/version.rb +1 -1
- data/lib/relaton_jis.rb +6 -4
- metadata +4 -2
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
|
@@ -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
|
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
|
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.
|
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-09-
|
11
|
+
date: 2023-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -60,11 +60,13 @@ files:
|
|
60
60
|
- lib/relaton_jis.rb
|
61
61
|
- lib/relaton_jis/bibliographic_item.rb
|
62
62
|
- lib/relaton_jis/bibliography.rb
|
63
|
+
- lib/relaton_jis/config.rb
|
63
64
|
- lib/relaton_jis/hash_converter.rb
|
64
65
|
- lib/relaton_jis/hit.rb
|
65
66
|
- lib/relaton_jis/hit_collection.rb
|
66
67
|
- lib/relaton_jis/processor.rb
|
67
68
|
- lib/relaton_jis/scraper.rb
|
69
|
+
- lib/relaton_jis/util.rb
|
68
70
|
- lib/relaton_jis/version.rb
|
69
71
|
- lib/relaton_jis/xml_parser.rb
|
70
72
|
- relaton_jis.gemspec
|