pusher_rails 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ v0.2.3
2
+ ======
3
+ - Upgraded to pusher.js 1.12.1
4
+ - Upgraded to pusher-gem 0.9.3
5
+
1
6
  v0.2.2
2
7
  ======
3
8
  - Upgraded to pusher.js 1.12.0
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
  =====================
3
3
 
4
4
  Adds:
5
- - [pusher-gem v0.9.2](https://github.com/pusher/pusher-gem/tree/v0.9.2)
6
- - [pusher.js v1.12.0](https://github.com/pusher/pusher-js/tree/v1.12.0)
5
+ - [pusher-gem v0.9.3](https://github.com/pusher/pusher-gem/tree/v0.9.3)
6
+ - [pusher.js v1.12.1](https://github.com/pusher/pusher-js/tree/v1.12.1)
7
7
  - [backpusher.js](https://github.com/pusher/backpusher)
8
8
 
9
9
  This pulls in the *pusher-gem* as well as adding *pusher.js* and *backpusher.js* to the assets pipeline of your Rails 3.1+ app.
@@ -21,7 +21,7 @@ Licenses
21
21
  ========
22
22
 
23
23
  /*!
24
- * Pusher JavaScript Library v1.12.0
24
+ * Pusher JavaScript Library v1.12.1
25
25
  * http://pusherapp.com/
26
26
  *
27
27
  * Copyright 2011, Pusher
data/pusher_rails.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'pusher_rails'
6
- s.version = '0.2.2'
6
+ s.version = '0.2.3'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["David Grandinetti"]
9
9
  s.email = ["dave@wegoto12.com"]
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.description = 'Adds pusher.js/backpusher.js to the asset pipeline and pusher-gem to to your app.'
12
12
  s.homepage = 'https://github.com/dbgrandi/pusher_rails'
13
13
 
14
- s.add_dependency "pusher", "~> 0.9.2"
14
+ s.add_dependency "pusher", "~> 0.9.3"
15
15
 
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.require_paths = ["lib"]
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Pusher JavaScript Library v1.12.0
2
+ * Pusher JavaScript Library v1.12.1
3
3
  * http://pusherapp.com/
4
4
  *
5
5
  * Copyright 2011, Pusher
@@ -183,7 +183,7 @@
183
183
  };
184
184
 
185
185
  // Pusher defaults
186
- Pusher.VERSION = '1.12.0';
186
+ Pusher.VERSION = '1.12.1';
187
187
 
188
188
  Pusher.host = 'ws.pusherapp.com';
189
189
  Pusher.ws_port = 80;
@@ -399,11 +399,11 @@ Example:
399
399
  'waiting': ['connecting', 'permanentlyClosed'],
400
400
  'connecting': ['open', 'permanentlyClosing', 'impermanentlyClosing', 'waiting'],
401
401
  'open': ['connected', 'permanentlyClosing', 'impermanentlyClosing', 'waiting'],
402
- 'connected': ['permanentlyClosing', 'impermanentlyClosing', 'waiting'],
402
+ 'connected': ['permanentlyClosing', 'waiting'],
403
403
  'impermanentlyClosing': ['waiting', 'permanentlyClosing'],
404
404
  'permanentlyClosing': ['permanentlyClosed'],
405
405
  'permanentlyClosed': ['waiting'],
406
- 'failed': ['permanentlyClosing']
406
+ 'failed': ['permanentlyClosed']
407
407
  };
408
408
 
409
409
 
@@ -507,8 +507,6 @@ Example:
507
507
  return;
508
508
  }
509
509
 
510
- // removed: if not closed, something is wrong that we should fix
511
- // if(self.socket !== undefined) self.socket.close();
512
510
  var url = formatURL(self.key, self.connectionSecure);
513
511
  Pusher.debug('Connecting', url);
514
512
  self.socket = new Pusher.Transport(url);
@@ -519,7 +517,7 @@ Example:
519
517
  self.socket.onerror = ws_onError;
520
518
 
521
519
  // allow time to get ws_onOpen, otherwise close socket and try again
522
- self._connectingTimer = setTimeout(TransitionToImpermanentClosing, self.openTimeout);
520
+ self._connectingTimer = setTimeout(TransitionToImpermanentlyClosing, self.openTimeout);
523
521
  },
524
522
 
525
523
  connectingExit: function() {
@@ -545,7 +543,7 @@ Example:
545
543
  self.socket.onclose = transitionToWaiting;
546
544
 
547
545
  // allow time to get connected-to-Pusher message, otherwise close socket, try again
548
- self._openTimer = setTimeout(TransitionToImpermanentClosing, self.connectedTimeout);
546
+ self._openTimer = setTimeout(TransitionToImpermanentlyClosing, self.connectedTimeout);
549
547
  },
550
548
 
551
549
  openExit: function() {
@@ -659,7 +657,7 @@ Example:
659
657
  }
660
658
 
661
659
  // callback for close and retry. Used on timeouts.
662
- function TransitionToImpermanentClosing() {
660
+ function TransitionToImpermanentlyClosing() {
663
661
  self._machine.transition('impermanentlyClosing');
664
662
  }
665
663
 
@@ -717,7 +715,7 @@ Example:
717
715
  self.connectionSecure = true;
718
716
  self.options.encrypted = true;
719
717
 
720
- self._machine.transition('impermanentlyClosing')
718
+ TransitionToImpermanentlyClosing();
721
719
  } else if (code < 4100) {
722
720
  // Permentently close connection
723
721
  self._machine.transition('permanentlyClosing')
@@ -727,7 +725,7 @@ Example:
727
725
  self._machine.transition('waiting')
728
726
  } else if (code < 4300) {
729
727
  // Reconnect immediately
730
- self._machine.transition('impermanentlyClosing')
728
+ TransitionToImpermanentlyClosing();
731
729
  } else {
732
730
  // Unknown error
733
731
  self._machine.transition('permanentlyClosing')
@@ -796,14 +794,9 @@ Example:
796
794
  self._machine.transition('waiting');
797
795
  }
798
796
 
799
- function ws_onError() {
800
- self.emit('error', {
801
- type: 'WebSocketError'
802
- });
803
-
804
- // note: required? is the socket auto closed in the case of error?
805
- self.socket.close();
806
- self._machine.transition('impermanentlyClosing');
797
+ function ws_onError(error) {
798
+ // just emit error to user - socket will already be closed by browser
799
+ self.emit('error', { type: 'WebSocketError', error: error });
807
800
  }
808
801
 
809
802
  // Updates the public state information exposed by connection
@@ -877,7 +870,7 @@ Example:
877
870
  Connection.prototype.disconnect = function() {
878
871
  if (this._machine.is('permanentlyClosed')) return;
879
872
 
880
- if (this._machine.is('waiting')) {
873
+ if (this._machine.is('waiting') || this._machine.is('failed')) {
881
874
  this._machine.transition('permanentlyClosed');
882
875
  } else {
883
876
  this._machine.transition('permanentlyClosing');
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-20 00:00:00.000000000 Z
12
+ date: 2012-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pusher
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.9.2
21
+ version: 0.9.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.9.2
29
+ version: 0.9.3
30
30
  description: Adds pusher.js/backpusher.js to the asset pipeline and pusher-gem to
31
31
  to your app.
32
32
  email:
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 1.8.21
65
+ rubygems_version: 1.8.24
66
66
  signing_key:
67
67
  specification_version: 3
68
68
  summary: Pusher integration for Rails 3.1+