From: "Leo M." Date: 2011-12-21T06:30:04+09:00 Subject: Re: "System" command Jeremy Bopp wrote in post #1037553: > On 12/20/2011 10:12 AM, Leo M. wrote: >> Like the shell? > > If you're asking about my efficiency comment, check out the glob and > similar methods in the Dir class: > > http://rubydoc.info/stdlib/core/1.9.2/Dir.glob > > It's possible to skip Ruby entirely and use just the shell for many > things, and you may find that to be more efficient by some measures > depending on your needs. My comment, however, was more about avoiding > calling out to external programs when Ruby itself offers similar > functionality built-in. In this case, calling ls is needlessly > wasteful. > > Whether or not you should call out to external programs for processing > of data will vary on a number of factors; including performance, > availability, cross platform compatibility, and ease of output > consumption to name a few. Be mindful of that when you start coding > calls to such programs. :-) > > -Jeremy Thanks, yes of course. LS was just a trial to understand the mechanism behind the courtain :) Besides of this, try out the system option or `` to launch rails commands while in rails console! I found it very useful! -- Posted via http://www.ruby-forum.com/.