However I thought: How I can make the title dinamically?
Well, when I change to the directory "voluntary", the gemspec is changed also. To do that I moved to my voluntary directory and executed:
rvm --create use --rvmrc ruby-1.9.3-p362@voluntary
So a .rvmrc file is created, and it changes the gemset for using ruby-1.9.3-p362@voluntary each time you move to "voluntary" directory.
Then, I wrote the script ~/bin/get_gemset.sh:
#!/bin/sh
DEFAULT_GEMSET="/Users/mcberros/.rvm/gems/ruby-1.9.3-p362"
GEMSET=`rvm gemset name`
if [ "$GEMSET" == "$DEFAULT_GEMSET" ]; then
echo 'default'
else
echo $GEMSET
fi
You must execute:
chmod u+x get_gemset.sh
Also, I modified my .bash_profile to add the following lines:
export PATH=~/bin:$PATH
PROMPT_COMMAND='echo -ne "\033]0;`get_gemset.sh`"; echo -ne "\007"'
Important: This line has to be the last in your .bash_profile:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Then, reload your .bash_profile with the command:
source .bash_profile
By the way, this weekend I am in the Baruco conference (http://www.baruco.org/) in the beautiful city of Barcelona.
Nice weekend!!!
Keine Kommentare:
Kommentar veröffentlichen