From c6d75a2a21014e08fc1a212f2c68c0b5f5aba8f4 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Sun, 27 Nov 2016 17:23:25 +0100 Subject: [PATCH] Add ruby configuration. This configuration should cause Ruby gems to be installed somewhat consistently across my machines, and always in the home directory. --- gem/.config/gem/gemrc | 2 ++ install.sh | 2 +- zsh/.zshenv | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gem/.config/gem/gemrc diff --git a/gem/.config/gem/gemrc b/gem/.config/gem/gemrc new file mode 100644 index 0000000..0a990e1 --- /dev/null +++ b/gem/.config/gem/gemrc @@ -0,0 +1,2 @@ +gem: --no-ri --no-rdoc --user-install +update_sources: true diff --git a/install.sh b/install.sh index 9a0f331..785de8a 100755 --- a/install.sh +++ b/install.sh @@ -50,7 +50,7 @@ installIfAvailable systemctl systemd installIfAvailable pacman installIfAvailable git installIfAvailable latexmk - +installIfAvailable gem if commandAvailable weechat; then echo "Setting up weechat settings…" diff --git a/zsh/.zshenv b/zsh/.zshenv index a974a17..f35b872 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -46,3 +46,14 @@ export WINEPREFIX="$XDG_DATA_HOME/wine" test -f "$XDG_CONFIG_HOME/tmux/tmux.conf" && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf" export TMUX_TMPDIR="$XDG_RUNTIME_DIR"/tmux mkdir -p -m 700 "$TMUX_TMPDIR" + +# Set up Rubygems +if hash gem &> /dev/null; then + export GEMRC="$XDG_CONFIG_HOME/gem/gemrc" + + #TODO: move this to XDG_DATA_HOME + export GEM_HOME=$(ruby -e 'puts Gem.user_dir') + export GEM_PATH=$GEM_HOME + + path+="$GEM_HOME/bin" +fi