relaton-cie 1.19.1 → 1.20.0

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: 627b1bcb3a18832150a60b686359abb325bdaa25301642e70dcfbc42d002f18e
4
- data.tar.gz: 3bdf913d421a7e46a36104b2a11a3ae64a4fd0c1f64ca683c9530eced7562a05
3
+ metadata.gz: 7a7108ae1a1479d11a47caf4f9cbaae2d478416a408c562ebbb80c5143651d09
4
+ data.tar.gz: 550e5f6b03a3ecbd1f0f3decb42244cc15138ee53409676454e7ebc36f82a78c
5
5
  SHA512:
6
- metadata.gz: 50b3583178756e980ef3cf7e22deff8a960d6d5a962d1c50ecad44cff4a051b4786e37d5dc9cccc891809cf7ca7115cc29d5783808db43b8af7ad2a184512378
7
- data.tar.gz: aa3b3187b62363dda6e32c5aa174f63fa0a337b3384d5e84307d5dbaffa5799fa274de0cc461987271207af7e457391ba32a0310d92d4156afc0167ff79f6b5b
6
+ metadata.gz: 8d030cfb895d9f3c3e400e69e5ce629f42c828d4c71b144858039667029e3c887dd63f5192f64e4a796f5f562ce143ea6016389c7ace9e043522366d218f8d3b
7
+ data.tar.gz: 5855c9f89afa11d6ecc81320450039f4b64aa3cc6bd50e9b0fec041127c5848194a88ba5e12d1cce82a9c9514eb9dee6e853d5554f2b790c6f2df447385fa904
@@ -17,7 +17,18 @@ module RelatonCie
17
17
  end
18
18
 
19
19
  def agent
20
- @agent ||= Mechanize.new
20
+ return @agent if @agent
21
+
22
+ @agent = Mechanize.new
23
+ @agent.request_headers = {
24
+ "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
25
+ "Accept-Language" => "en-US,en;q=0.5",
26
+ "Connection" => "keep-alive",
27
+ "sec-ch-ua" => '"Chromium";v="91", "Google Chrome";v="91", ";Not A Brand";v="99"',
28
+ "Sec-Fetch-Dest" => "document"
29
+ }
30
+ @agent.user_agent_alias = "Linux Firefox"
31
+ @agent
21
32
  end
22
33
 
23
34
  def index
@@ -139,17 +150,18 @@ module RelatonCie
139
150
  (?:,?\s(?<sname2>[\w-]{2,})(?=,\s+\w\.))?
140
151
  (?:,?\s(?<fname>[\w-]{2,})(?!,\s+\w\.))?
141
152
  (?:(?:\s?,\s?|\s)(?<init>(?:\w(?:\s?\.|\s|,|$)[\s-]?)+))?
142
- (?:(?:,\s*|\s+|\.|(?<=\s))(?:and\s)?)?/x =~ authors
153
+ (?:(?:[,;]\s*|\s+|\.|(?<=\s))(?:and\s)?)?/x =~ authors
143
154
  raise StandardError, "Author name not found in \"#{authors}\"" unless $LAST_MATCH_INFO
144
155
 
145
156
  authors.sub! $LAST_MATCH_INFO.to_s, ""
146
157
  sname = [sname1, sname2].compact.join " "
147
158
  surname = RelatonBib::LocalizedString.new sname, "en", "Latn"
148
- initial = (init&.strip || "").split(/(?:,|\.)(?:-|\s)?/).map do |int|
149
- RelatonBib::LocalizedString.new(int.strip, "en", "Latn")
159
+ forename = []
160
+ forename << RelatonBib::Forename.new(content: fname, language: "en", script: "Latn") if fname
161
+ (init&.strip || "").split(/(?:,|\.)(?:-|\s)?/).each do |int|
162
+ forename << RelatonBib::Forename.new(content: "", initial: int.strip, language: "en", script: "Latn")
150
163
  end
151
- forename = fname ? [RelatonBib::LocalizedString.new(fname, "en", "Latn")] : []
152
- fullname = RelatonBib::FullName.new surname: surname, forename: forename, initial: initial
164
+ fullname = RelatonBib::FullName.new surname: surname, forename: forename
153
165
  person = RelatonBib::Person.new name: fullname
154
166
  contribs << { entity: person, role: [{ type: "author" }] }
155
167
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonCie
2
- VERSION = "1.19.1".freeze
2
+ VERSION = "1.20.0".freeze
3
3
  end
data/relaton_cie.gemspec CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency "mechanize", "~> 2.10"
33
33
  spec.add_dependency "parslet", "~> 2.0.0"
34
- spec.add_dependency "relaton-bib", "~> 1.19.0"
34
+ spec.add_dependency "relaton-bib", "~> 1.20.0"
35
35
  spec.add_dependency "relaton-index", "~> 0.2.0"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.1
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-31 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.19.0
47
+ version: 1.20.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.19.0
54
+ version: 1.20.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: relaton-index
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ licenses:
109
109
  - BSD-2-Clause
110
110
  metadata:
111
111
  homepage_uri: https://github.com/metanorma/relaton-cie
112
- post_install_message:
112
+ post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths:
115
115
  - lib
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubygems_version: 3.3.27
128
- signing_key:
128
+ signing_key:
129
129
  specification_version: 4
130
130
  summary: 'RelatonEcma: retrieve CIE Standards for bibliographic use using the BibliographicItem
131
131
  model.'