[Rake-devel] Question about system call and multiple arguments.

Assaf Arkin assaf at labnotes.org
Mon Nov 3 00:29:22 EST 2008


On Sun, Nov 2, 2008 at 4:59 PM, Luis Lavena <luislavena at gmail.com> wrote:

> On Sun, Nov 2, 2008 at 8:52 PM, Assaf Arkin <assaf at labnotes.org> wrote:
> > On Sun, Nov 2, 2008 at 4:27 PM, Luis Lavena <luislavena at gmail.com>
> wrote:
> >>
> >>  RUBY = File.join(Config::CONFIG['bindir'],
> >> Config::CONFIG['ruby_install_name'])
> >>  RUBY << Config::CONFIG['EXEEXT'] unless RUBY_PLATFORM =~ /java/
> >>  RUBY.sub!(/.*\s.*/m, '"\&"')
> >
> > For multi-argument, the first argument is a file name, so you don't have
> to
> > worry about spaces, and adding quotes will fail finding that file.
> > Assaf
> >
>
> The problem is that the same RUBY definition is used for both single
> argument or multiple arguments system calls. without quotes single
> arguments calls with ruby located in directories with spaces.


You set RUBY to point to the file, then you use it depending on context.

system RUBY, script_name

system "#{RUBY.inspect} #{script_name.inspect}"
system [RUBY, script_name].map { |a| a.inspect }

Assaf


>
>
> The following are the results:
>
> http://pastie.org/306112
>
> Previously test_ruby second part was skipped under java, now is
> generating this issue.
>
> I'm still not convinced, since jruby do other tricks behind the scenes
> that I'm not completely getting (is performing env shell expansion all
> the time.
>
> --
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
> _______________________________________________
> Rake-devel mailing list
> Rake-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20081102/857cd25e/attachment.html>


More information about the Rake-devel mailing list