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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c4c2984fb3fcab2b642ec7b046aa6912d6f48bcc472b8eab85ca641d53e624d
4
- data.tar.gz: c65250ff70392cb0542df01b85007784e6ced5c92059d36912143e14c73cbe60
3
+ metadata.gz: c2ee66af10fcc5b78823a228bc7ac31263f8cd52f9e8fbbfdfb47ac500eb9c4a
4
+ data.tar.gz: 68ddb0faf39ad33cd96edd29f072e41787b7c9fa262c5647768f12a481f5e2a7
5
5
  SHA512:
6
- metadata.gz: 26ce98826e2078f8e6567a93bc9cdb8a4c6936b91eb38a93d00e46b41bfe45a13e6b4bbd204a11baa9d3e21e1790a5276a473738aa86ec98d88c0cbd965e3f59
7
- data.tar.gz: ddbdf26d69c115fc63e2cd28486cb0737b217d193e4be36925dbe2476215aed8b3abad4e08e0952064436ee6ef7408907355c0d76abc831543dbd7c6d4fb50bf
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.3">
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.3">
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
@@ -1283,7 +1283,7 @@
1283
1283
  <value>mergedInto</value>
1284
1284
  <value>splits</value>
1285
1285
  <value>splitInto</value>
1286
- <value>instance</value>
1286
+ <value>instanceOf</value>
1287
1287
  <value>hasInstance</value>
1288
1288
  <value>exemplarOf</value>
1289
1289
  <value>hasExemplar</value>
@@ -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 "[relaton-jis] (\"#{ref}\") fetching..."
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 "[relaton-jis] (\"#{ref}\") found #{result.docidentifier[0].id}"
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 "[relaton-jis] (\"#{ref}\") not found. The identifier must be " \
62
- "exactly as shown on the webdesk.jsa.or.jp website."
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 "[relaton-jis] (\"#{ref}\") TIP: No match for edition " \
65
- "year #{year}, but matches exist for #{result.uniq.join(', ')}."
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
@@ -0,0 +1,10 @@
1
+ module RelatonJis
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-jis".freeze
9
+ end
10
+ 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: "instance", bibitem: bibitem)
67
+ RelatonBib::DocumentRelation.new(type: "instanceOf", bibitem: bibitem)
68
68
  end
69
69
 
70
70
  #
@@ -0,0 +1,9 @@
1
+ module RelatonJis
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonJis.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonJis
4
- VERSION = "1.14.4"
4
+ VERSION = "1.16.1"
5
5
  end
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.14.9"
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.14.4
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-06-17 00:00:00.000000000 Z
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.14.0
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.14.0
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