puggernaut 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +31 -3
- data/config/gemspec.yml +1 -1
- data/public/puggernaut.js +13 -10
- data/puggernaut.gemspec +2 -2
- metadata +7 -11
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Puggernaut
|
|
3
3
|
|
4
4
|
Simple server push implementation using eventmachine and long polling.
|
5
5
|
|
6
|
-
![Puggernaut](/winton/puggernaut/raw/master/puggernaut.png)
|
6
|
+
![Puggernaut](https://github.com/winton/puggernaut/raw/master/puggernaut.png)
|
7
7
|
|
8
8
|
Requirements
|
9
9
|
------------
|
@@ -74,7 +74,7 @@ The <code>Client.new</code> initializer accepts any number of TCP server address
|
|
74
74
|
Receive push messages
|
75
75
|
---------------------
|
76
76
|
|
77
|
-
Include [puggernaut.js](/winton/puggernaut/public/puggernaut.js) into to your HTML page.
|
77
|
+
Include [jQuery](http://jquery.com) and [puggernaut.js](https://github.com/winton/puggernaut/public/puggernaut.js) into to your HTML page.
|
78
78
|
|
79
79
|
Javascript client example:
|
80
80
|
|
@@ -90,4 +90,32 @@ Puggernaut
|
|
90
90
|
});
|
91
91
|
|
92
92
|
Puggernaut.unwatch('channel');
|
93
|
-
</pre>
|
93
|
+
</pre>
|
94
|
+
|
95
|
+
Running specs
|
96
|
+
-------------
|
97
|
+
|
98
|
+
Specs are a work in progress, though we can vouch for some of the functionality :).
|
99
|
+
|
100
|
+
Set up Nginx to point to a cloned copy of this project:
|
101
|
+
|
102
|
+
*nginx.conf*
|
103
|
+
|
104
|
+
<pre>
|
105
|
+
server {
|
106
|
+
listen 80;
|
107
|
+
server_name localhost;
|
108
|
+
root /Users/me/puggernaut/public;
|
109
|
+
passenger_enabled on;
|
110
|
+
|
111
|
+
location /long_poll {
|
112
|
+
proxy_pass http://localhost:8000/;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
</pre>
|
116
|
+
|
117
|
+
You have now set up an instance of [Puggernaut's spec server](https://github.com/winton/puggernaut/blob/master/lib/puggernaut/spec_server.rb).
|
118
|
+
|
119
|
+
Start up an instance of Puggernaut by running <code>bin/puggernaut</code>.
|
120
|
+
|
121
|
+
When you visit <code>http://localhost</code> you will find a page that executes [QUnit specs](https://github.com/winton/puggernaut/blob/master/public/spec.js).
|
data/config/gemspec.yml
CHANGED
data/public/puggernaut.js
CHANGED
@@ -62,17 +62,20 @@ var Puggernaut = new function() {
|
|
62
62
|
|
63
63
|
function unwatch() {
|
64
64
|
var args = $.makeArray(arguments);
|
65
|
-
if (args
|
66
|
-
|
67
|
-
|
65
|
+
if (args.length) {
|
66
|
+
if (args[args.length-1].constructor == String)
|
67
|
+
$.each(args, function(i, item) {
|
68
|
+
delete channels[item];
|
69
|
+
});
|
70
|
+
args = $.map(args, function(item) {
|
71
|
+
if (item.constructor == String)
|
72
|
+
return 'watch.' + item;
|
73
|
+
else
|
74
|
+
return item;
|
68
75
|
});
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
else
|
73
|
-
return item;
|
74
|
-
});
|
75
|
-
events.unbind.apply(events, args);
|
76
|
+
events.unbind.apply(events, args);
|
77
|
+
} else
|
78
|
+
events.unbind('watch');
|
76
79
|
return this;
|
77
80
|
}
|
78
81
|
|
data/puggernaut.gemspec
CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |s|
|
|
24
24
|
Puggernaut::Gems.development_dependencies.each do |g|
|
25
25
|
s.add_development_dependency g.to_s, Puggernaut::Gems.versions[g]
|
26
26
|
end
|
27
|
-
|
28
|
-
s.executables = `cd #{root} && git ls-files
|
27
|
+
|
28
|
+
s.executables = `cd #{root} && git ls-files bin/*`.split("\n").collect { |f| File.basename(f) }
|
29
29
|
s.files = `cd #{root} && git ls-files`.split("\n")
|
30
30
|
s.require_paths = %w(lib)
|
31
31
|
s.test_files = `cd #{root} && git ls-files -- {features,test,spec}/*`.split("\n")
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puggernaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Winton Welsh
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-21 00:00:00 -08:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 59
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
- 12
|
@@ -36,8 +34,8 @@ dependencies:
|
|
36
34
|
version_requirements: *id001
|
37
35
|
description: Simple server push implementation using eventmachine and long polling
|
38
36
|
email: mail@wintoni.us
|
39
|
-
executables:
|
40
|
-
|
37
|
+
executables:
|
38
|
+
- puggernaut
|
41
39
|
extensions: []
|
42
40
|
|
43
41
|
extra_rdoc_files: []
|
@@ -87,7 +85,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
85
|
requirements:
|
88
86
|
- - ">="
|
89
87
|
- !ruby/object:Gem::Version
|
90
|
-
hash: 3
|
91
88
|
segments:
|
92
89
|
- 0
|
93
90
|
version: "0"
|
@@ -96,14 +93,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
93
|
requirements:
|
97
94
|
- - ">="
|
98
95
|
- !ruby/object:Gem::Version
|
99
|
-
hash: 3
|
100
96
|
segments:
|
101
97
|
- 0
|
102
98
|
version: "0"
|
103
99
|
requirements: []
|
104
100
|
|
105
101
|
rubyforge_project:
|
106
|
-
rubygems_version: 1.
|
102
|
+
rubygems_version: 1.3.7
|
107
103
|
signing_key:
|
108
104
|
specification_version: 3
|
109
105
|
summary: Simple server push implementation using eventmachine and long polling
|