uhaul 1.0.4 → 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: 29c3331c29dc2cd48a7e33f30e31e3c280f7256f6abea575baa11ead15711ebf
4
- data.tar.gz: 746ec6b6ae647cbcd52d04faeaddbea6bfb89c40df97ca40dc24d6f89e5e7182
3
+ metadata.gz: 6abdb81d3f63d578fd92845c756fd0bc0d4673b53ded8071c20e9568bdb04067
4
+ data.tar.gz: a0788d4f607f9774117d01e0e8590cdd01b46ce9f176dd8cb9b6feabd5a089b7
5
5
  SHA512:
6
- metadata.gz: 2865e42eafe083ef89b66a2f85bc72629a819c732708fed264d85c17285f24e20b4ece8db391b6337ef998e54e71b65594a71b64fd67697c3738e5849d876278
7
- data.tar.gz: 873042db4ee1d66f3c7086f80c8bac4e6789afe5e556c8c1a85c30377e9bdd948faea3c2a6101fad7314f9a95719a09abbac3d0ba3dabe301a62b4d4a3048b96
6
+ metadata.gz: 3b05f8006e9ddb4760c3c98dd2d40948e9df8d1a3752d6dead5a2a05844168c8d5be4a2aefa824f885d1a572dfbeaff725fd9eaa3828e49144691dd591f62293
7
+ data.tar.gz: e8658751bc9003a8f734b0517d283c6c310c498fc10fab282b89c34b70291219b798f3a48843fa933e48d18c02a041bef62fe377d832862d240edbfc87a1e589
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # UHaul
1
+ # U-Haul
2
2
 
3
3
  [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ksylvest/uhaul/blob/main/LICENSE)
4
4
  [![RubyGems](https://img.shields.io/gem/v/uhaul)](https://rubygems.org/gems/uhaul)
@@ -6,6 +6,8 @@
6
6
  [![Yard](https://img.shields.io/badge/docs-site-blue.svg)](https://uhaul.ksylvest.com)
7
7
  [![CircleCI](https://img.shields.io/circleci/build/github/ksylvest/uhaul)](https://circleci.com/gh/ksylvest/uhaul)
8
8
 
9
+ A Ruby library offering both a CLI and API for scraping [U-Haul](https://www.publicstorage.com/) self-storage facilities and prices.
10
+
9
11
  ## Installation
10
12
 
11
13
  ```bash
@@ -126,10 +126,10 @@ module UHaul
126
126
  def self.parse(url:, document:)
127
127
  data = parse_ld_json_script(document:)
128
128
 
129
- id = data['@id'].match(%r{(?<id>\d+)/#schema$})[:id]
129
+ id = data['@id'].match(%r{(?<id>\d+)/#})[:id]
130
130
  name = data['name']
131
131
 
132
- geocode = Geocode.parse(data: data['geo'])
132
+ geocode = Geocode.parse(data: data['geo'] || data['areaServed']['geoMidpoint'])
133
133
  address = Address.parse(data: data['address'])
134
134
  prices = document.css(PRICES_SELECTOR).map { |element| Price.parse(element:) }.compact
135
135
 
@@ -143,7 +143,7 @@ module UHaul
143
143
  # @return [Hash]
144
144
  def self.parse_ld_json_script(document:)
145
145
  parse_ld_json_scripts(document:).find do |data|
146
- data['@type'] == 'SelfStorage'
146
+ %w[SelfStorage LocalBusiness].include?(data['@type'])
147
147
  end || raise(ParseError, 'missing ld+json')
148
148
  end
149
149
 
data/lib/uhaul/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UHaul
4
- VERSION = '1.0.4'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uhaul
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
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-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -115,8 +115,9 @@ licenses:
115
115
  metadata:
116
116
  rubygems_mfa_required: 'true'
117
117
  homepage_uri: https://github.com/ksylvest/uhaul
118
- source_code_uri: https://github.com/ksylvest/uhaul
119
- changelog_uri: https://github.com/ksylvest/uhaul
118
+ source_code_uri: https://github.com/ksylvest/uhaul/tree/v1.1.0
119
+ changelog_uri: https://github.com/ksylvest/uhaul/releases/tag/v1.1.0
120
+ documentation_uri: https://uhaul.ksylvest.com/
120
121
  post_install_message:
121
122
  rdoc_options: []
122
123
  require_paths: