A
Andre Nathan
Hi
I was quite bored this morning and the coffee machine went into its 30
minute clean cycle, so I came up with this...
$ cat .irbrc
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
$ irb --simple-prompt
irb: warn: can't alias kill from irb_kill.-rw-r--r-- 1 andre andre 0 Oct 16 11:56 bar
=> true
Probably useless, I know... but running "vim :foo.rb" or "top" from
inside irb is cool
Andre
I was quite bored this morning and the coffee machine went into its 30
minute clean cycle, so I came up with this...
$ cat .irbrc
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
$ irb --simple-prompt
irb: warn: can't alias kill from irb_kill.-rw-r--r-- 1 andre andre 0 Oct 16 11:56 bar
=> true
Probably useless, I know... but running "vim :foo.rb" or "top" from
inside irb is cool
Andre