From: Eero Saynatkari Date: 2006-10-17T11:46:59+09:00 Subject: Re: Shell commands in irb --y/XsGip80ttrIE8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2006.10.16 23:10, Andre Nathan wrote: > Hi >=20 > I was quite bored this morning and the coffee machine went into its 30 > minute clean cycle, so I came up with this... >=20 > $ cat .irbrc=20 > Dir["{,/usr,/usr/local}/bin/*"].each do |bin| > Object.instance_eval do > define_method(File.basename(bin)) do |*args| > args.map! { |arg| arg.to_s } > system bin, *args > end > end > end >=20 > $ irb --simple-prompt > irb: warn: can't alias kill from irb_kill. > >> touch :foo > =3D> true > >> mv :foo, :bar > =3D> true > >> ls "-l", :bar > -rw-r--r-- 1 andre andre 0 Oct 16 11:56 bar > =3D> true > >> >=20 >=20 > Probably useless, I know... but running "vim :foo.rb" or "top" from > inside irb is cool :P You might find rs (the Ruby shell project) of interest! One of the core tenets is to provide full access to Ruby at the command-line. http://projects.kittensoft.org/rs/rdoc/indox.html --y/XsGip80ttrIE8G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFNEOQ7Nh7RM4TrhIRAthcAKDUKx38VEgN0hTAJ5MSytnvNXoi3ACdGEvO u+sv/OLO41zmdl54s+Z3Yzk= =bNbb -----END PGP SIGNATURE----- --y/XsGip80ttrIE8G--