fluq 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +39 -0
- data/MIT-LICENCE +19 -0
- data/README.md +10 -0
- data/Rakefile +11 -0
- data/benchmark/logging.rb +37 -0
- data/benchmark/socket.rb +52 -0
- data/bin/fluq-rb +8 -0
- data/examples/common.rb +3 -0
- data/examples/simple.rb +5 -0
- data/fluq.gemspec +33 -0
- data/lib/fluq.rb +50 -0
- data/lib/fluq/buffer.rb +6 -0
- data/lib/fluq/buffer/base.rb +51 -0
- data/lib/fluq/buffer/file.rb +68 -0
- data/lib/fluq/cli.rb +142 -0
- data/lib/fluq/dsl.rb +49 -0
- data/lib/fluq/dsl/options.rb +27 -0
- data/lib/fluq/error.rb +2 -0
- data/lib/fluq/event.rb +55 -0
- data/lib/fluq/feed.rb +6 -0
- data/lib/fluq/feed/base.rb +18 -0
- data/lib/fluq/feed/json.rb +28 -0
- data/lib/fluq/feed/msgpack.rb +27 -0
- data/lib/fluq/feed/tsv.rb +30 -0
- data/lib/fluq/handler.rb +6 -0
- data/lib/fluq/handler/base.rb +80 -0
- data/lib/fluq/handler/log.rb +67 -0
- data/lib/fluq/handler/null.rb +4 -0
- data/lib/fluq/input.rb +6 -0
- data/lib/fluq/input/base.rb +59 -0
- data/lib/fluq/input/socket.rb +50 -0
- data/lib/fluq/input/socket/connection.rb +41 -0
- data/lib/fluq/mixins.rb +6 -0
- data/lib/fluq/mixins/loggable.rb +7 -0
- data/lib/fluq/mixins/logger.rb +26 -0
- data/lib/fluq/reactor.rb +76 -0
- data/lib/fluq/testing.rb +26 -0
- data/lib/fluq/url.rb +16 -0
- data/lib/fluq/version.rb +3 -0
- data/spec/fluq/buffer/base_spec.rb +21 -0
- data/spec/fluq/buffer/file_spec.rb +47 -0
- data/spec/fluq/dsl/options_spec.rb +24 -0
- data/spec/fluq/dsl_spec.rb +43 -0
- data/spec/fluq/event_spec.rb +25 -0
- data/spec/fluq/feed/base_spec.rb +15 -0
- data/spec/fluq/feed/json_spec.rb +27 -0
- data/spec/fluq/feed/msgpack_spec.rb +27 -0
- data/spec/fluq/feed/tsv_spec.rb +27 -0
- data/spec/fluq/handler/base_spec.rb +70 -0
- data/spec/fluq/handler/log_spec.rb +68 -0
- data/spec/fluq/handler/null_spec.rb +11 -0
- data/spec/fluq/input/base_spec.rb +29 -0
- data/spec/fluq/input/socket/connection_spec.rb +35 -0
- data/spec/fluq/input/socket_spec.rb +45 -0
- data/spec/fluq/mixins/loggable_spec.rb +10 -0
- data/spec/fluq/mixins/logger_spec.rb +25 -0
- data/spec/fluq/reactor_spec.rb +58 -0
- data/spec/fluq/url_spec.rb +16 -0
- data/spec/fluq_spec.rb +11 -0
- data/spec/scenario/config/nested/common.rb +3 -0
- data/spec/scenario/config/test.rb +3 -0
- data/spec/scenario/lib/fluq/handler/custom/test_handler.rb +4 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/support/configuration.rb +25 -0
- metadata +242 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FluQ::URL do
|
4
|
+
|
5
|
+
it "should parse URLs" do
|
6
|
+
described_class.parse("tcp://localhost:1234/", ["tcp"]).should be_instance_of(URI::Generic)
|
7
|
+
described_class.parse("tcp://localhost:1234/", ["tcp", "unix"]).should be_instance_of(URI::Generic)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should ensure correct schemes" do
|
11
|
+
lambda {
|
12
|
+
described_class.parse("tcp://localhost:1234/", ["udp", "unix"])
|
13
|
+
}.should raise_error(URI::InvalidURIError)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/spec/fluq_spec.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FluQ do
|
4
|
+
|
5
|
+
its(:env) { should == "test" }
|
6
|
+
its(:root) { should be_instance_of(Pathname) }
|
7
|
+
its(:logger) { should be_instance_of(Logger) }
|
8
|
+
its("logger.level") { should == Logger::DEBUG }
|
9
|
+
it { should respond_to(:logger=) }
|
10
|
+
|
11
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
ENV['FLUQ_ENV'] ||= "test"
|
2
|
+
ENV['FLUQ_ROOT'] ||= File.expand_path("../scenario/", __FILE__)
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rspec'
|
6
|
+
require 'fluq/testing'
|
7
|
+
|
8
|
+
Dir[FluQ.root.join("../support/**/*.rb")].each {|f| require f }
|
9
|
+
FluQ.logger = Logger.new(FluQ.root.join("log", "fluq.log").to_s)
|
10
|
+
|
11
|
+
$LOAD_PATH.unshift FluQ.root.join('lib')
|
12
|
+
Random.srand(1234)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module FluQ::SpecHelpers
|
2
|
+
|
3
|
+
def self.included(base)
|
4
|
+
super
|
5
|
+
base.instance_eval do
|
6
|
+
let(:reactor) { @_reactor ||= FluQ::Reactor.new }
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def with_reactor(&block)
|
11
|
+
FluQ::Reactor.run do |reactor|
|
12
|
+
@_reactor = reactor
|
13
|
+
block.call(reactor)
|
14
|
+
EM.stop
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
RSpec.configure do |c|
|
21
|
+
c.include FluQ::SpecHelpers
|
22
|
+
c.after do
|
23
|
+
FileUtils.rm_rf FluQ.root.join("tmp").to_s
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,242 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluq
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Black Square Media
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-07-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: msgpack
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.5.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.5.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: eventmachine-le
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: oj
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.0.10
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.0.10
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: timed_lru
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: bundler
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rspec
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: yard
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: The minimalistic stream processor
|
143
|
+
email: info@blacksquaremedia.com
|
144
|
+
executables:
|
145
|
+
- fluq-rb
|
146
|
+
extensions: []
|
147
|
+
extra_rdoc_files: []
|
148
|
+
files:
|
149
|
+
- .gitignore
|
150
|
+
- .travis.yml
|
151
|
+
- Gemfile
|
152
|
+
- Gemfile.lock
|
153
|
+
- MIT-LICENCE
|
154
|
+
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- benchmark/logging.rb
|
157
|
+
- benchmark/socket.rb
|
158
|
+
- bin/fluq-rb
|
159
|
+
- examples/common.rb
|
160
|
+
- examples/simple.rb
|
161
|
+
- fluq.gemspec
|
162
|
+
- lib/fluq.rb
|
163
|
+
- lib/fluq/buffer.rb
|
164
|
+
- lib/fluq/buffer/base.rb
|
165
|
+
- lib/fluq/buffer/file.rb
|
166
|
+
- lib/fluq/cli.rb
|
167
|
+
- lib/fluq/dsl.rb
|
168
|
+
- lib/fluq/dsl/options.rb
|
169
|
+
- lib/fluq/error.rb
|
170
|
+
- lib/fluq/event.rb
|
171
|
+
- lib/fluq/feed.rb
|
172
|
+
- lib/fluq/feed/base.rb
|
173
|
+
- lib/fluq/feed/json.rb
|
174
|
+
- lib/fluq/feed/msgpack.rb
|
175
|
+
- lib/fluq/feed/tsv.rb
|
176
|
+
- lib/fluq/handler.rb
|
177
|
+
- lib/fluq/handler/base.rb
|
178
|
+
- lib/fluq/handler/log.rb
|
179
|
+
- lib/fluq/handler/null.rb
|
180
|
+
- lib/fluq/input.rb
|
181
|
+
- lib/fluq/input/base.rb
|
182
|
+
- lib/fluq/input/socket.rb
|
183
|
+
- lib/fluq/input/socket/connection.rb
|
184
|
+
- lib/fluq/mixins.rb
|
185
|
+
- lib/fluq/mixins/loggable.rb
|
186
|
+
- lib/fluq/mixins/logger.rb
|
187
|
+
- lib/fluq/reactor.rb
|
188
|
+
- lib/fluq/testing.rb
|
189
|
+
- lib/fluq/url.rb
|
190
|
+
- lib/fluq/version.rb
|
191
|
+
- spec/fluq/buffer/base_spec.rb
|
192
|
+
- spec/fluq/buffer/file_spec.rb
|
193
|
+
- spec/fluq/dsl/options_spec.rb
|
194
|
+
- spec/fluq/dsl_spec.rb
|
195
|
+
- spec/fluq/event_spec.rb
|
196
|
+
- spec/fluq/feed/base_spec.rb
|
197
|
+
- spec/fluq/feed/json_spec.rb
|
198
|
+
- spec/fluq/feed/msgpack_spec.rb
|
199
|
+
- spec/fluq/feed/tsv_spec.rb
|
200
|
+
- spec/fluq/handler/base_spec.rb
|
201
|
+
- spec/fluq/handler/log_spec.rb
|
202
|
+
- spec/fluq/handler/null_spec.rb
|
203
|
+
- spec/fluq/input/base_spec.rb
|
204
|
+
- spec/fluq/input/socket/connection_spec.rb
|
205
|
+
- spec/fluq/input/socket_spec.rb
|
206
|
+
- spec/fluq/mixins/loggable_spec.rb
|
207
|
+
- spec/fluq/mixins/logger_spec.rb
|
208
|
+
- spec/fluq/reactor_spec.rb
|
209
|
+
- spec/fluq/url_spec.rb
|
210
|
+
- spec/fluq_spec.rb
|
211
|
+
- spec/scenario/config/nested/common.rb
|
212
|
+
- spec/scenario/config/test.rb
|
213
|
+
- spec/scenario/lib/fluq/handler/custom/test_handler.rb
|
214
|
+
- spec/scenario/log/.gitkeep
|
215
|
+
- spec/spec_helper.rb
|
216
|
+
- spec/support/configuration.rb
|
217
|
+
homepage: https://github.com/bsm/fluq
|
218
|
+
licenses: []
|
219
|
+
post_install_message:
|
220
|
+
rdoc_options: []
|
221
|
+
require_paths:
|
222
|
+
- lib
|
223
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
224
|
+
none: false
|
225
|
+
requirements:
|
226
|
+
- - ! '>='
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: 1.9.1
|
229
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
|
+
none: false
|
231
|
+
requirements:
|
232
|
+
- - ! '>='
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: 1.8.0
|
235
|
+
requirements: []
|
236
|
+
rubyforge_project:
|
237
|
+
rubygems_version: 1.8.25
|
238
|
+
signing_key:
|
239
|
+
specification_version: 3
|
240
|
+
summary: FluQ
|
241
|
+
test_files: []
|
242
|
+
has_rdoc:
|