db_blaster 0.1.4 → 0.1.5

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: 9313d3abe0bd4dcaa756dab6b07b1d65eb6438b435c914d18f9d38964f08a29d
4
- data.tar.gz: c694940facb41fb3656d011baba720ffb5f66cf124472f945d7de45661ba90b5
3
+ metadata.gz: 2de00cf222282fde0e0a3e38078ccc398a80ff19c41ccf7b79ecd043450db6b1
4
+ data.tar.gz: 66b93222044a44bcd7dd35a6233de5c4839a58d5106e527a7d540be2daee9821
5
5
  SHA512:
6
- metadata.gz: c045adce6f5a4fb70be59194f6f4630879761011be805dbed09c9be225a415a807ffe60a2b33ccf5361e49ce595b87250f8b0e67f370c29d867254928a36e41f
7
- data.tar.gz: 4b509898ced3205b588248700a75a375ddc6c614611298f0af347ef1a45b35f4c3d1adc9ae0a70d357c56050f47a7225d454564c22a350a21cec45da0effe322
6
+ metadata.gz: 7305baf42dff923be85d8105625bf3ccf8200988d7895c80202a32232b062a9c613863a002a7b8e57d7e57a3660725ab4ed6765d2b2d3ba49f3b216da2614dac
7
+ data.tar.gz: 8652430ce86f2ee275997ec35e52bf2ba99befa4c3a8630b13e0ca57f309d4b0fb013974806e52882bc37bd95a6c4e9e9d4ea51fa5a2096d2767df0d3608b796
@@ -32,8 +32,7 @@ module DbBlaster
32
32
  # Applicable only when `s3_bucket' is set
33
33
  # The value set here will be included in every payload pushed to S3
34
34
  # example: config.s3_meta = {'infra_id' => '061', 'source_app' => 'kcp-api'}}
35
- # The resulting JSON:
36
- # {"meta" : {"infra_id" : "061", "src_app" : "kcp-api", "src_table" : "the-table"}, "records" : [] }
35
+ # The resulting JSON will include the `meta` merged into every record
37
36
  attr_accessor :s3_meta
38
37
 
39
38
  # Optional
@@ -14,8 +14,7 @@ module DbBlaster
14
14
  end
15
15
 
16
16
  def content
17
- { meta: meta,
18
- records: records }
17
+ meta_records
19
18
  end
20
19
 
21
20
  def tagging
@@ -28,7 +27,11 @@ module DbBlaster
28
27
  end
29
28
 
30
29
  def meta
31
- (DbBlaster.configuration.s3_meta.presence || {}).merge(source_table: source_table.name)
30
+ @meta ||= (DbBlaster.configuration.s3_meta.presence || {}).merge(source_table: source_table.name)
31
+ end
32
+
33
+ def meta_records
34
+ records.collect { |record| record.merge(meta) }
32
35
  end
33
36
 
34
37
  def client
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DbBlaster
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
@@ -32,8 +32,7 @@ DbBlaster.configure do |config|
32
32
  # Applicable only when `s3_bucket' is set
33
33
  # Extra meta values sent along with each payload
34
34
  # example: config.s3_meta = {'infra_id' => '061'}
35
- # The resulting JSON:
36
- # {"meta" : {"infra_id" : "061", "source_app" : "kcp-api", "src_table" : "the-table"}, "records" : [] }
35
+ # The resulting JSON will include the `meta` merged into every record.
37
36
  # config.s3_meta = {'infra_id' => '061'}
38
37
 
39
38
  # Optional
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_blaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perry Hertler