提交 97e9c835 编写于 作者: T Thiago A. Silva

Add support for a default-gems file

https://github.com/asdf-vm/asdf-ruby/issues/31
上级 6586e1e1
......@@ -19,6 +19,18 @@ When installing Ruby using `asdf install`, you can pass custom configure options
* `RUBY_CONFIGURE_OPTIONS` - use only your configure options
* `RUBY_EXTRA_CONFIGURE_OPTIONS` - append these configure options along with ones that this plugin already uses
## Default gems
asdf-ruby can automatically install a set of default gems right after
installing a Ruby version. To enable this feature, provide a
`$HOME/.default-gems` file that lists one gem per line, for example:
```
bundler
pry
gem-ctags
```
## Migrating from another Ruby version manager
### `.ruby-version` file
......
......@@ -218,4 +218,24 @@ get_ruby_type() {
}
install_default_gems() {
local default_gems="${HOME}/.default-gems"
if [ ! -f $default_gems ]; then return; fi
echo ""
for name in $(cat $default_gems); do
echo -n "Installing ${name} gem... "
if gem install $name > /dev/null 2>&1; then
echo "SUCCESS"
else
echo "FAIL"
fi
done
}
install_ruby $ASDF_INSTALL_TYPE $ASDF_INSTALL_VERSION $ASDF_INSTALL_PATH
install_default_gems
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册