sinatra-pubsub 0.0.6 → 0.0.7
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/README.md +14 -3
- data/examples/basic/app.rb +5 -0
- data/lib/sinatra/pubsub/helpers.rb +2 -0
- data/lib/sinatra/pubsub/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fb1fe38088757bf876e2e499dd734819edfc4ea
|
4
|
+
data.tar.gz: 6ecd2f12f8cefeafbef18e4582d2d67b91aeb02d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74722f89f7f82019ca585fefa19a6d5d7cf482a10d766bc0ec2b4306b4f0c225947a0e568a6a44157e4070d18be88077957b614acb5647901cef3f477a4182b1
|
7
|
+
data.tar.gz: dce23fe2fd36f9423433221e382a22090191df85e45347f6d754e4c9f8433d7398dc58197b275a06b6026c1398874aef71b5a9b0a8b832e4aed9b69a9acb4dc3
|
data/README.md
CHANGED
@@ -22,6 +22,12 @@ And publish to them:
|
|
22
22
|
|
23
23
|
Sinatra::PubSub.publish('sites/123', data: 'hi')
|
24
24
|
|
25
|
+
## Demo
|
26
|
+
|
27
|
+
You can find a simple demo on Heroku, which streams a 'tick' every second to your browser.
|
28
|
+
|
29
|
+
http://sinatra-pubsub-tick.herokuapp.com
|
30
|
+
|
25
31
|
## Requirements
|
26
32
|
|
27
33
|
* Thin
|
@@ -70,18 +76,23 @@ First create your streaming server from the 'basic' example.
|
|
70
76
|
cp -r sinatra-pubsub/examples/basic myapp-stream
|
71
77
|
cd myapp-stream
|
72
78
|
bundle install
|
79
|
+
git init
|
80
|
+
git add .
|
81
|
+
git commit -m 'first commit'
|
73
82
|
heroku create myapp-stream
|
74
83
|
git push heroku master
|
75
84
|
|
76
85
|
Now the server is deployed, you need to setup Redis. If you already have Redis running
|
77
86
|
on your main application server, just run:
|
78
87
|
|
79
|
-
heroku config -a myapp | grep REDIS
|
88
|
+
heroku config -a myapp-stream | grep REDIS
|
80
89
|
heroku config:set REDIS_URL=YOUR_REDIS_URL -a myapp-stream
|
81
90
|
|
82
|
-
Otherwise install the
|
91
|
+
Otherwise install the RedisCloud addon:
|
83
92
|
|
84
|
-
heroku addons:add
|
93
|
+
heroku addons:add rediscloud -a myapp-stream
|
94
|
+
heroku config -a myapp-stream | grep REDIS
|
95
|
+
heroku config:set REDIS_URL=YOUR_REDIS_URL -a myapp-stream
|
85
96
|
|
86
97
|
And you're finished! You can subscribe to a channel from any browser like this:
|
87
98
|
|
data/examples/basic/app.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex MacCaw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|