• Edit Gemfile, by changing Hanami version: gem 'hanami', '~> 1.0'

  • Edit Gemfile, by changing Hanami Model version: gem 'hanami-model', '~> 1.0'

  • Edit Gemfile, by removing Bundler: gem 'bundler' can be deleted

  • Add config/boot.rb as shown below

  • Edit config/environment.rb as shown below

  • Edit lib/bookshelf.rb as shown below

  • Edit all the applications to remove the logger settings. Eg. apps/web/application.rb

  • Edit the project using Hanami.logger instead of application level loggers. Eg. Web.logger

config/boot.rb

  1. require_relative './environment'
  2. Hanami.boot

This file can be used to boot your project from external commands. For instance to use it with Sidekiq.

config/environment.rb

  1. require 'bundler/setup'
  2. require 'hanami/setup'
  3. require 'hanami/model'
  4. require_relative '../lib/bookshelf'
  5. require_relative '../apps/web/application'
  6. Hanami.configure do
  7. mount Web::Application, at: '/'
  8. model do
  9. adapter :sql, ENV['DATABASE_URL']
  10. migrations 'db/migrations'
  11. schema 'db/schema.sql'
  12. end
  13. mailer do
  14. # Make sure this folder exists, or delete this row.
  15. root Hanami.root.join("lib", "bookshelf", "mailers")
  16. # This has changed. It used to be a block, now it's a setting
  17. delivery :test
  18. end
  19. # These two blocks are new.
  20. # They MUST be after the general settings like `mount`, `model`, `mailer`.
  21. environment :development do
  22. # See: http://guides.hanamirb.org/projects/logging/
  23. logger level: :info
  24. end
  25. environment :production do
  26. logger level: :info, formatter: :json
  27. mailer do
  28. delivery :smtp, address: ENV['SMTP_HOST'], port: ENV['SMTP_PORT']
  29. end
  30. end
  31. end

lib/bookshelf.rb

  1. module Bookshelf
  2. end

If you have any problem, don’t hesitate to look for help in chat.