nsastorage 0.4.0 → 0.6.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: 53128971c4bb0dae9a2b76344d4dc84ac86293920d4ddcf21e3addeb8ecb7e81
4
- data.tar.gz: cf0483911e2f2aae47f3bd80b4c14337688d920c4712e7862ea4ceeba1e1b734
3
+ metadata.gz: a4d918b2110c0e1df2d740c64403576da6c632ff1f69d112a891827a0b5aacfc
4
+ data.tar.gz: 858a338369573c4b01386d3b6503073d50ec9df7425674194c87d0b85b4712f0
5
5
  SHA512:
6
- metadata.gz: 6444fea2908d37b7363557bfd2381564c4fd51f27283acb596d768d8dabf5bb04b4eda29929e4e71a088b05e9100cd3219efdd245525dda4e5026df7a044a24b
7
- data.tar.gz: 1cdc3d5f72ac6a175df7568a0b9eaac067d6f1e782c14452c9a6e02146302743c715063f70bc90722799f878f14fb884aba977f6a4e9b7695d6a188166ed7dad
6
+ metadata.gz: c12176571244e306c3080fc8047e846232c2592caf1be2ddd575ead1f908bba93d7b5bb77adfbd471145fa01619d497b9f0458e27d99af2c9598664a7674b937
7
+ data.tar.gz: 36fdf5ba24f0957a001de782db1f55032a86784e2a0efea156db463ab56d2efa13353a9f6d0d64d61b9ef8ab91db4468d2ea6394dd5a7f81f39a0deb8ba1d501
@@ -3,7 +3,7 @@
3
3
  module NSAStorage
4
4
  # The price (id + dimensions + rate) for a facility.
5
5
  class Price
6
- ID_REGEX = %r{(?<id>\d+)/rent/}
6
+ ID_REGEX = %r{(?<id>\d+)/(?:rent|reserve)/}
7
7
  PRICE_SELECTOR = '[data-unit-size="small"],[data-unit-size="medium"],[data-unit-size="large"]'
8
8
 
9
9
  # @attribute [rw] id
@@ -62,7 +62,7 @@ module NSAStorage
62
62
  #
63
63
  # @return [Price]
64
64
  def self.parse(element:)
65
- link = element.at_xpath("//a[contains(text(), 'Rent')]|//a[contains(text(), 'Reserve')]")
65
+ link = element.at_xpath(".//a[contains(text(), 'Rent')]|//a[contains(text(), 'Reserve')]")
66
66
  new(
67
67
  id: ID_REGEX.match(link['href'])[:id],
68
68
  dimensions: Dimensions.parse(element:),
@@ -19,7 +19,7 @@ module NSAStorage
19
19
  Link.new(loc:, lastmod:)
20
20
  end
21
21
 
22
- new(links: links.filter { |link| link.loc.match(%r{/storage/}) })
22
+ new(links: links.filter { |link| link.loc.match(%r{/storage/.*/\d+}) })
23
23
  end
24
24
 
25
25
  # @param url [String]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NSAStorage
4
- VERSION = '0.4.0'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsastorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre