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

···

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

1)
echo 'exec irb' >> ~/.bashrc

2)
npowell@delilah ~ $ grep -A 3 def .irbrc
def test
  puts "Oh Hai!"
end
npowell@delilah ~ $ irb

test

Oh Hai!

···

On Thu, Sep 11, 2008 at 05:16:44AM +0900, Lex Williams 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
--
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
------------------------------------

Lex Williams 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

···

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

Lex Williams 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

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 Lex Williams <etaern@yahoo.com> 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