websocket_parser 0.1.2 → 0.1.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: 335707fc3524a93fd68be3d77cb8d9fa7b3c90d9
4
- data.tar.gz: 15a83dbd7e48b16b5f50ba5b76261d1cb4baa1bf
3
+ metadata.gz: 44b06b012bde86cc8f738bb495171011343eb5e5
4
+ data.tar.gz: 52b426bacfe7868cced01be9f31fbdb6d510b4bb
5
5
  SHA512:
6
- metadata.gz: cb027ae11b31e48fda204dcec4e58983ca348f63920188bab5f7e84fd290dc24925211a5802045fb7af9318307bb0fe22366a6f2eaaa46dd06ee756c60cac5cd
7
- data.tar.gz: 0e6f5148b006c1da6d53f6fae26f8b44384d83f13e7351f7c47ffbf4a03f0ecfdd6074bad8b89fce9b9b19c1d4d44d8d3f06e3d6f90cafd14e84a4436be07ff6
6
+ metadata.gz: bfc4e078ff80f30e66e9880a7db3e263e9cd458d8e2b85ffb1e9f86a611e6e0f545d3eb663e77898f4c8504076c097165bc282b1b94a4e7b1593587bd8990a55
7
+ data.tar.gz: 46602d290abfc3bb7538e2439522b4ff14ce2ec5ccf4fb104ceddc93eb2850d8761cfadaf083e5bf78e6c82c3455c97b1b4ae1428be6158363f7c2646d1926a2
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'jruby-openssl' if defined? JRUBY_VERSION
4
4
 
data/README.md CHANGED
@@ -84,10 +84,6 @@ parser << socket.read(4096)
84
84
 
85
85
  ```
86
86
 
87
- ## Status
88
-
89
- Websocket Parser is still in early development phase.
90
-
91
87
  ## Contributing
92
88
 
93
89
  1. Fork it
@@ -3,13 +3,14 @@ module WebSocket
3
3
  attr_reader :type, :mask_key, :status_code, :payload, :status_message
4
4
 
5
5
  # Return a new ping message
6
- def self.ping
7
- new('', :ping)
6
+ def self.ping(payload = '')
7
+ new(payload, :ping)
8
8
  end
9
9
 
10
10
  # Return a new pong message
11
- def self.pong
12
- new('', :pong)
11
+ def self.pong(ping = nil)
12
+ payload = ping ? ping.payload : ''
13
+ new(payload, :pong)
13
14
  end
14
15
 
15
16
  # Return a new close message
@@ -1,3 +1,3 @@
1
1
  module WebSocket
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -39,4 +39,12 @@ describe WebSocket::Message do
39
39
  it "does not allow a status message without status code" do
40
40
  expect{ WebSocket::Message.close(nil, 'Bye') }.to raise_error(ArgumentError)
41
41
  end
42
+
43
+ it "can create a pong message from a ping message" do
44
+ ping = WebSocket::Message.ping('Roman Ping Pong')
45
+ pong = WebSocket::Message.pong(ping)
46
+
47
+ pong.type.should == :pong
48
+ pong.payload.should == 'Roman Ping Pong'
49
+ end
42
50
  end
@@ -180,6 +180,4 @@ describe WebSocket::Parser do
180
180
  received_messages.first.should == data
181
181
  end
182
182
  end
183
-
184
-
185
183
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocket_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Fernandez-Capel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-09 00:00:00.000000000 Z
11
+ date: 2013-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http