rightmove_blm 0.2.3 → 0.2.4

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: d47e3147eefd5503a6f72579b89a3009c2cd54f12e8103403d320b25f11aa414
4
- data.tar.gz: 1e74f8d0a87a1ba9896525eec622d4b86612ec4c218807740b3c1a90642bd423
3
+ metadata.gz: adcdd9888460d3dde61600d67eb0a610fbbb971b268220a54d1eb10e66198ac2
4
+ data.tar.gz: ed1f65811a5f46e3462891e16db3b9e90a632fc2d7c7466c4d34983c72bfc3cd
5
5
  SHA512:
6
- metadata.gz: '08f19c96d3dc41020b8d1750c3e1863745984128191911c3144319f7cbe884402288a9ef944f0f72c043cb7ce3246d2d87bebbbbdaec340243090aefcc65d0b1'
7
- data.tar.gz: 1a2f3a7879e88d59ed174d9b9c46905ab8c5280737b17050c04aa20c86d93fdaf0a3cd43a76dca0894a5c2f754ef3671527c3e9ef4163440f965a126ff1bee59
6
+ metadata.gz: e1777617db9d0efacdfbecc1ba3a07302c76f7e1f5a519847e08e33b4c05c6ec9b4cb3973ae235a8ba4c6e7a04db5657fb21b51ace24c2e1b8b6017c8b2a0e86
7
+ data.tar.gz: 73698ab1fb45cdaa69d8628cea64c0ae79595da5803d8c71dc339453047e0058027d4faba928468f432b40bd05c2de50c908c66c832c27c2f5e0c224b93425db
@@ -2,7 +2,7 @@
2
2
 
3
3
  module RightmoveBLM
4
4
  # A BLM document including its header, definition, and data content.
5
- class Document
5
+ class Document # rubocop:disable Metrics/ClassLength
6
6
  def self.from_array_of_hashes(array)
7
7
  date = Time.now.utc.strftime('%d-%b-%Y %H:%M').upcase
8
8
  header = { version: '3', eof: '^', eor: '~', 'property count': array.size.to_s, 'generated date': date }
@@ -95,6 +95,8 @@ module RightmoveBLM
95
95
  start = verify(:start, @source.index(marker)) + marker.size
96
96
  finish = verify(:end, @source.index('#END#', start)) - 1
97
97
  @source[start..finish].strip
98
+ rescue Encoding::CompatibilityError => e
99
+ raise_parser_error 'Unable to parse document due to encoding error.', e
98
100
  end
99
101
 
100
102
  def normalized_key(key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RightmoveBLM
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rightmove_blm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell