Migrating to Picky 3.0 (from 2.7) Tweet
ruby / picky
This post is intended for Picky users that are at version 2.7 (or near) and would like to move to version 3.0.
An update recipe:
- Rakefile: Rewrite
require 'picky-tasks'
=>require 'picky/tasks'
Index::Memory
has been renamed toIndexes::Memory
, same withIndex::Redis
- If you pass in options into the index initializer: They have been removed. Options now can only be set in the initializer block.
- If you have already been using Sinatra as a server, please do not call
#search_with_text
anymore. Instead call#search(text, ids, offset)
, the new API method. It still returns aResult
. - The
logging.rb
file is notload
ed anymore, so you can load whatever you want (being less opinionated). If you still want to load thelogging.rb
file, pleaserequire
orload
it in the application file, for example. If youload
it in the application file, it will be reloaded if you callPicky::Application.reload
. - If you’ve been using the generated example
logging.rb
, rewritePickyLog =
toPicky.logger =
and do not wrap the::Logger.new
in aLoggers::Search.new
, but just pass the=
the logger. - Note that the generator for a Picky project is now called the “classic” generator, as opposed to the Sinatra generator.
- Note that a “All In One” generator has been added, which generates a combined server/client for use mainly on e.g. Heroku.
- If you use
Results#to_log
, note that it has been renamed toResults#to_s
. - In the client, using
#allocations_size
does not work anymore on results (that have been extended byPicky::Convenience
). Replace withresults.allocations.size
.
These are the main API changes in 3.0.
Thanks for reading and have fun!
Next Migrating to Picky 3.1 (from 3.0)Share
Previous Ego Trippin’