kafka-rb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/kafka/batch.rb +13 -0
  3. data/spec/batch_spec.rb +21 -0
  4. metadata +6 -4
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'spec/rake/spectask'
6
6
 
7
7
  GEM = 'kafka-rb'
8
8
  GEM_NAME = 'Kafka Client Producer'
9
- GEM_VERSION = '0.0.1'
9
+ GEM_VERSION = '0.0.2'
10
10
  AUTHORS = ['Alejandro Crosa']
11
11
  EMAIL = "alejandrocrosa@gmail.com"
12
12
  HOMEPAGE = "http://github.com/acrosa/kafka-rb"
@@ -0,0 +1,13 @@
1
+ module Kafka
2
+ class Batch
3
+ attr_accessor :messages
4
+
5
+ def initialize
6
+ self.messages = []
7
+ end
8
+
9
+ def << (message)
10
+ self.messages << message
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe Batch do
4
+
5
+ before(:each) do
6
+ @batch = Batch.new
7
+ end
8
+
9
+ describe "batch messages" do
10
+ it "holds all messages to be sent" do
11
+ @batch.should respond_to(:messages)
12
+ @batch.messages.class.should eql(Array)
13
+ end
14
+
15
+ it "supports queueing/adding messages to be send" do
16
+ @batch.messages << mock(Kafka::Message.new("one"))
17
+ @batch.messages << mock(Kafka::Message.new("two"))
18
+ @batch.messages.length.should eql(2)
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafka-rb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alejandro Crosa
@@ -15,7 +15,7 @@ autorequire: kafka-rb
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-07 00:00:00 -08:00
18
+ date: 2011-01-11 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -44,11 +44,13 @@ files:
44
44
  - LICENSE
45
45
  - README.md
46
46
  - Rakefile
47
+ - lib/kafka/batch.rb
47
48
  - lib/kafka/io.rb
48
49
  - lib/kafka/message.rb
49
50
  - lib/kafka/producer.rb
50
51
  - lib/kafka.rb
51
52
  - lib/test.rb
53
+ - spec/batch_spec.rb
52
54
  - spec/io_spec.rb
53
55
  - spec/kafka_spec.rb
54
56
  - spec/message_spec.rb