Re: simple ruby project layout question



Tom Cloyd wrote:
So, in the Ruby world, \bin simply means "whatever I'm using to launch
my program", if it's used at all, right? And "\bin" is simply an
anachronism - has always been done that way?

Right -- and it's not unique to Ruby either.

From your use of backslashes, I'm guessing you're on Windows, so I can
see your confusion. On Unix, quite often you find shell scripts in
various bin directories. A few examples from my system: /bin/which,
/usr/bin/git-svn, etc.

I think the reason it's done this way is that once upon a time, most or
all of the files in those system directories were binary executables.
People probably started putting scripts there because it was already in
the PATH anyway, and it makes sense -- in the above example, all the
user really cares about is git-svn is another git command, so to be
consistent, why not put all of Git together? Even if most commands are
binary, but some are Perl scripts?

So, in the Ruby world, bin is just "executables", binary or otherwise,
as distinct from lib, where you would find library code. Both are ruby
files, but bin/foo you might actually expect to set executable and run
as a command, whereas if you did the same to lib/foo.rb, it probably
wouldn't do anything.

.



Relevant Pages

  • Re: Any TextMate Editor equivelent for Windows ?
    ... custom Ruby shell scripts and Unix command ports for finding and manipulating stuff from the command line. ... Plus the things that come with the ruby-vim menus and macro plugin (auto completion of certain Ruby control-flow expression, quote, bracket, and paren closing; ... I have some command-line scripts to do very simple things. ... I often switch from Windows to Linux, and don't always have the option of running a GUI shell, so sticking to vi makes life simpler (and the ...
    (comp.lang.ruby)
  • Re: Windows new user cheat sheet?
    ... commandline in connection with ruby. ... associates scripts with ruby so all I need is to write the script in ... Then right click a folder in Explorer (or even the little folder icon ... It has the same flaw as the MS Command Prompt Here, ...
    (comp.lang.ruby)
  • Re: automated .asp / .html site
    ... The property you need to set is "AccessFlags" ... 517 = Scripts & Executables ... >> This has to be configured for virtual sites via the command line. ...
    (microsoft.public.inetserver.iis)
  • Re: Error Exception if script doesnt run
    ... I finally figured out the last problem which was why some of my Ruby ... Once I added some gsub code to remove those characters, ... command or ruby code were the cause of the error. ... work that come to me with "you know your scripts have failed, ...
    (comp.lang.ruby)
  • Re: vi horizontal split screen
    ... efficient at processing scripts, and one way to do that was substitute ... Microsoft's work for OLE in Windows 1x through 3x. ... As more and more users come to Linux who have no desire for command line ... effectively a programming environment. ...
    (comp.editors)