Skip to content

Commit

Permalink
Merge pull request #150 from j-o-lantern0422/ruby2.7-warning
Browse files Browse the repository at this point in the history
pass the block explicitly
  • Loading branch information
floere committed Nov 27, 2020
2 parents f4d1f9d + 0406573 commit 7c513f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/lib/picky/index.rb
Expand Up @@ -117,15 +117,15 @@ class Index
# result_identifier :my_special_results
# end
#
def initialize name
def initialize name, &proc
@name = name.intern
@categories = Categories.new

# Centralized registry.
#
Indexes.register self

instance_eval(&Proc.new) if block_given?
instance_eval(&proc) if block_given?
end

# Provide hints for Picky so it can optimise.
Expand Down
4 changes: 2 additions & 2 deletions server/lib/picky/search.rb
Expand Up @@ -37,10 +37,10 @@ class Search
# [:title, :isbn] => +1
# end
#
def initialize *indexes
def initialize *indexes, &proc
@indexes = Query::Indexes.new *indexes

instance_eval(&Proc.new) if block_given?
instance_eval(&proc) if block_given?

@tokenizer ||= Tokenizer.searching # THINK Not dynamic. Ok?
@boosts ||= Query::Boosts.new
Expand Down

0 comments on commit 7c513f0

Please sign in to comment.