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 +4 -4
- data/lib/rightmove_blm/document.rb +3 -1
- data/lib/rightmove_blm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adcdd9888460d3dde61600d67eb0a610fbbb971b268220a54d1eb10e66198ac2
|
4
|
+
data.tar.gz: ed1f65811a5f46e3462891e16db3b9e90a632fc2d7c7466c4d34983c72bfc3cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|