relaton-cie 1.19.0 → 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: b4142b95abcc0f744193c75ef4e3ecb8b29948385646984a24fec705ad67a0f8
4
- data.tar.gz: 7de37e66804ad9a8d1c499fee44074257c3644dd031728d736576d985aa4291f
3
+ metadata.gz: 7a7108ae1a1479d11a47caf4f9cbaae2d478416a408c562ebbb80c5143651d09
4
+ data.tar.gz: 550e5f6b03a3ecbd1f0f3decb42244cc15138ee53409676454e7ebc36f82a78c
5
5
  SHA512:
6
- metadata.gz: 07c7da3c87d3995c8bf4f75a80a05c4fe5d56263b8fb9b80c2ccc59c4d87accaa7b5875611f9a5c61185420c55f0db18a5372f6ada9fa2468d6ab05574100a44
7
- data.tar.gz: d3bb0f001a1375c3e4a1db3f6ebf6dd4fcad476b0627d24c18b5f4bbb685d7592a6e5015d37308c15d3a105781cadef1e8abaf3b247c6d2040e578b73de5c81a
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,6 +1,6 @@
1
1
  module RelatonCie
2
2
  module Scrapper
3
- ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-cie/master/".freeze
3
+ ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-cie/main/".freeze
4
4
  INDEX_FILE = "index-v1.yaml".freeze
5
5
 
6
6
  class << self
@@ -1,3 +1,3 @@
1
1
  module RelatonCie
2
- VERSION = "1.19.0".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.0
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-03 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.'