How can I set my shell to irb?

Hi guys !

I’m running opensuse 11.0 . I would like to know 2 things :

  1. is it possible to change my shell from bash to irb ? if so,how ? ( I
    tried chsh , but with no success )
  2. is it possible to add methods to irb , by writing code in .irbrc ? If
    so , could I see an example ?

Thanks

Lex W. wrote:

Hi guys !

I’m running opensuse 11.0 . I would like to know 2 things :

  1. is it possible to change my shell from bash to irb ? if so,how ? ( I
    tried chsh , but with no success )
  2. is it possible to add methods to irb , by writing code in .irbrc ? If
    so , could I see an example ?

Thanks

  1. Try putting ‘exec /usr/bin/irb’ or equivalent into your current
    shell’s rc file. Is typing ‘irb’ really that painful? :slight_smile: Do you really
    countenance using irb as your main shell???
  2. Here’s mine:

load libraries

require ‘rubygems’
require ‘wirble’

start wirble (with color)

Wirble.init
Wirble.colorize
Wirble::Colorize.colors[:symbol_prefix] = :green
Wirble::Colorize.colors[:symbol] = :black

Lex W. wrote:

Hi guys !

I’m running opensuse 11.0 . I would like to know 2 things :

  1. is it possible to change my shell from bash to irb ? if so,how ? ( I
    tried chsh , but with no success )
    You’ll need to add it to /etc/shells, otherwise chsh will not let you
    change to it.

Phil

echo ‘exec irb’ >> ~/.bashrc

[email protected] ~ $ grep -A 3 def .irbrc
def test
puts “Oh Hai!”
end
[email protected] ~ $ irb

test
Oh Hai!

On Thu, Sep 11, 2008 at 05:16:44AM +0900, Lex W. wrote:


Posted via http://www.ruby-forum.com/.


nathan
nathan_at_nathanpowell_dot_org

The power of accurate observation is commonly called cynicism by those
who have not got it.
~ George Bernard Shaw

This is interesting…

rush, a replacement for the unix shell (bash, zsh, etc) which uses
pure Ruby syntax.

http://rubyconf.org/talks/31

vim .bashrc

add
irb

:wink:

On Thu, 11 Sep 2008 05:16:44 +0900

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs