Migrating to Picky 3.0 (from 2.7)

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:

  1. Rakefile: Rewrite require 'picky-tasks' => require 'picky/tasks'
  2. Index::Memory has been renamed to Indexes::Memory, same with Index::Redis
  3. If you pass in options into the index initializer: They have been removed. Options now can only be set in the initializer block.
  4. 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 a Result.
  5. The logging.rb file is not load ed anymore, so you can load whatever you want (being less opinionated). If you still want to load the logging.rb file, please require or load it in the application file, for example. If you load it in the application file, it will be reloaded if you call Picky::Application.reload.
  6. If you’ve been using the generated example logging.rb, rewrite PickyLog = to Picky.logger = and do not wrap the ::Logger.new in a Loggers::Search.new, but just pass the = the logger.
  7. Note that the generator for a Picky project is now called the “classic” generator, as opposed to the Sinatra generator.
  8. Note that a “All In One” generator has been added, which generates a combined server/client for use mainly on e.g. Heroku.
  9. If you use Results#to_log, note that it has been renamed to Results#to_s.
  10. In the client, using #allocations_size does not work anymore on results (that have been extended by Picky::Convenience). Replace with results.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)