How can I run a ruby piece of code from a buffer, without actually saving the buffer in a file? A scenario would be to a) switch to the scratch buffer b) M-x ruby-mode c) type
1. Rinari from Github
It claims to be
aimed towards making Emacs into a top-notch Ruby and Rails development environment
2. ruby-compilation.el is what you need.
There's a thread on that here which I have used and found helpful.
Chris
You can do this with inf-ruby.el.
With inf-ruby installed, M-x inf-ruby starts a new ruby interpreter in the background, to which you can send code using the ruby-send-* commands, such as ruby-send-region (bound by default to C-c C-r). To send the whole buffer, select all with C-x h then hit C-c C-r.
Update, 2011-09-02: The latest version of inf-ruby.el (2.1.1, available in ELPA) is that maintained by 'nonsequitur' on github, and snapshot packages are available in Melpa.