keen 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/keen_send +3 -1
- data/lib/keen/client.rb +10 -9
- data/lib/keen/utils.rb +12 -0
- data/lib/keen/version.rb +1 -1
- metadata +4 -3
data/bin/keen_send
CHANGED
@@ -42,4 +42,6 @@ required.each do |key|
|
|
42
42
|
raise OptionParser::MissingArgument.new("you must send `#{key}` when running this command") if options[key].nil?
|
43
43
|
end
|
44
44
|
|
45
|
-
Keen::Client.
|
45
|
+
storage_handler = Keen::Client.create_new_storage_handler(options[:storage_mode])
|
46
|
+
worker = Keen::Async::Worker.new(storage_handler)
|
47
|
+
puts worker.process_queue
|
data/lib/keen/client.rb
CHANGED
@@ -30,15 +30,7 @@ module Keen
|
|
30
30
|
def handler
|
31
31
|
|
32
32
|
unless @storage_handler
|
33
|
-
|
34
|
-
|
35
|
-
case mode
|
36
|
-
when :redis
|
37
|
-
@storage_handler = Keen::Async::Storage::RedisHandler.new
|
38
|
-
else
|
39
|
-
raise "Unknown storage_mode sent to client: `#{mode}`"
|
40
|
-
end
|
41
|
-
|
33
|
+
@storage_handler = self.class.create_new_storage_handler(@storage_mode)
|
42
34
|
end
|
43
35
|
|
44
36
|
@storage_handler
|
@@ -75,5 +67,14 @@ module Keen
|
|
75
67
|
# TODO
|
76
68
|
end
|
77
69
|
|
70
|
+
def self.create_new_storage_handler(storage_mode)
|
71
|
+
case storage_mode.to_sym
|
72
|
+
when :redis
|
73
|
+
Keen::Async::Storage::RedisHandler.new
|
74
|
+
else
|
75
|
+
raise "Unknown storage_mode sent to client: `#{storage_mode}`"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
78
79
|
end
|
79
80
|
end
|
data/lib/keen/utils.rb
ADDED
data/lib/keen/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kyle Wild
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- lib/keen/async/storage/redis_handler.rb
|
197
197
|
- lib/keen/async/worker.rb
|
198
198
|
- lib/keen/client.rb
|
199
|
+
- lib/keen/utils.rb
|
199
200
|
- lib/keen/version.rb
|
200
201
|
- test/keen_spec.rb
|
201
202
|
has_rdoc: true
|