Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Experimental implementation of ignore and only
- Loading branch information
Showing
13 changed files
with
288 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module Picky | ||
|
||
module Query | ||
|
||
class Indexes | ||
|
||
# | ||
# | ||
class Check | ||
|
||
class << self | ||
|
||
# Returns the right combinations strategy for | ||
# a number of query indexes. | ||
# | ||
# Currently it isn't possible using Memory and Redis etc. | ||
# indexes in the same query index group. | ||
# | ||
# Picky will raise a Query::Indexes::DifferentBackendsError. | ||
# | ||
def check_backends indexes | ||
backends = indexes.map &:backend | ||
backends.uniq! &:class | ||
raise_different backends if backends.size > 1 | ||
backends | ||
end | ||
def raise_different backends | ||
raise DifferentBackendsError.new(backends) | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
# Currently it isn't possible using Memory and Redis etc. | ||
# indexes in the same query index group. | ||
# | ||
class DifferentBackendsError < StandardError | ||
def initialize backends | ||
@backends = backends | ||
end | ||
def to_s | ||
"Currently it isn't possible to mix Indexes with backends #{@backends.join(" and ")} in the same Search instance." | ||
end | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.