zillabyte 0.9.4 → 0.9.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
  SHA1:
3
- metadata.gz: ea18644fa1c209e9cfd1bd8fc856faf1885ae5c9
4
- data.tar.gz: 8ee0bbd3c36cf2ee28ab49863d6a235328943756
3
+ metadata.gz: 13ef9e2915ce6842d0dd7e38ebc3f30d3a61eae2
4
+ data.tar.gz: f54c566d1fe9fac2fd0d8acee88e8180ae51820b
5
5
  SHA512:
6
- metadata.gz: 3690157aa6e631c063c37041861b16d6d189a0716b01fbc0366822369659a2a20665214ea2f88ce5a49c8d6cf78e1dcd5027013ee76b3a13664a232cfbaf209d
7
- data.tar.gz: 7214bb66977ea9137b5519e49752c7b0b996b02b6e334048cb40f54879ab547218f62aa9dd57f512f68695989d1fbadd1474419a63873ea6dce432a166f4eb24
6
+ metadata.gz: 6a926d4112bd1d096b0e50048c9e7fe9d28a7f15d0a644a647cf5989ac3028b27def66536cf1b22b46232c6b10478f05c5a696581c40dfc57efa370e667ebcf1
7
+ data.tar.gz: 28f625b349f8a8720983e21c82ddb76ee0f752fc473e2896f2a5191b1f2476743effafcb1a44a67094beae98a8b667592757f5e707f59f591ebf5f6916352c08
@@ -43,8 +43,9 @@ class Zillabyte::Harness::GroupBy
43
43
  class Node < Zillabyte::Harness::CommonNode
44
44
  attr_accessor :_group_by, :_begin_group, :_aggregate, :_end_group
45
45
 
46
- def initialize(v)
47
- @_name = "group_by_"+Zillabyte::Harness::Counter.get()
46
+ def initialize(v, options = {})
47
+ @_options = options
48
+ @_name ||= options[:name] || "group_by_"+Zillabyte::Harness::Counter.get()
48
49
  @_type = 'group_by'
49
50
  @_group_by = v
50
51
  end
@@ -64,12 +65,11 @@ class Zillabyte::Harness::GroupBy
64
65
 
65
66
  def initialize(app, *args)
66
67
  @_app = app
67
- @_fields = Zillabyte::Harness::Helper.get_non_option_args(args)
68
- @_vector_options, @_options = Zillabyte::Harness::Helper.get_vector_and_hashes(args)
68
+ @_fields, @_options = Zillabyte::Harness::Helper.get_vector_and_hashes(args)
69
69
  end
70
70
 
71
71
  def build_node(&block)
72
- @_node = Node.new(@_fields)
72
+ @_node = Node.new(@_fields, @_options)
73
73
 
74
74
  # Yield
75
75
  @_node.instance_eval(&block)
@@ -1,24 +1,26 @@
1
- class Zillabyte::Harness::StreamBuilder < Array
1
+ class Zillabyte::Harness::StreamBuilder
2
2
  attr_accessor :_name, :_app, :_previous_node_name
3
3
 
4
4
  def initialize(first_stream)
5
5
  @_streams = [first_stream]
6
- self.clear()
7
6
  end
8
7
 
9
8
 
9
+ def [](v)
10
+ raise "The previous operation did not emit a split stream."
11
+ end
12
+
10
13
  # Ruby magic to automatically call 'method_name' on the last stream we collected
11
14
  def method_missing(method_name, *args, &block)
12
15
  results = @_streams.last.send method_name, *args, &block
13
16
  if results.is_a?(Array)
14
17
  # Split stream...
15
- results.each_with_index do |v, i|
16
- self[i] = v
17
- end
18
+ return results.map {|stream|
19
+ Zillabyte::Harness::StreamBuilder.new(stream)
20
+ }
18
21
  else
19
22
  # Continue this stream...
20
23
  @_streams << results
21
- self.clear()
22
24
  end
23
25
  return self
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Zillabyte
2
- VERSION = "0.9.4" unless defined?(VERSION)
2
+ VERSION = "0.9.5" unless defined?(VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillabyte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - zillabyte
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.4
33
+ version: 0.9.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.9.4
40
+ version: 0.9.5
41
41
  description: The Official Zillabyte Gem
42
42
  email:
43
43
  - gem@zillabyte.com