fanout 1.0.0 → 1.1.0
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.
- checksums.yaml +4 -4
- data/lib/fanout.rb +4 -4
- data/lib/{fppformat.rb → jsonobjectformat.rb} +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8655451ecd8c91ba1ff01726d371800057aa5de2
|
4
|
+
data.tar.gz: d6eb7aa3a9d94609b1b140a23d1f8f20f2950092
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dea88166ebb39dad0cc44d085db1cbe1fd6d672ba93e1a1306a1494440117e2760742127bb3e3f6bcb3485fb954d05de41449480f7be95c7702ffdb04a3b757
|
7
|
+
data.tar.gz: ac52397f44f109b1baca70663230968bd3a9831880ea8c18d571f018d5e6b88f652db457026cfbbca64de3d82736fea1a0f8dd04ecec5f3f3cc9ed27092c5650
|
data/lib/fanout.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
require 'base64'
|
9
9
|
require 'thread'
|
10
10
|
require 'pubcontrol'
|
11
|
-
require_relative '
|
11
|
+
require_relative 'jsonobjectformat.rb'
|
12
12
|
|
13
13
|
class Fanout
|
14
14
|
def initialize(realm=nil, key=nil, ssl=true)
|
@@ -26,13 +26,13 @@ class Fanout
|
|
26
26
|
|
27
27
|
def publish(channel, data, id=nil, prev_id=nil)
|
28
28
|
pub = get_pubcontrol
|
29
|
-
pub.publish(channel, Item.new(
|
29
|
+
pub.publish(channel, Item.new(JsonObjectFormat.new(data), id, prev_id))
|
30
30
|
end
|
31
31
|
|
32
32
|
def publish_async(channel, data, id=nil, prev_id=nil, callback=nil)
|
33
33
|
pub = get_pubcontrol
|
34
|
-
pub.publish_async(channel, Item.new(
|
35
|
-
callback)
|
34
|
+
pub.publish_async(channel, Item.new(JsonObjectFormat.new(data), id,
|
35
|
+
prev_id), callback)
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
@@ -1,19 +1,19 @@
|
|
1
|
-
#
|
1
|
+
# jsonobjectformat.rb
|
2
2
|
# ~~~~~~~~~
|
3
|
-
# This module implements the
|
3
|
+
# This module implements the JsonObjectFormat class.
|
4
4
|
# :authors: Konstantin Bokarius.
|
5
5
|
# :copyright: (c) 2015 by Fanout, Inc.
|
6
6
|
# :license: MIT, see LICENSE for more details.
|
7
7
|
|
8
8
|
require 'pubcontrol'
|
9
9
|
|
10
|
-
class
|
10
|
+
class JsonObjectFormat < Format
|
11
11
|
def initialize(value)
|
12
12
|
@value = value
|
13
13
|
end
|
14
14
|
|
15
15
|
def name
|
16
|
-
return '
|
16
|
+
return 'json-object'
|
17
17
|
end
|
18
18
|
|
19
19
|
def export
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Bokarius
|
@@ -24,15 +24,15 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1'
|
27
|
-
description: A Ruby convenience library for publishing
|
28
|
-
|
27
|
+
description: A Ruby convenience library for publishing messages to Fanout.io using
|
28
|
+
the EPCP protocol
|
29
29
|
email: bokarius@comcast.net
|
30
30
|
executables: []
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- lib/fanout.rb
|
35
|
-
- lib/
|
35
|
+
- lib/jsonobjectformat.rb
|
36
36
|
homepage: http://rubygems.org/gems/fanout
|
37
37
|
licenses:
|
38
38
|
- MIT
|