2018年8月8日にhanami 1.3.0.beta1がリリースとなりました。
個人的に嬉しい改良は、このバージョンから bundle exec hanami new . が期待通りに動くようになったことです。
vendor/bundle を使ってプロジェクトごとに必要な gem をインストールする主義の場合、これまでは、
- テンポラリディレクトリを作り、 ./vendor/bunle に hanami コマンドを実行するために必要な gem を bundle install
- テンポラリディレクトリ内で project_name を引数に bundle exec hanami new project_name
- project_name を本来の位置に移動
のような手順を踏む必要がありましたが、 hanami 1.3 以降は、作成するプロジェクト名に .
を指定した場合、 rails と同様にカレントディレクトリの名前を利用するようになります。
hanami 1.2 までの場合
$ mkdir hanami12
$ cd hanami12
Gemfile
source 'https://rubygems.org'
gem 'hanami', '~> 1.2.0'
$ bundle --path vendor/bundle
$ bundle exec hanami new .
config/environment.rb
require 'bundler/setup'
require 'hanami/setup'
require 'hanami/model'
require_relative '../lib/.' # !!!
require_relative '../apps/web/application'
# <snip>
$ ls -a lib
./ ../ ..rb entities/ mailers/ repositories/
hanami 1.3.beta1 の場合
$ mkdir hanami13
$ cd hanami13
Gemfile
source 'https://rubygems.org'
gem 'hanami', '~> 1.3.0.beta1'
$ bundle --path vendor/bundle
$ bundle exec hanami new .
config/environment.rb
require 'bundler/setup'
require 'hanami/setup'
require 'hanami/model'
require_relative '../lib/hanami13'
require_relative '../apps/web/application'
# <snip>
$ ls -a lib
./ ../ hanami13/ hanami13.rb
$ ls -a lib/hanami13
./ ../ entities/ mailers/ repositories/