relaton-oasis 1.19.0 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17e6c9703f4210dd9ce8674da36d2f55d3333adeae4327cead1916500568f379
4
- data.tar.gz: b1949a584249b5b509e1b8178de12b9abd8c1c8cb8ca03da620ce7c2a8cb9d2e
3
+ metadata.gz: '059c9095e075837ee20e566e3b70ec434bb2626b3cb70c80ff17f87dbe73ad24'
4
+ data.tar.gz: 2189309eeca6c4b9f940e679bfcd3ed16749264568e5bcdaba0cb54b77ed6f71
5
5
  SHA512:
6
- metadata.gz: fba601c6195bb9bacc28fa4ed4e58f6ed0d1fdcaa944f313c1019b96e5b371e0c606214fe1ccc116bbf0e0e4195480fdf04ad40951a41819a8e3652a537dde8e
7
- data.tar.gz: f2e4fc968c99c09d0704692221fbd16a1427e26001d22c1fff5c39816c5a39501a0c4ddf05ed21ea55163e8e61ebff3b6f673850190368c8b6f6b212fc8a30ee
6
+ metadata.gz: fa6a9e250ca136861488337970a298cc556961e17bddfca0bbfcd9500924236d284277615f14b1d69b843c70576f93c6c8ff4707c48a526618cbe72388836fc5
7
+ data.tar.gz: 52a747acff05de3ba35fa674f206cdf2f297436a94e302d93fdc4d15b98775b535ed0cc1635116232e49576527c77b2ea44d764449e96d364ba307ef1b823c3d
@@ -93,7 +93,25 @@ module RelatonOasis
93
93
  def contact(email)
94
94
  return [] unless email
95
95
 
96
- [RelatonBib::Contact.new(type: "email", value: email[:href].split(":")[1])]
96
+ addr = email_address(email[:href])
97
+ return [] unless addr
98
+
99
+ [RelatonBib::Contact.new(type: "email", value: addr)]
100
+ end
101
+
102
+ def email_address(href)
103
+ if href.start_with?("mailto:")
104
+ href.split(":", 2)[1]
105
+ elsif href.include?("/cdn-cgi/l/email-protection#")
106
+ decode_cfemail(href.split("#", 2)[1])
107
+ end
108
+ end
109
+
110
+ # Decode Cloudflare email-obfuscation hex string: first byte is the XOR
111
+ # key, each subsequent byte XOR'd with the key yields one ASCII char.
112
+ def decode_cfemail(hex)
113
+ key = hex[0, 2].to_i(16)
114
+ hex[2..].scan(/../).map { |p| (p.to_i(16) ^ key).chr }.join
97
115
  end
98
116
 
99
117
  def affiliation(org)
@@ -5,6 +5,12 @@ module RelatonOasis
5
5
 
6
6
  @@acronyms = nil
7
7
 
8
+ def hash_to_bib(hash)
9
+ ret = super
10
+ ret[:technology_area] = ret[:ext][:technology_area] if ret.dig(:ext, :technology_area)
11
+ ret
12
+ end
13
+
8
14
  private
9
15
 
10
16
  # @param item_hash [Hash]
@@ -74,10 +74,14 @@ module RelatonOasis
74
74
  #
75
75
  def to_hash(embedded: false)
76
76
  hash = super
77
- hash["technology_area"] = technology_area if technology_area.any?
77
+ hash["ext"]["technology_area"] = technology_area if technology_area.any?
78
78
  hash
79
79
  end
80
80
 
81
+ def has_ext?
82
+ super || technology_area.any?
83
+ end
84
+
81
85
  #
82
86
  # Render bibliographic item as AsciiBib.
83
87
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonOasis
4
- VERSION = "1.19.0"
4
+ VERSION = "1.20.1"
5
5
  end
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_dependency "mechanize", "~> 2.10"
35
35
  spec.add_dependency "multi_json", "~> 1.15.0"
36
- spec.add_dependency "relaton-bib", "~> 1.19.0"
36
+ spec.add_dependency "relaton-bib", "~> 1.20.0"
37
37
  spec.add_dependency "relaton-index", "~> 0.2.0"
38
38
 
39
39
  # For more information and examples about making a new gem, checkout our
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-oasis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.20.1
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-04 00:00:00.000000000 Z
11
+ date: 2026-04-22 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
@@ -112,7 +112,7 @@ licenses:
112
112
  metadata:
113
113
  homepage_uri: https://github.com/metanorma/relaton-oasis
114
114
  source_code_uri: https://github.com/metanorma/relaton-oasis
115
- post_install_message:
115
+ post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths:
118
118
  - lib
@@ -127,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.3.27
131
- signing_key:
130
+ rubygems_version: 3.5.22
131
+ signing_key:
132
132
  specification_version: 4
133
133
  summary: 'RelatonOasis: retrieve OASIS Standards for bibliographic use using the BibliographicItem
134
134
  model'