json-socket 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json-socket.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d660dd5b48f5743ed87d8ddd9c09114e99b9e4ace9ed164b19d74a846f23b747
|
4
|
+
data.tar.gz: b6696ce0e69762e258118fa9bae2406e85770bb36438b34cf9b87f5d9cf41d25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bc8a24a08197f11e38c17772717908cf68b47a3336a1aa31cccca319a4674a43e711cbab39837cb396ee02a46ee6095e596e501f2c28d1edf64a6546f3d18cd
|
7
|
+
data.tar.gz: db7d1cc05e9164ae828776d68ad9f161beae3fd4afcca2d291d2870baa06813bb220683c24c33e33e32c0643bd607d9351fcd1aa4a20f980a02ca809541e296a
|
data/lib/json-socket.rb
CHANGED
@@ -2,6 +2,8 @@ require "socket"
|
|
2
2
|
require "fileutils"
|
3
3
|
require "oj"
|
4
4
|
|
5
|
+
Oj.default_options = { :mode => :strict }
|
6
|
+
|
5
7
|
module JSONSocket
|
6
8
|
|
7
9
|
module JsonEncodeDecode
|
@@ -21,7 +23,8 @@ module JSONSocket
|
|
21
23
|
|
22
24
|
include JsonEncodeDecode
|
23
25
|
|
24
|
-
def initialize(host: "127.0.0.1", port: 1234, delimeter: "#", unix_socket: nil)
|
26
|
+
def initialize(host: "127.0.0.1", port: 1234, delimeter: "#", unix_socket: nil, oj_options: nil)
|
27
|
+
Oj.default_options = oj_options if oj_options
|
25
28
|
@delimeter = delimeter
|
26
29
|
@stop = false
|
27
30
|
@server = if unix_socket
|
@@ -79,7 +82,8 @@ module JSONSocket
|
|
79
82
|
|
80
83
|
include JsonEncodeDecode
|
81
84
|
|
82
|
-
def initialize(host: "127.0.0.1", port: 1234, delimeter: "#", unix_socket: nil)
|
85
|
+
def initialize(host: "127.0.0.1", port: 1234, delimeter: "#", unix_socket: nil, oj_options: nil)
|
86
|
+
Oj.default_options = oj_options if oj_options
|
83
87
|
@delimeter = delimeter
|
84
88
|
@unix_socket = unix_socket
|
85
89
|
@host = host
|