bel-search-sqlite 0.4.0.beta1 → 0.4.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 845c3dc297bd36958a2ee6032d780e67c50c5f52
4
- data.tar.gz: f2537f99a8af03dd19a2450b1462afff08540963
3
+ metadata.gz: 690b801e9a3e10c23a958aaa15e8f5fac222281c
4
+ data.tar.gz: 63736018617e7b7cac47dcbeb395677f8bd47ad2
5
5
  SHA512:
6
- metadata.gz: ca6ac55e19a601e015f5dbcca3da5407482cf77918d6a2afd49ff6aedff0e067c3ff5d87dcc52f16992c60300dff3e7da98ed3303dc5abe03799dcaf7c547ceb
7
- data.tar.gz: 674a67780673e8eb46d8ac360a3906de7742ec5155aef597383fc5cd417cbb7421f4ae57671e32f662ba94f6f296d267f2e692a7dd4b24a0550e772b6799d74e
6
+ metadata.gz: 9dd18bc6dcb53cad44fbc7acdb371e7064c2c548e26dd489ae7ab9d8abbdf8574aaf8362727c0fb0abc27ffdbe3921449ba40ad25e3689317517549aa8356b65
7
+ data.tar.gz: 0d68b9f8981d36a63375f3a499eb42c4a5f25aeca5925525ed51c065bf0f84c23e28c0e7af6f76239a74b5d87f4bfddc60aaa9cf74a8131a93d635d13fb6b9c3
data/.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'bel-search-sqlite'
3
- spec.version = '0.4.0.beta1'
3
+ spec.version = '0.4.0.beta2'
4
4
  spec.summary = '''
5
5
  Resource search plugin for bel.rb using Sqlite FTS.
6
6
  '''.gsub(%r{^\s+}, ' ').gsub(%r{\n}, '')
@@ -3,7 +3,7 @@ All notable changes to bel-search-sqlite will be documented in this file. The cu
3
3
 
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
- ## [0.1.0][0.1.0] - 2015-11-19
6
+ ## [0.4.0][0.4.0] - 2015-12-09
7
7
  ### Fixed
8
8
  ### Changed
9
9
  ### Added
@@ -24,23 +24,23 @@ module BEL::Resource::Search::Plugins
24
24
  # @see BEL::Resource::Search::API#search
25
25
  def search(query_expression, concept_type = nil, scheme_uri = nil, species = nil, options = {})
26
26
  # required SQL parameters
27
- match = query_expression.encode('UTF-8')
28
- start = (options.delete(:start) || 0).to_i
29
- size = options.delete(:size) || -1
27
+ size = options.delete(:size) || -1
30
28
  if size.to_i.zero?
31
29
  fail ArgumentError.new(":size is zero")
32
30
  end
33
31
 
34
32
  # optional SQL parameters
35
- options = {
33
+ params = {
34
+ :match => query_expression.encode('UTF-8'),
35
+ :start => (options.delete(:start) || 0).to_i,
36
+ :size => size,
36
37
  :concept_type => (concept_type ? concept_type.to_s.encode('UTF-8') : nil),
37
38
  :scheme_uri => (scheme_uri ? scheme_uri.to_s.encode('UTF-8') : nil),
38
39
  :species => (species ? species.to_s.encode('UTF-8') : nil),
39
40
  }
40
- options.keep_if { |key, value| value != nil }
41
41
 
42
42
  query = QUERY_TEMPLATE.result(binding)
43
- enum = @db.fetch(query, :match => match, :start => start, :size => size)
43
+ enum = @db.fetch(query, params)
44
44
 
45
45
  if enum.respond_to? :lazy
46
46
  enum = enum.lazy
@@ -6,7 +6,7 @@ FROM
6
6
  WHERE
7
7
  concepts_fts MATCH :match
8
8
  <% [:concept_type, :scheme_type, :scheme_uri, :species].each do |column| %>
9
- <% if options[column] %>
9
+ <% if params[column] %>
10
10
 
11
11
  AND <%= column %> = <%= ":#{column}" %>
12
12
 
metadata CHANGED
@@ -1,46 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bel-search-sqlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.beta1
4
+ version: 0.4.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Bargnesi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-01 00:00:00.000000000 Z
11
+ date: 2015-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: sequel
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - '='
18
17
  - !ruby/object:Gem::Version
19
18
  version: 4.28.0
20
- type: :runtime
19
+ name: sequel
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.28.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: sqlite3
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - '='
32
31
  - !ruby/object:Gem::Version
33
32
  version: 1.3.11
34
- type: :runtime
33
+ name: sqlite3
35
34
  prerelease: false
35
+ type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.3.11
41
- description: " A resource search plugin for bel.rb that uses FTS tables in Sqlite
42
- to search annotation and namespace values. Built to run on MRI to take advantage
43
- of C extensions. "
41
+ description: " A resource search plugin for bel.rb that uses FTS tables in Sqlite\
42
+ \ to search annotation and namespace values. Built to run on MRI to take advantage\
43
+ \ of C extensions. "
44
44
  email:
45
45
  - abargnesi@selventa.com
46
46
  executables: []
@@ -106,10 +106,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: 1.3.1
108
108
  requirements: []
109
- rubyforge_project:
110
- rubygems_version: 2.4.5.1
111
- signing_key:
109
+ rubyforge_project:
110
+ rubygems_version: 2.4.8
111
+ signing_key:
112
112
  specification_version: 4
113
113
  summary: Resource search plugin for bel.rb using Sqlite FTS.
114
114
  test_files: []
115
- has_rdoc:
115
+ has_rdoc: