You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Peter Schröder <ps...@blau.de> on 2010/01/01 17:13:46 UTC

jruby ruby environment switch

hi,

i have a non-buildr-related question, but i think that here is a good place to ask!

i am currently working on os-x with ruby and jruby related tasks. i am including my jruby executables and gems to the path in my .profile file.
if i want to switch to the default ruby environment i comment out that line and jruby is gone.
i have to reopen the command-lines everytime i do that and it is also confusing for me when i forget to switch back, or i install gems to the wrong ruby version etc...

is there some best practice for that? is there some possibility to attach a custom profile for the terminal so that i can open up two seperate terminal instances, a jruby and a ruby one?

i wish everyone a good start to the new decade!

kind regards,
peter

Re: sensible default exclude

Posted by Peter Schröder <ps...@blau.de>.
maybe a .buildr/defaults.yaml ?


Am 05.01.2010 um 20:07 schrieb Alex Boisvert:

> Yes, definitely a good idea.  Rake already does this in some places (e.g.,
> FileList will automatically ignore .cvs directories, .bak files, etc).
> 
> It would be nice to have a global setting where ignored files/directories
> are defined, with a decent set of default values.
> 
> alex
> 
> 
> On Tue, Jan 5, 2010 at 10:15 AM, Peter Schröder <ps...@blau.de> wrote:
> 
>> hi,
>> 
>> i am doing a simple task like
>> 
>> package(:zip, :file=>_(:target, "#{PROJECT_NAME}.zip")).include(_(:context,
>> '*'))
>> 
>> and get a zip containing ALL the stuff from that directory.
>> 
>> i think it would be wise to provide some default filters that ignore files
>> like '.gitignore' etc.
>> 
>> what do you think?
>> 
>> kind regards,
>> peter


Re: sensible default exclude

Posted by Alex Boisvert <al...@gmail.com>.
Yes, definitely a good idea.  Rake already does this in some places (e.g.,
FileList will automatically ignore .cvs directories, .bak files, etc).

It would be nice to have a global setting where ignored files/directories
are defined, with a decent set of default values.

alex


On Tue, Jan 5, 2010 at 10:15 AM, Peter Schröder <ps...@blau.de> wrote:

> hi,
>
> i am doing a simple task like
>
> package(:zip, :file=>_(:target, "#{PROJECT_NAME}.zip")).include(_(:context,
> '*'))
>
> and get a zip containing ALL the stuff from that directory.
>
> i think it would be wise to provide some default filters that ignore files
> like '.gitignore' etc.
>
> what do you think?
>
> kind regards,
> peter

sensible default exclude

Posted by Peter Schröder <ps...@blau.de>.
hi,

i am doing a simple task like 

package(:zip, :file=>_(:target, "#{PROJECT_NAME}.zip")).include(_(:context, '*'))

and get a zip containing ALL the stuff from that directory.

i think it would be wise to provide some default filters that ignore files like '.gitignore' etc.

what do you think?

kind regards,
peter

Re: jruby ruby environment switch

Posted by Peter Schröder <ps...@blau.de>.
sweet!

Am 01.01.2010 um 21:24 schrieb Labnotes:

> 
> 
> On Jan 1, 2010, at 8:13 AM, Peter Schröder <ps...@blau.de> wrote:
> 
>> hi,
>> 
>> i have a non-buildr-related question, but i think that here is a  
>> good place to ask!
>> 
>> i am currently working on os-x with ruby and jruby related tasks. i  
>> am including my jruby executables and gems to the path in  
>> my .profile file.
>> if i want to switch to the default ruby environment i comment out  
>> that line and jruby is gone.
>> i have to reopen the command-lines everytime i do that and it is  
>> also confusing for me when i forget to switch back, or i install  
>> gems to the wrong ruby version etc...
>> 
>> is there some best practice for that? is there some possibility to  
>> attach a custom profile for the terminal so that i can open up two  
>> seperate terminal instances, a jruby and a ruby one?
> 
> Check out RVM, it makes switching between different versions of Ruby  
> easy:
> 
> http://rvm.beginrescueend.com/
> 
> Assaf
> 
> 
> 
>> 
>> i wish everyone a good start to the new decade!
>> 
>> kind regards,
>> peter


Re: jruby ruby environment switch

Posted by Labnotes <as...@labnotes.org>.

On Jan 1, 2010, at 8:13 AM, Peter Schröder <ps...@blau.de> wrote:

> hi,
>
> i have a non-buildr-related question, but i think that here is a  
> good place to ask!
>
> i am currently working on os-x with ruby and jruby related tasks. i  
> am including my jruby executables and gems to the path in  
> my .profile file.
> if i want to switch to the default ruby environment i comment out  
> that line and jruby is gone.
> i have to reopen the command-lines everytime i do that and it is  
> also confusing for me when i forget to switch back, or i install  
> gems to the wrong ruby version etc...
>
> is there some best practice for that? is there some possibility to  
> attach a custom profile for the terminal so that i can open up two  
> seperate terminal instances, a jruby and a ruby one?

Check out RVM, it makes switching between different versions of Ruby  
easy:

http://rvm.beginrescueend.com/

Assaf



>
> i wish everyone a good start to the new decade!
>
> kind regards,
> peter

Re: jruby ruby environment switch

Posted by Alex Boisvert <al...@gmail.com>.
On Fri, Jan 1, 2010 at 8:13 AM, Peter Schröder <ps...@blau.de> wrote:

> hi,
>
> i have a non-buildr-related question, but i think that here is a good place
> to ask!
>
> i am currently working on os-x with ruby and jruby related tasks. i am
> including my jruby executables and gems to the path in my .profile file.
> if i want to switch to the default ruby environment i comment out that line
> and jruby is gone.
> i have to reopen the command-lines everytime i do that and it is also
> confusing for me when i forget to switch back, or i install gems to the
> wrong ruby version etc...
>
> is there some best practice for that? is there some possibility to attach a
> custom profile for the terminal so that i can open up two seperate terminal
> instances, a jruby and a ruby one?
>
> i wish everyone a good start to the new decade!
>
> kind regards,
> peter


My own low-tech way of switching is to define RUBY_HOME is my .bashrc,
adding ~/bin to my PATH, having executable scripts in ~/bin for all common
Ruby commands. This is ~/bin/ruby,

#!/bin/sh
exec $RUBY_HOME/bin/ruby "$@"

(Similar template for irb, ri, rdoc, ...)

And creating shell aliases to switch between different versions,

alias ruby18="export RUBY_HOME=/path/to/ruby-1.8"
alias ruby19="export RUBY_HOME=/path/to/ruby-1.9"
alias ruby?="export | grep RUBY_HOME"

I use the same approach for switching between JDK5/6, Scala 2.7/2.8, etc.

alex