relaton-jis 1.19.0 → 1.19.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: 53da4fedaab9f861ce6b3d306c232e00e40af65cb3d4d1e7f8977a26441c3594
4
- data.tar.gz: 60019731d68c3b3bf520fbc99f2e7d4bc09e616fc03d470b58044867bb94820f
3
+ metadata.gz: c223759d15403f399f92edd2272b156b0e3c7f6c7dc274babb6b24cf02f99326
4
+ data.tar.gz: 387192eb0a06f3f0cca389decf2e0aa9d13193aed0f52d0e8949c7089ce77b99
5
5
  SHA512:
6
- metadata.gz: 4b8bcf1d6a2ca662b03bcf6ba2e92583932056dc387f82fcbca7acdaba9403f07164e71c7f294b9c1a06cade4fa1c3447e5caa0dbc8b1f7040a8f4ef610356ae
7
- data.tar.gz: 2ce6c3f8eb2f284b66743d2b55d4a57eba9cceb2d26fba33a2a5b568a8786058b27f505ea275740e9d09f601042824cfd365d184f41f0b94d5b5b4c1ff89e8e5
6
+ metadata.gz: a1ceb478a730fba7ce00809420161cc996b1ade2e3d590fab98c75668ee1450df0be2daebf1f5e3cedd8fe099121bd5e2ed01d73b56b5b755afee12e2a009302
7
+ data.tar.gz: 1c7fe1151443babf282595293d6c41f5945fe75d56481f06edd60a5c00f61b15f9ff65a428de6827494f08df3a64f5eb620a6fdb2f1832f826d4de346dee28f7
@@ -120,13 +120,25 @@ module RelatonJis
120
120
  end
121
121
 
122
122
  def fetch_contributor
123
- @doc.xpath("./table/tr[th[.='原案作成団体']]/td").map do |node|
124
- name = RelatonBib::LocalizedString.new node.text.strip, "ja", "Jpan"
125
- org = RelatonBib::Organization.new name: name
126
- RelatonBib::ContributionInfo.new entity: org, role: [type: "author"]
123
+ @doc.xpath("./table/tr[th[.='原案作成団体']]/td").reduce([]) do |a, node|
124
+ a << create_contrib(node, "author")
125
+ a << create_contrib(node, "publisher")
127
126
  end
128
127
  end
129
128
 
129
+ def create_contrib(node, role)
130
+ org = RelatonBib::Organization.new name: create_orgname(node)
131
+ RelatonBib::ContributionInfo.new entity: org, role: [type: role]
132
+ end
133
+
134
+ def create_orgname(node)
135
+ name = [RelatonBib::LocalizedString.new(node.text.strip, "ja", "Jpan")]
136
+ if node.text.include?("日本規格協会")
137
+ name << RelatonBib::LocalizedString.new("Japanese Industrial Standards", "en", "Latn")
138
+ end
139
+ name
140
+ end
141
+
130
142
  def fetch_editorialgroup
131
143
  node = @doc.at("./table/tr[th[.='原案作成団体']]/td")
132
144
  return unless node
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonJis
4
- VERSION = "1.19.0"
4
+ VERSION = "1.19.1"
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.19.0
4
+ version: 1.19.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: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize