[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how can I set my shell to irb?

Lex Williams

9/10/2008 8:17:00 PM

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-....

5 Answers

Nathan Powell

9/10/2008 8:25:00 PM

0


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-....
>

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

Anton Ivanov

9/10/2008 8:27:00 PM

0

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? :) 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-....

Phil Cowans

9/10/2008 8:28:00 PM

0

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


Mark Thomas

9/11/2008 1:26:00 PM

0

This is interesting...

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

http://rubyconf.or...


psy

9/11/2008 2:37:00 PM

0

vim .bashrc

add
irb

;)

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