parsley-store 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +6 -2
  2. data/VERSION +1 -1
  3. data/lib/parsley-store.rb +6 -1
  4. metadata +3 -3
data/README.rdoc CHANGED
@@ -12,11 +12,15 @@ It stores parsed strings in Redis database and does not repeat work already done
12
12
  == Usage
13
13
 
14
14
  parser = ParsleyStore.new
15
- parser.parse('Homo sapiens sapiens Linn. 1758)
16
- parser.parse('Homo sapiens sapiens Linn. 1758)
15
+ parser.parse('Homo sapiens sapiens Linn. 1758')
16
+ parser.parse('Homo sapiens sapiens Linn. 1758')
17
17
 
18
18
  The second parse must be much faster!
19
19
 
20
+ To get only canonical name:
21
+
22
+ parser.parse('Homo sapiens sapiens Linn. 1758', :canonical_only => true)
23
+
20
24
  == Note on Patches/Pull Requests
21
25
 
22
26
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/parsley-store.rb CHANGED
@@ -27,7 +27,12 @@ class ParsleyStore
27
27
 
28
28
  def get_redis_data
29
29
  if @canonical_only
30
- stored = @local.hget(@scientific_name, 'canonical')
30
+ begin
31
+ stored = @local.hget(@scientific_name, 'canonical')
32
+ rescue RuntimeError
33
+ @local.flushdb
34
+ stored = nil
35
+ end
31
36
  return stored if stored
32
37
  else
33
38
  stored = @local.get(@scientific_name)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsley-store
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dmitry Mozzherin