biodiversity19 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. data/VERSION +1 -1
  2. data/bin/parserver +11 -10
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
data/bin/parserver CHANGED
@@ -80,18 +80,19 @@ parser = ScientificNameParser.new
80
80
  server = TCPServer.open(OPTIONS[:port]) # Socket to listen on a port
81
81
  loop do # Servers run forever
82
82
  client = server.accept # Wait for a client to connect
83
- while true
84
- begin
85
- a = client.readline
86
- a.force_encoding("utf-8") if a && RUBY_VERSION_INT >= 19
87
- if ['end','exit','q', '.'].include? a.strip
88
- client.close
89
- break
90
- end
91
- client.puts get_output(a, parser)
92
- rescue EOFError
83
+ puts 'opening client'
84
+ count = 0
85
+ while a = client.readline rescue nil
86
+ count += 1
87
+ puts "parsed %s'th name" % count if count % 1000 == 0
88
+ a.force_encoding("utf-8") if a && RUBY_VERSION_INT >= 19
89
+ if ['end','exit','q', '.'].include? a.strip
93
90
  client.close
94
91
  break
95
92
  end
93
+ out = get_output(a, parser).strip
94
+ client.write(out + "\n") rescue break
96
95
  end
96
+ puts 'closing client'
97
+ client.close
97
98
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: biodiversity19
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dmitry Mozzherin
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-10 00:00:00 Z
13
+ date: 2011-07-13 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: treetop