lsolr 0.2.4 → 0.2.5

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 +5 -5
  2. data/lib/lsolr.rb +7 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 6b61a359f44587f3d0427b918647b04a7f43ce6a9ec9e394ae4ca09c68f59386
4
- data.tar.gz: f4b20307a1239c0277d218670401a5187c85df9a0147aae90a1435fb13c68dbe
2
+ SHA1:
3
+ metadata.gz: f62e3d6943a8335c86176d97a925c07264012114
4
+ data.tar.gz: 2697a1848081fe67280fd3359d19ccbb4ca1faec
5
5
  SHA512:
6
- metadata.gz: 40abee52d81c47d9a1ff70c86045d58f17869c43f2b8fc7cf054229ce50597b9a86a8a93a309e090c3ecf1d459676f2f9105ec409f24162a328c64c8cf9289b7
7
- data.tar.gz: bb8d98b7c36eebc3425665d1d3c7661eed341e997aa8c09c2a1b99a9c3f78dd5fe50630e0183844c6446db14eb2bff0acfb33c7f0bd52d509ff75397200b6f09
6
+ metadata.gz: 63fb621dc8e66cfbebbb4ac88b3a90b612f74070583c0f04a96cac426e731f68fb8dea300bf454ef5fe47a6872fa77c03740335a59f1d920b908ca44a6bd2343
7
+ data.tar.gz: 3890d9c7a11a34ce2b5939217efb2026da5fe559bde94948361c7b78730ae0ca18cb51a37a32dbbe529824b5656a436ef5536d86cb6c7c0b76472fa5d7d4994b
data/lib/lsolr.rb CHANGED
@@ -299,7 +299,13 @@ class LSolr
299
299
  # @param value [String, Integer, true, false] a search word or a filter value
300
300
  #
301
301
  # @return [LSolr] self instance
302
+ #
303
+ # @raise [LSolr::ArgumentError] if specified value is empty
302
304
  def match(value)
305
+ raise ArgumentError, "`#{value}` given. It must be a not empty value." unless present_string?(value.to_s)
306
+ return match_in(value) if value.is_a?(Array)
307
+ return date_time_match(value) if value.is_a?(Date) || value.is_a?(Time)
308
+
303
309
  values = clean(value).split
304
310
 
305
311
  if values.size > 1
@@ -319,6 +325,7 @@ class LSolr
319
325
  # @raise [LSolr::ArgumentError] if specified value is a empty array or not array
320
326
  def match_in(values)
321
327
  raise ArgumentError, "`#{values}` given. It must be a not empty array." unless present_array?(values)
328
+ return match(values.first) if values.size == 1
322
329
 
323
330
  values = values.map { |v| clean(v) }
324
331
  @value = "(#{values.join(DELIMITER_SPACE)})"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lsolr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-19 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: LSolr is a query builder for Apache Solr in Ruby. It supports only the
14
14
  standard query.
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  requirements: []
40
40
  rubyforge_project:
41
- rubygems_version: 2.7.4
41
+ rubygems_version: 2.6.13
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: A query builder for Apache Solr in Ruby