protocol-websocket 0.21.1 → 0.21.2

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
  SHA256:
3
- metadata.gz: 9d235a3a271493c223dda297cb508d9be00b2abf75a425cd0dada77f5eec94e2
4
- data.tar.gz: 348ba1d7a04ebb63a5d521a1605d7503bdb8ab727992e6657106444928231201
3
+ metadata.gz: a83c2f568dee5cc427ce444fe4a39ec9da5cff785dce156b20dbf45ff262643d
4
+ data.tar.gz: 42b64b8575ba9d5af47daac91b50a415ed008c5fd683e15035969cec6ea2b849
5
5
  SHA512:
6
- metadata.gz: ed8567becfa23f00a414801b263d3aa28db0ce790ab4823160efba567bd4efeab86beb3b77c8729e9df523ae39f8cbe9afb53b5c313afdb45be63640e0e5f339
7
- data.tar.gz: d61ec56857439b1fd58469c28b28132948036b7d4033cf431786dba5b05931863674e285d5fabd012106e44839fe47bbe2273c2b4fda4b3566a52fadb8204723
6
+ metadata.gz: d982707a934596bb8578f16b8609b5e24935004f8791ef66c7d12b68df4ae90a726c6cb47f0c6ee80b3806236aa4b6d190589e8569e473b4aa463314977ab52a
7
+ data.tar.gz: 8d81f1ba7dba3b4c2ab910fcdb38c8c268d6f3689001bdee496a646605f0784a7293a143355ee6f13b8ab40b475de190c90734410d5f6308cb8ba6a1e12d5aa5
checksums.yaml.gz.sig CHANGED
Binary file
data/context/index.yaml CHANGED
@@ -3,6 +3,8 @@
3
3
  ---
4
4
  description: A low level implementation of the WebSocket protocol.
5
5
  metadata:
6
+ bug_tracker_uri: https://github.com/socketry/protocol-websocket/issues
7
+ changelog_uri: https://github.com/socketry/protocol-websocket/blob/main/releases.md
6
8
  documentation_uri: https://socketry.github.io/protocol-websocket/
7
9
  source_code_uri: https://github.com/socketry/protocol-websocket.git
8
10
  files:
@@ -9,25 +9,16 @@ module Protocol
9
9
  module WebSocket
10
10
  module Coder
11
11
  # A JSON coder that uses the standard JSON library.
12
- class JSON
13
- # Initialize a new JSON coder.
14
- # @parameter options [Hash] Options to pass to the JSON library when parsing or generating.
15
- def initialize(**options)
16
- @options = options
17
- end
18
-
12
+ module JSON
19
13
  # Parse a JSON buffer into an object.
20
- def parse(buffer)
21
- ::JSON.parse(buffer, **@options)
14
+ def self.parse(buffer)
15
+ ::JSON.parse(buffer, symbolize_names: true)
22
16
  end
23
17
 
24
18
  # Generate a JSON buffer from an object.
25
- def generate(object)
26
- ::JSON.generate(object, **@options)
19
+ def self.generate(object)
20
+ ::JSON.generate(object)
27
21
  end
28
-
29
- # The default JSON coder. This coder will symbolize names.
30
- DEFAULT = new(symbolize_names: true)
31
22
  end
32
23
  end
33
24
  end
@@ -10,7 +10,7 @@ module Protocol
10
10
  # @namespace
11
11
  module Coder
12
12
  # The default coder for WebSocket messages.
13
- DEFAULT = JSON::DEFAULT
13
+ DEFAULT = JSON
14
14
  end
15
15
  end
16
16
  end
@@ -7,6 +7,6 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module WebSocket
10
- VERSION = "0.21.1"
10
+ VERSION = "0.21.2"
11
11
  end
12
12
  end
data/readme.md CHANGED
@@ -16,6 +16,10 @@ Please see the [project documentation](https://socketry.github.io/protocol-webso
16
16
 
17
17
  Please see the [project releases](https://socketry.github.io/protocol-websocket/releases/index) for all releases.
18
18
 
19
+ ### v0.21.2
20
+
21
+ - Fix JSON 3 compatibility by applying `symbolize_names` only when parsing incoming messages. `Coder::JSON` is now a module with fixed parsing and generation behavior; pass a different coder to customize serialization.
22
+
19
23
  ### v0.21.1
20
24
 
21
25
  - If `Connection#close_write` fails, the connection will now be fully closed to prevent hanging connections.
@@ -53,35 +57,30 @@ Please see the [project releases](https://socketry.github.io/protocol-websocket/
53
57
 
54
58
  - Introduce `#close_write` and `#shutdown` methods on `Connection` for more precise connection lifecycle control.
55
59
 
56
- ### v0.16.0
57
-
58
- - Move `#send` logic into `Message` for better encapsulation.
59
- - Improve error handling when a `nil` message is passed.
60
-
61
60
  ## Contributing
62
61
 
63
62
  We welcome contributions to this project.
64
63
 
65
- 1. Fork it.
64
+ 1. Fork the repository.
66
65
  2. Create your feature branch (`git checkout -b my-new-feature`).
67
- 3. Commit your changes (`git commit -am 'Add some feature'`).
66
+ 3. Commit your changes (`git commit -am 'Add some feature.'`).
68
67
  4. Push to the branch (`git push origin my-new-feature`).
69
- 5. Create new Pull Request.
68
+ 5. Create a new pull request.
70
69
 
71
70
  ### Running Tests
72
71
 
73
72
  To run the test suite:
74
73
 
75
- ``` shell
76
- bundle exec sus
74
+ ``` bash
75
+ $ bundle exec sus
77
76
  ```
78
77
 
79
78
  ### Making Releases
80
79
 
81
80
  To make a new release:
82
81
 
83
- ``` shell
84
- bundle exec bake gem:release:patch # or minor or major
82
+ ``` bash
83
+ $ bundle exec bake gem:release:patch # or minor or major
85
84
  ```
86
85
 
87
86
  ### Developer Certificate of Origin
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.21.2
4
+
5
+ - Fix JSON 3 compatibility by applying `symbolize_names` only when parsing incoming messages. `Coder::JSON` is now a module with fixed parsing and generation behavior; pass a different coder to customize serialization.
6
+
3
7
  ## v0.21.1
4
8
 
5
9
  - If `Connection#close_write` fails, the connection will now be fully closed to prevent hanging connections.
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.21.1
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -92,6 +92,8 @@ homepage: https://github.com/socketry/protocol-websocket
92
92
  licenses:
93
93
  - MIT
94
94
  metadata:
95
+ bug_tracker_uri: https://github.com/socketry/protocol-websocket/issues
96
+ changelog_uri: https://github.com/socketry/protocol-websocket/blob/main/releases.md
95
97
  documentation_uri: https://socketry.github.io/protocol-websocket/
96
98
  source_code_uri: https://github.com/socketry/protocol-websocket.git
97
99
  rdoc_options: []
metadata.gz.sig CHANGED
Binary file