pusher.io 0.0.2 → 0.0.3
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/README.md +19 -0
- data/app/assets/javascripts/pusher.io/client.js +6 -2
- data/lib/pusher.io/version.rb +1 -1
- metadata +4 -5
- data/lib/pusher.io/capistrano.rb +0 -10
data/README.md
CHANGED
@@ -23,12 +23,31 @@ For production
|
|
23
23
|
Add the JavaScript file to your application.js file manifest.
|
24
24
|
|
25
25
|
// require pusher.io/client
|
26
|
+
|
27
|
+
See [socket.io docs](https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO) for Redis config.
|
28
|
+
Make your changes in pusher.io.js
|
26
29
|
|
27
30
|
## Usage
|
28
31
|
|
29
32
|
Include pusher io tags in your html head:
|
30
33
|
|
31
34
|
<%= pusher_io_tags %>
|
35
|
+
|
36
|
+
Browser side
|
37
|
+
|
38
|
+
var channel = pusher.subscribe('notifications');
|
39
|
+
channel.on('alert', function(data) {
|
40
|
+
alert(data);
|
41
|
+
});
|
42
|
+
|
43
|
+
// or use bind
|
44
|
+
channel.bind('alert', function(data) {
|
45
|
+
alert(data);
|
46
|
+
});
|
47
|
+
|
48
|
+
Server side
|
49
|
+
|
50
|
+
Pusher::IO[:notifications].trigger 'alert', 'hello'
|
32
51
|
|
33
52
|
## Contributing
|
34
53
|
|
@@ -33,14 +33,18 @@ pusher = {}
|
|
33
33
|
return this;
|
34
34
|
}
|
35
35
|
|
36
|
-
Channel.prototype.
|
36
|
+
Channel.prototype.on = function (event, callback) {
|
37
37
|
this.socket.on('pusher:' + event, callback);
|
38
38
|
}
|
39
39
|
|
40
|
-
Channel.prototype.
|
40
|
+
Channel.prototype.bind = Channel.prototype.on;
|
41
|
+
|
42
|
+
Channel.prototype.off = function (event) {
|
41
43
|
this.socket.off('pusher:' + event);
|
42
44
|
}
|
43
45
|
|
46
|
+
Channel.prototype.unbind = Channel.prototype.off;
|
47
|
+
|
44
48
|
pusher.channel = function (name) {
|
45
49
|
var channel = channels[name];
|
46
50
|
if (!channel) {
|
data/lib/pusher.io/version.rb
CHANGED
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: pusher.io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- yury
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Very basic implementation of pusherapp.com api subset on top of socket.io.
|
15
15
|
email:
|
@@ -29,7 +29,6 @@ files:
|
|
29
29
|
- lib/generators/pusher.io/templates/pusher.io.js
|
30
30
|
- lib/generators/pusher.io/templates/pusher.io.yml
|
31
31
|
- lib/pusher.io.rb
|
32
|
-
- lib/pusher.io/capistrano.rb
|
33
32
|
- lib/pusher.io/engine.rb
|
34
33
|
- lib/pusher.io/version.rb
|
35
34
|
- lib/pusher.io/view_helpers.rb
|
@@ -47,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
46
|
version: '0'
|
48
47
|
segments:
|
49
48
|
- 0
|
50
|
-
hash:
|
49
|
+
hash: -3160252235978856119
|
51
50
|
none: false
|
52
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
52
|
requirements:
|
@@ -56,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
55
|
version: '0'
|
57
56
|
segments:
|
58
57
|
- 0
|
59
|
-
hash:
|
58
|
+
hash: -3160252235978856119
|
60
59
|
none: false
|
61
60
|
requirements: []
|
62
61
|
rubyforge_project:
|
data/lib/pusher.io/capistrano.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# Capistrano task for npm install.
|
2
|
-
#
|
3
|
-
# Just add "require 'pusher.io/capistrano'" in your Capistrano deploy.rb, and
|
4
|
-
# Pusher will be activated after each new deployment.
|
5
|
-
|
6
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
7
|
-
before "deploy:finalize_update", "pusher.io:install" do
|
8
|
-
run "npm install"
|
9
|
-
end
|
10
|
-
end
|