angular-faye-rails 0.1.0.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/angular-faye-rails/version.rb +1 -1
- data/vendor/assets/javascripts/angular-faye.js.coffee +8 -4
- 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: f870a74bf90d6085592126692f141b47ea4efb9d
|
4
|
+
data.tar.gz: d28503abb3a7fa19bd6617aa8eb4470614b1eb5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b680e69ca37f22f2ca1da5ba134bc5e558b0f274c0611db0c76aceb96096020c1c2cd5dfa474b05950eefe1f8938233bdf22062ebde94eab1a7e99f6eac8e8a
|
7
|
+
data.tar.gz: ee2116547b763fad790eb34e20c11fb3f6f447d52993145f0308eae1f692fec228f5582a866c1f7c40b70463265fda1c05dc33ca20f103444e646fcce4e4ee8a
|
data/README.md
CHANGED
@@ -46,6 +46,16 @@ app.factory 'Faye', ['$faye', ($faye) ->
|
|
46
46
|
```
|
47
47
|
|
48
48
|
|
49
|
+
### Configure Faye client
|
50
|
+
|
51
|
+
```coffee
|
52
|
+
app.factory 'Faye', ['$faye', ($faye) ->
|
53
|
+
$faye "http://localhost:9292/faye", (client) ->
|
54
|
+
client.disable("websocket")
|
55
|
+
]
|
56
|
+
```
|
57
|
+
|
58
|
+
|
49
59
|
|
50
60
|
## Contributing
|
51
61
|
|
@@ -3,20 +3,24 @@
|
|
3
3
|
angular.module "faye", []
|
4
4
|
|
5
5
|
angular.module("faye").factory "$faye", ["$q", "$rootScope", ($q, $rootScope) ->
|
6
|
-
(url) ->
|
6
|
+
(url, fun) ->
|
7
7
|
scope = $rootScope
|
8
8
|
client = new Faye.Client(url)
|
9
|
+
fun?(client)
|
10
|
+
|
11
|
+
|
12
|
+
client: client
|
9
13
|
publish: (channel, data) ->
|
10
|
-
client.publish channel, data
|
14
|
+
@client.publish channel, data
|
11
15
|
|
12
16
|
subscribe: (channel, callback) ->
|
13
|
-
client.subscribe channel, (data) ->
|
17
|
+
@client.subscribe channel, (data) ->
|
14
18
|
scope.$apply ->
|
15
19
|
callback(data)
|
16
20
|
|
17
21
|
get: (channel) ->
|
18
22
|
deferred = $q.defer()
|
19
|
-
sub = client.subscribe(channel, (data) ->
|
23
|
+
sub = @client.subscribe(channel, (data) ->
|
20
24
|
scope.$apply ->
|
21
25
|
deferred.resolve data
|
22
26
|
sub.cancel()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-faye-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tymon Tobolski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: angularjs-rails
|