json-socket 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/json-socket.rb +4 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d660dd5b48f5743ed87d8ddd9c09114e99b9e4ace9ed164b19d74a846f23b747
4
- data.tar.gz: b6696ce0e69762e258118fa9bae2406e85770bb36438b34cf9b87f5d9cf41d25
3
+ metadata.gz: 46a865cdc1b4ab82e552adcb126791787d5fefe87d27563deeeef81b07d24dab
4
+ data.tar.gz: edf79c31433a6962db8272dbd463b0f60056c129a892b93423ac6333b8e2d169
5
5
  SHA512:
6
- metadata.gz: 7bc8a24a08197f11e38c17772717908cf68b47a3336a1aa31cccca319a4674a43e711cbab39837cb396ee02a46ee6095e596e501f2c28d1edf64a6546f3d18cd
7
- data.tar.gz: db7d1cc05e9164ae828776d68ad9f161beae3fd4afcca2d291d2870baa06813bb220683c24c33e33e32c0643bd607d9351fcd1aa4a20f980a02ca809541e296a
6
+ metadata.gz: 98c75257eb925c267d1ec530a9602d44078c4d21f7e05eafec04531f33a58118f2962aaf7bd84b0cea87b23fbc0ffac9b2c9c23382aff36b87f50d78e89f3574
7
+ data.tar.gz: 8d3f6bbc130ef056f8bc91bcdebe6784a0f2865c68fc3a6f75b5ef82891dc9839e1099dfc53ee3fefd58256ea41f8defe6989f3b0a1235ad3731ebc1674a87a3
@@ -18,7 +18,6 @@ module JSONSocket
18
18
 
19
19
  end
20
20
 
21
-
22
21
  class Server
23
22
 
24
23
  include JsonEncodeDecode
@@ -96,14 +95,16 @@ module JSONSocket
96
95
  socket << "#{strigified.bytesize}#{@delimeter}#{strigified}"
97
96
  message_length = socket.gets(@delimeter).to_i
98
97
  return parse_json(socket.read(message_length))
98
+ ensure
99
+ socket.close
99
100
  end
100
101
 
101
102
  def send(message)
102
103
  begin
103
104
  if @unix_socket
104
- UNIXSocket.open(@unix_socket) {| socket| handle_send_receive(socket, message) }
105
+ UNIXSocket.open(@unix_socket) {|socket| handle_send_receive(socket, message) }
105
106
  else
106
- TCPSocket.open(@host, @port) {| socket| handle_send_receive(socket, message) }
107
+ TCPSocket.open(@host, @port) {|socket| handle_send_receive(socket, message) }
107
108
  end
108
109
  rescue Exception => e
109
110
  STDERR.puts e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - foi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 2.7.7
69
+ rubygems_version: 2.7.6
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: json-socket protocol implementation