cubesmart 1.0.0 → 1.1.0

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: 9f6ca103f9053e6250a85a42aa2a374edefdd702195777acbc7b3434e86b3775
4
- data.tar.gz: b5852885f4fba9a2e9976c675a43d655afaf3cc1b090930b4d80a790c70b097b
3
+ metadata.gz: 89a8211985a4edd3d2fb3f1245b04ae1a56e950146dd8775bb75eaa413258c15
4
+ data.tar.gz: 92defa8749a9f4d98f1631944fc0e1cb181cc4a6be2561f9db5a28c98b414db4
5
5
  SHA512:
6
- metadata.gz: 3ac76e5460e15ec7f7f26acce3aca8682e01f63d81e41ba408588089da2458c7514e12990e6d6e1f27544a26e59055a3ccd1a6456913e61446ea7a0a55fdee5b
7
- data.tar.gz: 3a3ed1f456a2740714cd240058ced94d2e7dc9b7cbef5a8c49742d3f395f7da27b93bd9aebd2242db032a3e682fe93d1debb696976b3be776b7241b0a7012ba8
6
+ metadata.gz: 9839b1876a9b19b14f91c865dbb49f27497d81018e2f1d1b81c71a195f9a0ab4e87de1935f2528e645dc1f223a83c48d6d718d06eb5e4cbd84929fcbd7d7b08d
7
+ data.tar.gz: 2cea9e4994ca848d2e0bebff08f82d03c18349ad3a9be3e1997ce41c1694fb73b68dec9f6412135d66b5b43d55654831188559af222193d673056be7f355fad4
@@ -85,8 +85,17 @@ module CubeSmart
85
85
  #
86
86
  # @return [Hash]
87
87
  def self.parse_json_ld(document:)
88
- graph = JSON.parse(document.at_xpath('//script[contains(text(), "@graph")]').text)['@graph']
89
- graph.find { |entry| entry['@type'] == 'SelfStorage' } || raise(ParseError, 'missing @graph')
88
+ scripts = document.xpath('//script[contains(text(), "@graph")]')
89
+
90
+ scripts.each do |script|
91
+ graph = JSON.parse(script)['@graph']
92
+ entry = graph.find { |entry| entry['@type'] == 'SelfStorage' }
93
+ return entry if entry
94
+ rescue JSON::ParseError
95
+ next
96
+ end
97
+
98
+ raise(ParseError, 'missing @graph for @type of "SelfStorage"')
90
99
  end
91
100
 
92
101
  # @param id [String]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CubeSmart
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cubesmart
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-18 00:00:00.000000000 Z
11
+ date: 2025-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -115,8 +115,8 @@ licenses:
115
115
  metadata:
116
116
  rubygems_mfa_required: 'true'
117
117
  homepage_uri: https://github.com/ksylvest/cubesmart
118
- source_code_uri: https://github.com/ksylvest/cubesmart/tree/v1.0.0
119
- changelog_uri: https://github.com/ksylvest/cubesmart/releases/tag/v1.0.0
118
+ source_code_uri: https://github.com/ksylvest/cubesmart/tree/v1.1.0
119
+ changelog_uri: https://github.com/ksylvest/cubesmart/releases/tag/v1.1.0
120
120
  documentation_uri: https://cubesmart.ksylvest.com/
121
121
  post_install_message:
122
122
  rdoc_options: []