protocol-websocket 0.12.0 → 0.13.0

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
  SHA256:
3
- metadata.gz: 336e62c38fbb57000bf3183e14f750224706504cd8777bbc7d09505f71a0d65e
4
- data.tar.gz: 2bb63e4bab32ba833f90e5f2857ae198a4f0b9aa66404044ac192e9bcc04c726
3
+ metadata.gz: c93940911ada80aa95de9bf5a1412dd20248a77855f4b9bd523a06b699294795
4
+ data.tar.gz: f7fd77275a0d1269e3586e56b08f18f2e10f18c816085e8bea7de95da4d282b0
5
5
  SHA512:
6
- metadata.gz: eba17e42ae64f93fd5d427245b916fb25c6c09971db2d15969d6b8e29aaea22fb1ab39d52aff19fb46157003bf5c277b0aab1194f00a3fc04532fb1bfa1ab3ca
7
- data.tar.gz: e228e38de1c954c9c7c506bc73c94194eea02bb51ee5d0baaae61b98820f831a409970c00a74846a70d0a7642ea807d7e6c09734c388d9634379f0e1bef659cc
6
+ metadata.gz: 2d54e303617a6ff069bf7ee5e8cb5539c3217bfa0613e2290203edca66695ad926ff40959c2edf694a82b05485a403ec96bedccf76587ae47e3107ff8ccd49ec
7
+ data.tar.gz: 8d07512b928d9060af02945caf8cc1680154f220c4f741ee23fc9520f5d8e3f1ae99470aa28d390b9c9611de667eed0e6c58ffb59b705d356b117a51fc3908ee
checksums.yaml.gz.sig CHANGED
Binary file
@@ -54,21 +54,29 @@ module Protocol
54
54
  attr :context_takeover
55
55
 
56
56
  def pack_text_frame(buffer, compress: true, **options)
57
- buffer = self.deflate(buffer)
57
+ if compress
58
+ buffer = self.deflate(buffer)
59
+ end
58
60
 
59
61
  frame = @parent.pack_text_frame(buffer, **options)
60
62
 
61
- frame.flags |= Frame::RSV1
63
+ if compress
64
+ frame.flags |= Frame::RSV1
65
+ end
62
66
 
63
67
  return frame
64
68
  end
65
69
 
66
70
  def pack_binary_frame(buffer, compress: false, **options)
67
- buffer = self.deflate(buffer)
71
+ if compress
72
+ buffer = self.deflate(buffer)
73
+ end
68
74
 
69
75
  frame = @parent.pack_binary_frame(buffer, **options)
70
76
 
71
- frame.flags |= Frame::RSV1
77
+ if compress
78
+ frame.flags |= Frame::RSV1
79
+ end
72
80
 
73
81
  return frame
74
82
  end
@@ -54,12 +54,11 @@ module Protocol
54
54
 
55
55
  frame = frames.first
56
56
 
57
- if frame.flags & Frame::RSV1
57
+ if frame.flag?(Frame::RSV1)
58
58
  buffer = self.inflate(buffer)
59
+ frame.flags &= ~Frame::RSV1
59
60
  end
60
61
 
61
- frame.flags &= ~Frame::RSV1
62
-
63
62
  return buffer
64
63
  end
65
64
 
@@ -34,6 +34,10 @@ module Protocol
34
34
  @payload = payload
35
35
  end
36
36
 
37
+ def flag?(value)
38
+ @flags & value != 0
39
+ end
40
+
37
41
  def <=> other
38
42
  to_ary <=> other.to_ary
39
43
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module WebSocket
8
- VERSION = "0.12.0"
8
+ VERSION = "0.13.0"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2023, by Samuel Williams.
3
+ Copyright, 2019-2024, by Samuel Williams.
4
4
  Copyright, 2019, by Soumya.
5
5
  Copyright, 2019, by William T. Nelson.
6
6
  Copyright, 2020, by Olle Jonsson.
data/readme.md CHANGED
@@ -17,3 +17,11 @@ We welcome contributions to this project.
17
17
  3. Commit your changes (`git commit -am 'Add some feature'`).
18
18
  4. Push to the branch (`git push origin my-new-feature`).
19
19
  5. Create new Pull Request.
20
+
21
+ ### Developer Certificate of Origin
22
+
23
+ This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
24
+
25
+ ### Contributor Covenant
26
+
27
+ This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2023-07-01 00:00:00.000000000 Z
44
+ date: 2024-05-17 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: protocol-http
@@ -57,62 +57,6 @@ dependencies:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0.2'
60
- - !ruby/object:Gem::Dependency
61
- name: protocol-http1
62
- requirement: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '0.2'
67
- type: :runtime
68
- prerelease: false
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '0.2'
74
- - !ruby/object:Gem::Dependency
75
- name: bundler
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: '0'
81
- type: :development
82
- prerelease: false
83
- version_requirements: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- - !ruby/object:Gem::Dependency
89
- name: covered
90
- requirement: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
- type: :development
96
- prerelease: false
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- - !ruby/object:Gem::Dependency
103
- name: sus
104
- requirement: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '0.16'
109
- type: :development
110
- prerelease: false
111
- version_requirements: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '0.16'
116
60
  description:
117
61
  email:
118
62
  executables: []
@@ -145,7 +89,9 @@ files:
145
89
  homepage: https://github.com/socketry/protocol-websocket
146
90
  licenses:
147
91
  - MIT
148
- metadata: {}
92
+ metadata:
93
+ documentation_uri: https://socketry.github.io/protocol-websocket/
94
+ source_code_uri: https://github.com/socketry/protocol-websocket.git
149
95
  post_install_message:
150
96
  rdoc_options: []
151
97
  require_paths:
@@ -154,14 +100,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
100
  requirements:
155
101
  - - ">="
156
102
  - !ruby/object:Gem::Version
157
- version: '3.0'
103
+ version: '3.1'
158
104
  required_rubygems_version: !ruby/object:Gem::Requirement
159
105
  requirements:
160
106
  - - ">="
161
107
  - !ruby/object:Gem::Version
162
108
  version: '0'
163
109
  requirements: []
164
- rubygems_version: 3.5.0.dev
110
+ rubygems_version: 3.3.7
165
111
  signing_key:
166
112
  specification_version: 4
167
113
  summary: A low level implementation of the WebSocket protocol.
metadata.gz.sig CHANGED
Binary file