angular-faye-rails 0.1.0.4 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd2243e272f04d62cdd8d77f3c1c80ea3eb57462
4
- data.tar.gz: 7883404d9645b0adf8edc8e895134639d7d88812
3
+ metadata.gz: f870a74bf90d6085592126692f141b47ea4efb9d
4
+ data.tar.gz: d28503abb3a7fa19bd6617aa8eb4470614b1eb5c
5
5
  SHA512:
6
- metadata.gz: 586f979dea0828e3b3e6494bb60e8210521fcc12d323f4d455fd96120d2df6c2c6dbd99ff8a1c443bf339524ffab2fabb6ad540e762dc1b92dc248fc1cca7c44
7
- data.tar.gz: 47a1ee8c91b1295f1bedae36c13747ea2c8a5d3e68fc1c5903ad4f612765abf69b3b801b01e2985803f625e4d86e9eac9bfeafd478c3989d8b7c742413618754
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
 
@@ -1,5 +1,5 @@
1
1
  module AngularFaye
2
2
  module Rails
3
- VERSION = "0.1.0.4"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -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.1.0.4
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-16 00:00:00.000000000 Z
11
+ date: 2013-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: angularjs-rails