json-socket 1.0.3 → 1.0.4

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 +5 -1
  3. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46a865cdc1b4ab82e552adcb126791787d5fefe87d27563deeeef81b07d24dab
4
- data.tar.gz: edf79c31433a6962db8272dbd463b0f60056c129a892b93423ac6333b8e2d169
3
+ metadata.gz: c5b25be9f8edfe3dadee684bfc30dcccc5195349a423f39c21d7dc89e88d876a
4
+ data.tar.gz: 12d01e5b7587929b7d1756ee54ab599eb03a2cefca37091d44f9b6b6a1eed1ec
5
5
  SHA512:
6
- metadata.gz: 98c75257eb925c267d1ec530a9602d44078c4d21f7e05eafec04531f33a58118f2962aaf7bd84b0cea87b23fbc0ffac9b2c9c23382aff36b87f50d78e89f3574
7
- data.tar.gz: 8d3f6bbc130ef056f8bc91bcdebe6784a0f2865c68fc3a6f75b5ef82891dc9839e1099dfc53ee3fefd58256ea41f8defe6989f3b0a1235ad3731ebc1674a87a3
6
+ metadata.gz: 8c6a5697b322807ed6676ca82e355705d455b83fd488fb0b3d57754c04c3d9eab4f90641fcc79d30b6e99e5f15738a99ad0f42c3e8c63cc9cc31f3a4d2c4fe74
7
+ data.tar.gz: 895a212c1c6a5ad27b7ba44676a2da45dd36e5c3d7d306413df10e823d27d841614dd9a45f830676ef0ae348f5984397842f0d1ff87d6722fa172790746a4534
data/lib/json-socket.rb CHANGED
@@ -47,13 +47,17 @@ module JSONSocket
47
47
  message_length = client.gets(@delimeter).to_i
48
48
  on_message(parse_json(client.read(message_length)), client)
49
49
  rescue Exception => e
50
- STDERR.puts e.message
50
+ on_error e
51
51
  end
52
52
  end
53
53
  break if @stop
54
54
  end
55
55
  end
56
56
 
57
+ def on_error e
58
+ STDERR.puts e.message
59
+ end
60
+
57
61
  def on_message(message, client)
58
62
  puts "Default on_message method - please override like this: \n" \
59
63
  " \n" \
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - foi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-03 00:00:00.000000000 Z
11
+ date: 2023-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -50,7 +50,7 @@ homepage: https://github.com/foi/ruby-json-socket
50
50
  licenses:
51
51
  - MIT
52
52
  metadata: {}
53
- post_install_message:
53
+ post_install_message:
54
54
  rdoc_options: []
55
55
  require_paths:
56
56
  - lib
@@ -65,9 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubyforge_project:
69
- rubygems_version: 2.7.6
70
- signing_key:
68
+ rubygems_version: 3.4.1
69
+ signing_key:
71
70
  specification_version: 4
72
71
  summary: json-socket protocol implementation
73
72
  test_files: []