bundle gem sample_sample
このbin配下には、console , setup があって
./bin/console
を実行するとirbが
2.3.0 :001 >
一方
./bin/setup
を実行するとbundle installが動きます。
bundle install
+ bundle install
Resolving dependencies...
Using rake 10.5.0
Using bundler 1.11.2
Using sample_project 0.1.0 from source at `.`
Bundle complete! 3 Gemfile dependencies, 3 gems now installed.
Bundled gems are installed into ./vendor/bundle.
# Do any other automated setup that you need to do here
というのも
BundlerでRubygemsとGitHubに公開してみる
にて、
bin/setupはbundle installを実行するもので、その他のセットアップ処理を追加する場合は、こちらを利用しましょう。
とあり、どうやってやるんだ??と思って調べていたところ
に
bin/setupスクリプトが導入されました。これはアプリケーションの初期設定時に設定を自動化するためのコードの置き場所となります。
とあり、やっとここで
vim ./bin/setup
すると
# !/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx
bundle install
# Do any other automated setup that you need to do here
ここに追加すればいいんですね!
ちなみに*./bin/console* は
# !/usr/bin/env ruby
require "bundler/setup"
require "sample_project"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
IRB.start
IRBやってるだけ!!!!