From: Tom Cloyd Date: 2009-02-15T10:22:06+09:00 Subject: Re: simple ruby project layout question Joel VanderWerf wrote: > David Masover wrote: > ... >> 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. > > Not just the ruby world. > > count = 0 > Dir['/usr/bin/*'].each do |fn| > next if File.directory? fn > File.open(fn) do |f| > count += 1 if /^#!/ =~ f.read(100) > end > end > p count # ==> 574 > > Of course some of those are shell scripts that just execute a true > "binary executable". > Yikes. You sure know how to make a point! Thanks for the demo. T. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist Bellingham, Washington, U.S.A: (360) 920-1226 << tc@tomcloyd.com >> (email) << TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~