From: "R.. Kumar 1.9.1 OSX" Date: 2010-08-18T23:18:46+09:00 Subject: Re: Unix Philosophy in Ruby Programing Diego Bernardes wrote: > I use Linux about 5 years, but, this year that i started to "use" linux. > Now i understand a little more about the unix philosophy and some other > trick things windows dont do/have. > This changed the way i program. Ruby was build to help manage linux > systems, rigth? > > So, this is the question, what you guys think about the way ruby > programs are made? > Why build a gem/program to send mail if you can send with sendmail? > Why build process monitor if you can use monit? > And so.. > > A nice post about this is: http://tomayko.com/writings/unicorn-is-unix I think you are making a wrong comparison: comparing ruby gems to unix commands. After all, unix commands themselves use libraries internally. So gems are the libraries that ruby programs use internally. Externally, unix commands can be piped and glued together. Ruby programs to be run on the command line can also be written with the same philosophy. e.g.: - return 0 for success or 1 for error. - allow user to get output which can be filtered or grepped or awked etc. - do one job and do it well - use standard input and output appropriately - use traps and cleanup if aborted - use optionparser so user can enter --long-options or short options (-f) - accept input as a parameter or as standard input where appropriate - allow for colored output, but give plain output if output is being piped - have verbose and quiet options - have user interaction or no-interaction modes - use similar flags to most existing unix programs (-v, -f, -i, -o, -r) I am sure there are a lot more .. these are just from the top of my head. -- Posted via http://www.ruby-forum.com/.