juggernaut 2.0.0 → 2.0.1
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.
- data/VERSION +1 -1
- data/juggernaut.gemspec +2 -5
- data/lib/juggernaut.rb +7 -1
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
data/juggernaut.gemspec
CHANGED
@@ -5,16 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{juggernaut}
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex MacCaw"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-12-18}
|
13
13
|
s.description = %q{Use Juggernaut to easily implement realtime chat, collaboration, gaming and much more!}
|
14
14
|
s.email = %q{info@eribium.org}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"README"
|
17
|
-
]
|
18
15
|
s.files = [
|
19
16
|
".document",
|
20
17
|
".gitignore",
|
data/lib/juggernaut.rb
CHANGED
@@ -2,6 +2,12 @@ require "redis"
|
|
2
2
|
require "json"
|
3
3
|
|
4
4
|
module Juggernaut
|
5
|
+
EVENTS = [
|
6
|
+
"juggernaut:subscribe",
|
7
|
+
"juggernaut:unsubscribe",
|
8
|
+
"juggernaut:custom"
|
9
|
+
]
|
10
|
+
|
5
11
|
def redis_options
|
6
12
|
@redis_options ||= {}
|
7
13
|
end
|
@@ -12,7 +18,7 @@ module Juggernaut
|
|
12
18
|
end
|
13
19
|
|
14
20
|
def subscribe
|
15
|
-
Redis.new(redis_options).subscribe(
|
21
|
+
Redis.new(redis_options).subscribe(*EVENTS) do |on|
|
16
22
|
on.message do |type, msg|
|
17
23
|
yield(type.gsub(/^juggernaut:/, "").to_sym, JSON.parse(msg))
|
18
24
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 2.0.
|
8
|
+
- 1
|
9
|
+
version: 2.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex MacCaw
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-12-18 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -36,8 +36,8 @@ executables: []
|
|
36
36
|
|
37
37
|
extensions: []
|
38
38
|
|
39
|
-
extra_rdoc_files:
|
40
|
-
|
39
|
+
extra_rdoc_files: []
|
40
|
+
|
41
41
|
files:
|
42
42
|
- .document
|
43
43
|
- .gitignore
|