rightmove_blm 0.2.7 → 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: 166ef6856134e6ffc3120ae6523fa5a5498c6b428e5b23e9804c83ec3e7894d7
4
- data.tar.gz: dd041ad21667251d555b69d7be9759acd1f78a12239f06f02f91927e5b1d4f62
3
+ metadata.gz: d7d70db570f43e185093f999f4463fd012c0c4a4f1de18d5650b4e2a138d5c3b
4
+ data.tar.gz: 88cb21e69f2f9d6f2b36b52344011994e93769bc18e51cace0d7cd9b71dca6b8
5
5
  SHA512:
6
- metadata.gz: a0f349072827d6804c7c84736886989bdaa15511dc53001095d7e31f7d596f1a8b196fdd9c6349100d6ba9002265971a2f897bb7e07402d94debde352d599fc1
7
- data.tar.gz: b89b53b4db44f2f2552aa00e2d4b664fbedc595543967d4a8475007ebccae4e4c05846b353b2e5e451ec41e6fc59f6be7524a41dc1585848125dc59ed4a93b8a
6
+ metadata.gz: 5b6b2f69ff9c9a8faeded42dc79f74149a490a32bbfdb4273542c2e0d2d3ce897a037a913092235bf17fb4bfff82353036b0580eb9ce5f7ab93208a2cb889e29
7
+ data.tar.gz: 83ca8d3b612f8a15866f5c6bb0c29b47e60610137192c1f4470a49850a276d899dc35d3ed20912e590e82f3e0eb3724f13c149f57800d6139b944ae1da64afbf
data/Gemfile.lock CHANGED
@@ -67,4 +67,4 @@ DEPENDENCIES
67
67
  strong_versions (~> 0.4.5)
68
68
 
69
69
  BUNDLED WITH
70
- 2.3.7
70
+ 2.4.10
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
 
@@ -78,7 +79,7 @@ module RightmoveBLM
78
79
  end
79
80
 
80
81
  def international?
81
- %w[H1 3I].include?(version)
82
+ %w[H1 3I 3i].include?(version)
82
83
  end
83
84
 
84
85
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RightmoveBLM
4
- VERSION = '0.2.7'
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.7
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-01-10 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