socket.io-rails 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49d267bbff582c831c7d3f9c8b876aa6f2a3d875
4
- data.tar.gz: 8199c53fe20d9b2bf2e08d920437a895191ee8ed
3
+ metadata.gz: fe39cef77a14096970e6c264320fe5b475ca4b11
4
+ data.tar.gz: 4da22ce362e7b65ef904f2aabddd1acd3dba5e8d
5
5
  SHA512:
6
- metadata.gz: 1f190f739f2ba8742458aaf4eaa4da6e2dbdf21bd8a2ec7f3df38e536c203434e2888e5a58b4e37baf62c39348299a8af387a90b37f964cfe98546e8c00e171c
7
- data.tar.gz: 95ae32fddc6f0dc905cad7afc8b92ad6e22acc97ff7ccac4674c9c547853fefb67b9217fb7d12a2f2d4d66dca069d665b67950b8967211da93e32ca7766106c3
6
+ metadata.gz: 1038d77c97e3766feda511081e7f8718c75ef7a401c9fe3efd3b85c9361de187712a135b0e8e2fbd57abcc4b1ff4fc372fa9479ab31da590358b3b68045f24ac
7
+ data.tar.gz: 5897bef70a90254ba85704da0987f1476f4253eaed18965f8c1de446d8816563caa3694ac1d30cf510ea6ff20abbbd989604f4ea95aebb5ffbf7768422d61230
@@ -1,5 +1,5 @@
1
1
  module Socketio
2
2
  module Rails
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -772,6 +772,10 @@ Socket.prototype.onpacket = function(packet){
772
772
  this.onack(packet);
773
773
  break;
774
774
 
775
+ case parser.BINARY_ACK:
776
+ this.onack(packet);
777
+ break;
778
+
775
779
  case parser.DISCONNECT:
776
780
  this.ondisconnect();
777
781
  break;
@@ -820,8 +824,10 @@ Socket.prototype.ack = function(id){
820
824
  sent = true;
821
825
  var args = toArray(arguments);
822
826
  debug('sending ack %j', args);
827
+
828
+ var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;
823
829
  self.packet({
824
- type: parser.ACK,
830
+ type: type,
825
831
  id: id,
826
832
  data: args
827
833
  });
@@ -4738,6 +4744,7 @@ exports.types = [
4738
4744
  'EVENT',
4739
4745
  'BINARY_EVENT',
4740
4746
  'ACK',
4747
+ 'BINARY_ACK',
4741
4748
  'ERROR'
4742
4749
  ];
4743
4750
 
@@ -4789,6 +4796,14 @@ exports.ERROR = 4;
4789
4796
 
4790
4797
  exports.BINARY_EVENT = 5;
4791
4798
 
4799
+ /**
4800
+ * Packet type `binary ack`. For acks with binary arguments.
4801
+ *
4802
+ * @api public
4803
+ */
4804
+
4805
+ exports.BINARY_ACK = 6;
4806
+
4792
4807
  exports.Encoder = Encoder
4793
4808
 
4794
4809
  /**
@@ -4811,7 +4826,7 @@ function Encoder() {};
4811
4826
  Encoder.prototype.encode = function(obj, callback){
4812
4827
  debug('encoding packet %j', obj);
4813
4828
 
4814
- if (exports.BINARY_EVENT == obj.type || exports.ACK == obj.type) {
4829
+ if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {
4815
4830
  encodeAsBinary(obj, callback);
4816
4831
  }
4817
4832
  else {
@@ -4836,7 +4851,7 @@ function encodeAsString(obj) {
4836
4851
  str += obj.type;
4837
4852
 
4838
4853
  // attachments if we have them
4839
- if (exports.BINARY_EVENT == obj.type || exports.ACK == obj.type) {
4854
+ if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {
4840
4855
  str += obj.attachments;
4841
4856
  str += '-';
4842
4857
  }
@@ -4922,7 +4937,7 @@ Decoder.prototype.add = function(obj) {
4922
4937
  var packet;
4923
4938
  if ('string' == typeof obj) {
4924
4939
  packet = decodeString(obj);
4925
- if (exports.BINARY_EVENT == packet.type || exports.ACK == packet.type) { // binary packet's json
4940
+ if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json
4926
4941
  this.reconstructor = new BinaryReconstructor(packet);
4927
4942
 
4928
4943
  // no attachments, labeled binary but no binary data to follow
@@ -4968,7 +4983,7 @@ function decodeString(str) {
4968
4983
  if (null == exports.types[p.type]) return error();
4969
4984
 
4970
4985
  // look up attachments if type binary
4971
- if (exports.BINARY_EVENT == p.type || exports.ACK == p.type) {
4986
+ if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {
4972
4987
  p.attachments = '';
4973
4988
  while (str.charAt(++i) != '-') {
4974
4989
  p.attachments += str.charAt(i);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socket.io-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-30 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties