Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ちょっとしたハックを書き始め、途中で「gem install xxx」をいくつか実行しました。小さなハックが大きくなりました。インストールしたすべての gem を思い出すことはできません。移植性のために、必要な gem を指定する Gemfile を作成したいと思います。
Gemfile で指定できるように、アプリが使用している gem を確認する信頼できる方法はありますか? 新しい環境を作成して実行し、何が壊れているかを確認できます。しかし、おそらくもっと簡単な方法がありますか?
モンキー パッチと優れたテスト スイートはあなたの友達です。これを使って:
module Kernel alias_method :old_require, :require def require(name) puts name old_require(name) end end
そして、テストを実行します。