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
Index::Memoryhas been renamed to
Indexes::Memory, same with
- 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_textanymore. Instead call
#search(text, ids, offset), the new API method. It still returns a
logging.rbfile is not
loaded anymore, so you can load whatever you want (being less opinionated). If you still want to load the
loadit in the application file, for example. If you
loadit in the application file, it will be reloaded if you call
- If you’ve been using the generated example
Picky.logger =and do not wrap the
Loggers::Search.new, but just pass the
- 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 to
- In the client, using
#allocations_sizedoes not work anymore on results (that have been extended by
Picky::Convenience). Replace with
These are the main API changes in 3.0.
Thanks for reading and have fun!Next Migrating to Picky 3.1 (from 3.0)
Previous Ego Trippin’