Skip to content

Commit b1ddfd1

Browse files
author
Mat Brown
committed
Update dependencies; fix some things
1 parent 27f8ae4 commit b1ddfd1

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

Gemfile.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ GEM
77
remote: http://rubygems.org/
88
specs:
99
diff-lcs (1.1.2)
10-
rspec (2.5.0)
11-
rspec-core (~> 2.5.0)
12-
rspec-expectations (~> 2.5.0)
13-
rspec-mocks (~> 2.5.0)
14-
rspec-core (2.5.1)
15-
rspec-expectations (2.5.0)
10+
rspec (2.6.0)
11+
rspec-core (~> 2.6.0)
12+
rspec-expectations (~> 2.6.0)
13+
rspec-mocks (~> 2.6.0)
14+
rspec-core (2.6.0)
15+
rspec-expectations (2.6.0)
1616
diff-lcs (~> 1.1.2)
17-
rspec-mocks (2.5.0)
17+
rspec-mocks (2.6.0)
1818

1919
PLATFORMS
2020
ruby

lib/soolr.rb

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Soolr
1111
autoload :Field, 'soolr/field'
1212

1313
autoload :Condition, 'soolr/condition'
14-
autoload :Not, 'soolr/not'
1514
autoload :EqualTo, 'soolr/equal_to'
1615
autoload :LessThan, 'soolr/less_than'
1716
end

lib/soolr/condition.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Soolr
22
class Condition
3-
def initialize(field, value)
3+
def initialize(field, value, inverted = false)
44
@field, @value, @inverted = field, value, inverted
55
end
66

@@ -15,10 +15,14 @@ def to_boolean_query
1515
end
1616

1717
def ==(other)
18-
!other.respond_to?(:to_boolean_query) ||
18+
other.respond_to?(:to_boolean_query) &&
1919
to_boolean_query == other.to_boolean_query
2020
end
2121

22+
def inverse
23+
self.class.new(@field, @value, !@inverted)
24+
end
25+
2226
private
2327

2428
def serialized_value

lib/soolr/equal_to.rb

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
module Soolr
22
class EqualTo < Condition
3-
def inverse
4-
Not.new(self)
5-
end
6-
73
def to_boolean_expression
84
escape(serialized_value)
95
end

lib/soolr/not.rb

-15
This file was deleted.

0 commit comments

Comments
 (0)