turbine_rb 0.2.1 → 0.2.3

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: 62316927d652aef0b27ec9a324d2341d81d4a2181f6ddd496a5ffae24c13abdd
4
- data.tar.gz: f875f7ebec9024cae2858c6d70bde6123070727d1176d85ba3e312956126c846
3
+ metadata.gz: 0a11f956824241734f8451193c425926e41b445beaaafa666646f232fd29b161
4
+ data.tar.gz: '03494bc92e293ea4e6d5661e91697805617a627d23cae8147b0a455b22d4b50f'
5
5
  SHA512:
6
- metadata.gz: 31005fa778f97bc5bcbd8560f418540f906f6a10d44a08121a64691e9c0e764cb369fcf5315f7222420f3fc0760e48a846c696f752befa493094793d5cd17bab
7
- data.tar.gz: ead41b4f99a0fc52226568149dee48b338267b295a6e57ca9a89cbd123fb57da2069fa8fad6b84bb3a8fe1ce586954ae7812699612c86f677ea6a4780334f9f2
6
+ metadata.gz: a10a974df6771cd2803a5fca00647f212bc2278b08ce52ad6e2181fdd32ae1ed66af6987143252f1ee27422911ec77af6d2e2f9fe52c3a852037c740e05baf9a
7
+ data.tar.gz: 5dc38c122a76db77821b85436bdce71d6c775d6c2be0a8694bcae1d2ea8d7db5c8baa5a60e9cf8e1ebaa6a0fbde120fbce78ad374650510923d5f2d0950bbfb0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbine_rb (0.2.1)
4
+ turbine_rb (0.2.3)
5
5
  grpc (~> 1.48)
6
6
  hash_dot (~> 2.5.0)
7
7
 
@@ -14,9 +14,9 @@ GEM
14
14
  diff-lcs (1.5.0)
15
15
  ffi (1.15.5)
16
16
  formatador (1.1.0)
17
- google-protobuf (3.21.11)
18
- google-protobuf (3.21.11-x86_64-darwin)
19
- google-protobuf (3.21.11-x86_64-linux)
17
+ google-protobuf (3.21.12)
18
+ google-protobuf (3.21.12-x86_64-darwin)
19
+ google-protobuf (3.21.12-x86_64-linux)
20
20
  googleapis-common-protos-types (1.4.0)
21
21
  google-protobuf (~> 3.14)
22
22
  grpc (1.50.0)
@@ -30,7 +30,7 @@ module TurbineRb
30
30
  )
31
31
  )
32
32
  records.tap do |r|
33
- r.pb_collection = process_call(process: process, pb_collection: pb_collection)
33
+ r.pb_records = process_call(process: process, pb_collection: pb_collection)
34
34
  r.pb_stream = pb_collection.stream
35
35
  end
36
36
  end
@@ -94,7 +94,7 @@ module TurbineRb
94
94
  end
95
95
 
96
96
  class Collection
97
- attr_accessor :pb_collection, :pb_stream, :name, :app
97
+ attr_accessor :pb_records, :pb_stream, :name, :app
98
98
 
99
99
  def self.unwrap(collection)
100
100
  return collection.unwrap if collection.instance_of?(Collection)
@@ -102,9 +102,9 @@ module TurbineRb
102
102
  collection
103
103
  end
104
104
 
105
- def initialize(name, collection, stream, app)
105
+ def initialize(name, records, stream, app)
106
106
  @name = name
107
- @pb_collection = collection
107
+ @pb_records = records
108
108
  @pb_stream = stream
109
109
  @app = app
110
110
  end
@@ -117,10 +117,16 @@ module TurbineRb
117
117
  app.process(records: self, process: process)
118
118
  end
119
119
 
120
+ def records
121
+ return pb_records.to_a if pb_records.respond_to?(:to_a)
122
+
123
+ [pb_records].compact.flatten
124
+ end
125
+
120
126
  def unwrap
121
127
  TurbineCore::Collection.new( # convert back to TurbineCore::Collection
122
128
  name: name,
123
- records: pb_collection.to_a,
129
+ records: records,
124
130
  stream: pb_stream
125
131
  )
126
132
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurbineRb
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbine_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meroxa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2022-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc