lsolr 0.0.0 → 0.0.1

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 +4 -4
  2. data/lib/lsolr.rb +4 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2af9d86ec14e9bf006d10b5af744e1c87a52f4d
4
- data.tar.gz: 3891da477cf63a26da48b66f728687ffa99743a6
3
+ metadata.gz: 6720d54fb177afa0758873f10fd7c21aadcea716
4
+ data.tar.gz: 872adfaf99faa64e7e98a344525b7ab6a53742f9
5
5
  SHA512:
6
- metadata.gz: 46592b63cc533c78c7c66d23c1dc82b087e9ab0d14a44cc4b17947a454ee8ff6f5f0a722bd4bad4916a1478fa90a2b6f2f3db2d186c4ea173535402db0532578
7
- data.tar.gz: 194b24916051035de0c74a92d7b19db852630416e865b821ca3f607a633652938b4a39e7d5abb752e2ae11ab40bdaa4470617046dfd973a91570cb1b111c6d04
6
+ metadata.gz: 312018c284bc152e68c770ffd35ea2d952c5ff6505fc1f9bfc5d32297c604bd48a9dd35598eee05ee6e5aa3838c9cdc693c01aec2d00cebefa721a1da576d466
7
+ data.tar.gz: a4056e9a1f33afd62a4bde0d242f404ab041cb9d67d7495c36a9a634365315eb79645208e5c87037ab05e4ebf48e47de75409ee4e471a26fd247717755d16c67
@@ -56,7 +56,7 @@ class LSolr
56
56
  raise 'Please specify a search condition.' if blank?
57
57
 
58
58
  expr = "#{left_parentheses.join}#{@not}#{@field}:#{@value}#{right_parentheses.join}"
59
- expr = "#{prev} #{operator} #{expr}" if prev&.present?
59
+ expr = "#{prev} #{operator} #{expr}" if !prev.nil? && prev.present?
60
60
  "#{expr}#{@boost}"
61
61
  end
62
62
 
@@ -133,7 +133,7 @@ class LSolr
133
133
  # @param distance [Float] proximity distance
134
134
  # @return [LSolr] self instance
135
135
  def fuzzy_match(value, distance: 0.0)
136
- raise RangeError, "Out of #{FUZZY_MATCH_DISTANCE_RANGE}. #{distance} given." unless (FUZZY_MATCH_DISTANCE_RANGE).member?(distance)
136
+ raise RangeError, "Out of #{FUZZY_MATCH_DISTANCE_RANGE}. #{distance} given." unless FUZZY_MATCH_DISTANCE_RANGE.member?(distance)
137
137
  @value = "#{clean(value)}#{PROXIMITY}#{distance}"
138
138
  self
139
139
  end
@@ -181,7 +181,7 @@ class LSolr
181
181
  private
182
182
 
183
183
  def initialize_copy(obj)
184
- obj.prev = obj.prev.dup if obj.prev&.present?
184
+ obj.prev = obj.prev.dup if !obj.prev.nil? && obj.prev.present?
185
185
  obj.left_parentheses = obj.left_parentheses.dup
186
186
  obj.right_parentheses = obj.right_parentheses.dup
187
187
  end
@@ -207,7 +207,7 @@ class LSolr
207
207
  end
208
208
 
209
209
  def take_head(element)
210
- while element.prev&.present? do element = element.prev end
210
+ while !element.prev.nil? && element.prev.present? do element = element.prev end
211
211
  element
212
212
  end
213
213
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lsolr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga