rightmove_blm 0.2.8 → 0.2.9

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: 9ec340ad11adaadec9ee744185f62256797740385074cbf5a36d9913e5820bb7
4
- data.tar.gz: 796260e176480613f01e44120088dc3806e54eea0b45eda665a50dd1c1d984ab
3
+ metadata.gz: d7d70db570f43e185093f999f4463fd012c0c4a4f1de18d5650b4e2a138d5c3b
4
+ data.tar.gz: 88cb21e69f2f9d6f2b36b52344011994e93769bc18e51cace0d7cd9b71dca6b8
5
5
  SHA512:
6
- metadata.gz: 4b684cc031000728ae2e69674192bb5620c6189917ba157e0be33e59b98c50d9b089ccdba136c05cb5ac3c3a3efe96dc9b56a6428df4caa15cb2e049f87e2315
7
- data.tar.gz: 715ae92488da5080b281633c0d0d75e6c26162434492569356c10815fc5e51b3917b631da6c4bab28530db20e4385070255d7a988b08d82e3939299bba25d39b
6
+ metadata.gz: 5b6b2f69ff9c9a8faeded42dc79f74149a490a32bbfdb4273542c2e0d2d3ce897a037a913092235bf17fb4bfff82353036b0580eb9ce5f7ab93208a2cb889e29
7
+ data.tar.gz: 83ca8d3b612f8a15866f5c6bb0c29b47e60610137192c1f4470a49850a276d899dc35d3ed20912e590e82f3e0eb3724f13c149f57800d6139b944ae1da64afbf
data/README.md CHANGED
@@ -68,3 +68,9 @@ The keys from the first _hash_ in the provided _array_ are used to provide the f
68
68
  document = RightmoveBLM::Document.from_array_of_hashes([{ field1: 'foo', field2: 'bar' }, { field1: 'baz', field2: 'foobar' }])
69
69
  File.write('my_data.blm', document.to_blm)
70
70
  ```
71
+
72
+ To generate a Rightmove document with version 3i, provide `true` for the optional parameter `international`.
73
+
74
+ ```ruby
75
+ document = RightmoveBLM::Document.from_array_of_hashes([{ field1: 'foo', field2: 'bar' }, { field1: 'baz', field2: 'foobar' }], international: true)
76
+ ```
@@ -5,9 +5,10 @@ module RightmoveBLM
5
5
  class Document # rubocop:disable Metrics/ClassLength
6
6
  BLM_FILE_SECTIONS = %w[HEADER DEFINITION DATA END].freeze
7
7
 
8
- def self.from_array_of_hashes(array)
8
+ def self.from_array_of_hashes(array, international: false)
9
9
  date = Time.now.utc.strftime('%d-%b-%Y %H:%M').upcase
10
- header = { version: '3', eof: '^', eor: '~', 'property count': array.size.to_s, 'generated date': date }
10
+ version = international ? '3i' : '3'
11
+ header = { version: version, eof: '^', eor: '~', 'property count': array.size.to_s, 'generated date': date }
11
12
  new(header: header, definition: array.first.keys.map(&:to_sym), data: array)
12
13
  end
13
14
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RightmoveBLM
4
- VERSION = '0.2.8'
4
+ VERSION = '0.2.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rightmove_blm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-27 00:00:00.000000000 Z
11
+ date: 2024-08-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Parse and generate Rightmove BLM files
14
14
  email: git@bob.frl