biodiversity 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 +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -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
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biodiversity
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dmitry Mozzherin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-10 00:00:00 -04:00
18
+ date: 2011-07-13 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency