PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > irb and unix shells
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
irb and unix shells

Réponse
 
LinkBack Outils de la discussion
Vieux 02/12/2007, 00h26   #1
Robert Jones
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut irb and unix shells

Can you use irb in place of shells like bash or rc?
  Réponse avec citation
Vieux 02/12/2007, 00h45   #2
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

> Can you use irb in place of shells like bash or rc?

not really, but kinda, yeah.

you can do "system ('any unix command')" from inside irb really
easily, and you could also set up a method which automatically took
any input you gave irb and passed that along to system, but you
wouldn't get tab-completion, you'd have to manually print the strings
you received back - they come back with newline escape sequences
rather than newlines - and I really don't know how you would be able
to get system (or backticks, which do almost exactly the same thing)
to load your .profile or .foo_shrc files.

you can do pretty much anything you want in Unix from within irb, but
actual Unix shells remain the best way to do it. (although I think
there was an actual irb shell written, so I could be wrong.)

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 02/12/2007, 02h35   #3
John Joyce
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells


On Dec 1, 2007, at 6:45 PM, Giles Bowkett wrote:

>> Can you use irb in place of shells like bash or rc?

>
> not really, but kinda, yeah.
>
> you can do "system ('any unix command')" from inside irb really
> easily, and you could also set up a method which automatically took
> any input you gave irb and passed that along to system, but you
> wouldn't get tab-completion, you'd have to manually print the strings
> you received back - they come back with newline escape sequences
> rather than newlines - and I really don't know how you would be able
> to get system (or backticks, which do almost exactly the same thing)
> to load your .profile or .foo_shrc files.
>
> you can do pretty much anything you want in Unix from within irb, but
> actual Unix shells remain the best way to do it. (although I think
> there was an actual irb shell written, so I could be wrong.)
>
> --
> Giles Bowkett
>
> Podcast: http://hollywoodgrit.blogspot.com
> Blog: http://gilesbowkett.blogspot.com
> Portfolio: http://www.gilesgoatboy.org
> Tumblelog: http://giles.tumblr.com
>

Some day, some day, somebody smarter and more ambitious than me will
build that Ruby-native shell with all the joy of Ruby and command
line tools integrated...

  Réponse avec citation
Vieux 02/12/2007, 03h50   #4
Robert Jones
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

John Joyce wrote:

>
> On Dec 1, 2007, at 6:45 PM, Giles Bowkett wrote:
>
>>> Can you use irb in place of shells like bash or rc?

>>
>> not really, but kinda, yeah.
>>
>> you can do "system ('any unix command')" from inside irb really
>> easily, and you could also set up a method which automatically took
>> any input you gave irb and passed that along to system, but you
>> wouldn't get tab-completion, you'd have to manually print the strings
>> you received back - they come back with newline escape sequences
>> rather than newlines - and I really don't know how you would be able
>> to get system (or backticks, which do almost exactly the same thing)
>> to load your .profile or .foo_shrc files.
>>
>> you can do pretty much anything you want in Unix from within irb, but
>> actual Unix shells remain the best way to do it. (although I think
>> there was an actual irb shell written, so I could be wrong.)
>>
>> --
>> Giles Bowkett
>>
>> Podcast: http://hollywoodgrit.blogspot.com
>> Blog: http://gilesbowkett.blogspot.com
>> Portfolio: http://www.gilesgoatboy.org
>> Tumblelog: http://giles.tumblr.com
>>

> Some day, some day, somebody smarter and more ambitious than me will
> build that Ruby-native shell with all the joy of Ruby and command
> line tools integrated...


Thanks to both of you and I can only hope that somebody comes along soon. I
wish I had the experience and skill to do it my self, but multiple failure
with other big and ambitious projects I took on taught me some humility.
  Réponse avec citation
Vieux 02/12/2007, 15h44   #5
Cameron McBride
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

This is one of those questions where consulting with rubyforge.org can
be ful.

http://rubyforge.org/projects/rbsh/

I can't speak for it, I haven't really used it.

Cameron

  Réponse avec citation
Vieux 02/12/2007, 18h05   #6
Marc Heiler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

> Some day, some day, somebody smarter and more ambitious than me will
> build that Ruby-native shell with all the joy of Ruby and command
> line tools integrated...


hehe working on that with my limited abilities...

Unfortunately, aside from time problems, I found two stop things:

First, I need something that can replace irb easily, so that you
get all the important functionality of irb and which has
sufficient docu to allow "normal" programmers unterstand
what is going on (understanding how IRB works is possible,
but i found it takes a lot of time, and isnt as fun as
starting from scratch)
Something that is as flexible as irb-in-a-browser too,
but for some reason I didnt find this very easy...

Second, I still have no real way on how to do piping of
objects/data with a ruby shell. (After all we are talking of a
real shell, no? One like in bash where you can apply filters...)

And also... ruby-ncurses would be nice to have, so that we
can get zsh-like "borders" around a prompt (and RPROMPT etc..
etc.. etc..)

But for now its a lot easier to replace all t he simple unix
tools in pure ruby... thats not that difficult, just
quite some work


"but you wouldn't get tab-completion"
Well you can, with Readline.readline and using a proc
object for tab completion. The docu is a little bit weird,
but with a little i got that to work.
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 02/12/2007, 19h29   #7
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

> "but you wouldn't get tab-completion"
> Well you can, with Readline.readline and using a proc
> object for tab completion. The docu is a little bit weird,
> but with a little i got that to work.


Is there a way to integrate that with irb? A Unix shell with .irbrc
special sauce would be pretty nifty. Although I have to admit I
haven't got the hang of it yet:

! ruby ruby_shell.rb
RubyShell> ls (tab)
svn/ ruby_shell/ ruby_shell.rb
RubyShell> ls ../README
RubyShell> ls -l !$
RubyShell> ls -l ../README
ls: fts_open: No such file or directory

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 03/12/2007, 02h20   #8
MonkeeSage
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

On Dec 2, 1:29 pm, Giles Bowkett <gil...@gmail.com> wrote:
> > "but you wouldn't get tab-completion"
> > Well you can, with Readline.readline and using a proc
> > object for tab completion. The docu is a little bit weird,
> > but with a little i got that to work.

>
> Is there a way to integrate that with irb?


Tab completion? Already in there. In .irbrc...

require 'irb/completion'

> A Unix shell with .irbrc
> special sauce would be pretty nifty. Although I have to admit I
> haven't got the hang of it yet:
>
> ! ruby ruby_shell.rb
> RubyShell> ls (tab)
> svn/ ruby_shell/ ruby_shell.rb
> RubyShell> ls ../README
> RubyShell> ls -l !$
> RubyShell> ls -l ../README
> ls: fts_open: No such file or directory
>
> --
> Giles Bowkett
>
> Podcast:http://hollywoodgrit.blogspot.com
> Blog:http://gilesbowkett.blogspot.com
> Portfolio:http://www.gilesgoatboy.org
> Tumblelog:http://giles.tumblr.com


Regards,
Jordan
  Réponse avec citation
Vieux 03/12/2007, 03h21   #9
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

> Tab completion? Already in there. In .irbrc...
>
> require 'irb/completion'


I know - got it already. Talking abut Unix tab completion. (That
happens in ruby_shell, but I don't know how.)

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 03/12/2007, 03h33   #10
Gowrisankar Narayanan-IC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Problem with Rails Installation

Hi,

I have downloaded Rails-1.2.6.zip manually as my proxy settings are
restricting Ruby to do it automatically.

Now that Rails-1.2.6.zip is with me.. To which directory should I
extract these files to.=20

Thanks in advance
Gowrisankar. narayan


DISCLAIMER:
This message contains privileged and confidential information and is =
intended only for an individual named. If you are not the intended =
recipient, you should not disseminate, distribute, store, print, copy or =
deliver this message. Please notify the sender immediately by e-mail if =
you have received this e-mail by mistake and delete this e-mail from =
your system. E-mail transmission cannot be guaranteed to be secure or =
error-free as information could be intercepted, corrupted, lost, =
destroyed, arrive late or incomplete or contain viruses. The sender, =
therefore, does not accept liability for any errors or omissions in the =
contents of this message which arise as a result of e-mail transmission. =
If verification is required, please request a hard-copy version.

  Réponse avec citation
Vieux 03/12/2007, 06h57   #11
MonkeeSage
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

On Dec 2, 9:21 pm, Giles Bowkett <gil...@gmail.com> wrote:
> > Tab completion? Already in there. In .irbrc...

>
> > require 'irb/completion'

>
> I know - got it already. Talking abut Unix tab completion. (That
> happens in ruby_shell, but I don't know how.)
>
> --
> Giles Bowkett
>
> Podcast:http://hollywoodgrit.blogspot.com
> Blog:http://gilesbowkett.blogspot.com
> Portfolio:http://www.gilesgoatboy.org
> Tumblelog:http://giles.tumblr.com


I figured you would already know that, which is why I was confused.
Sorry about that. I've no idea about bash completion either.

Regards,
Jordan
  Réponse avec citation
Vieux 03/12/2007, 16h50   #12
Daniel Brumbaugh Keeney
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

On Dec 1, 2007 9:55 PM, Robert Jones <robertjones21@hotpop.com> wrote:
> > Some day, some day, somebody smarter and more ambitious than me will
> > build that Ruby-native shell with all the joy of Ruby and command
> > line tools integrated...


A group of developers, including the author of rbsh, recently got
together for just such a project.
http://rubyunix.rubyforge.org/

We're still working out the design and putting together everyone's
ideas, but an interactive shell, ability to run UNIX shell scripts,
and other such things are among our goals.

Daniel Brumbaugh Keeney

  Réponse avec citation
Vieux 03/12/2007, 19h44   #13
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

That's extremely nifty. I also like the name: rush. I recommend using
the 2112 cover art for maxiumum effect.

On 12/3/07, Daniel Brumbaugh Keeney <devi.webmaster@gmail.com> wrote:
> On Dec 1, 2007 9:55 PM, Robert Jones <robertjones21@hotpop.com> wrote:
> > > Some day, some day, somebody smarter and more ambitious than me will
> > > build that Ruby-native shell with all the joy of Ruby and command
> > > line tools integrated...

>
> A group of developers, including the author of rbsh, recently got
> together for just such a project.
> http://rubyunix.rubyforge.org/
>
> We're still working out the design and putting together everyone's
> ideas, but an interactive shell, ability to run UNIX shell scripts,
> and other such things are among our goals.
>
> Daniel Brumbaugh Keeney
>
>



--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 03/12/2007, 19h45   #14
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

> > I know - got it already. Talking abut Unix tab completion. (That
> > happens in ruby_shell, but I don't know how.)

>
> I figured you would already know that, which is why I was confused.
> Sorry about that. I've no idea about bash completion either.


No worries. :-)

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 03/12/2007, 19h57   #15
Thomas Adam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

Hello --

On 03/12/2007, Giles Bowkett <gilesb@gmail.com> wrote:
> That's extremely nifty. I also like the name: rush. I recommend using
> the 2112 cover art for maxiumum effect.


Some of us are working on the rubyunix project:

http://rubyunix.rubyforge.org/

-- Thomas Adam

  Réponse avec citation
Vieux 03/12/2007, 21h35   #16
Christopher Anderson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

excellent! can't wait for it.

On Dec 3, 2007 8:50 AM, Daniel Brumbaugh Keeney
<devi.webmaster@gmail.com> wrote:
> On Dec 1, 2007 9:55 PM, Robert Jones <robertjones21@hotpop.com> wrote:
> > > Some day, some day, somebody smarter and more ambitious than me will
> > > build that Ruby-native shell with all the joy of Ruby and command
> > > line tools integrated...

>
> A group of developers, including the author of rbsh, recently got
> together for just such a project.
> http://rubyunix.rubyforge.org/
>
> We're still working out the design and putting together everyone's
> ideas, but an interactive shell, ability to run UNIX shell scripts,
> and other such things are among our goals.
>
> Daniel Brumbaugh Keeney
>
>


  Réponse avec citation
Vieux 03/12/2007, 23h15   #17
Edwin Van leeuwen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

Thomas Adam wrote:
> Hello --
>
> On 03/12/2007, Giles Bowkett <gilesb@gmail.com> wrote:
>> That's extremely nifty. I also like the name: rush. I recommend using
>> the 2112 cover art for maxiumum effect.

>
> Some of us are working on the rubyunix project:
>
> http://rubyunix.rubyforge.org/
>
> -- Thomas Adam


Have you guys also looked at the hotwire project (a new python-shell)
http://code.google.com/p/hotwire-shell/
It has some interesting ideas.

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

  Réponse avec citation
Vieux 04/12/2007, 00h33   #18
John Joyce
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

I still think if it borrows lots from bash, it should be called rash,
not rush.

  Réponse avec citation
Vieux 04/12/2007, 01h00   #19
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

> I still think if it borrows lots from bash, it should be called rash,
> not rush.


no way, dude. that's like slime, the lisp environment. I don't care
how awesome it is, I'm not working in slime.

I definitely and vigorously vote against rash and in favor of rush.

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 04/12/2007, 01h11   #20
thefed
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells


On Dec 3, 2007, at 8:00 PM, Giles Bowkett wrote:

> I definitely and vigorously vote against rash and in favor of rush.


In honor of how Rails and Rolls are both named after drugs, I think
the shell should be named after some hard drug.

Like maybe 'Rocks', which is slang for crack cocaine.

-Ari

  Réponse avec citation
Vieux 04/12/2007, 01h51   #21
Martin DeMello
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

On Dec 3, 2007 3:15 PM, Edwin Van leeuwen <edder@tkwsping.nl> wrote:

> Have you guys also looked at the hotwire project (a new python-shell)
> http://code.google.com/p/hotwire-shell/
> It has some interesting ideas.


http://www.scsh.net/ likewise, though the focus there is more on
scripting than interactivity.

martin

  Réponse avec citation
Vieux 04/12/2007, 01h52   #22
Christopher Anderson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

rash: terrible
rush: terrible

mogok! it sounds cool, it's related to rubies, erm, and apparently has
a violent and oppressive history...

hey it would also be humanitarian in how it brings to light an issue
that people might not have thought about?

90% of the world's rubies come from Myanmar. The red stones from there
are prized for their purity and hue. Thailand buys the majority of
Myanmar's gems. The "Valley of Rubies", the mountainous Mogok area,
200 km (125 miles) north of Mandalay, is noted for its rare pigeon's
blood rubies and blue sapphires. Working conditions in the mines,
however, are said to be horrendous. Debbie Stothard of the Alternative
ASEAN Network on Burma stated that mining operators used drugs on
employees to improve productivity, with needles shared, raising the
risk of HIV infection: "These rubies are red with the blood of young
people." Brian Leber (jeweler who founded The Jewellers' Burma Relief
Project) stated that "for the time being," Burmese gems should not be
something to be proud of. (from wikipedia)

http://www.ruby-sapphire.com/pigeons-blood-mogok.htm is friendlier.

/usr/bin/mogok! /usr/bin/mogok!

On Dec 3, 2007 5:11 PM, thefed <fedzor@gmail.com> wrote:
>
> On Dec 3, 2007, at 8:00 PM, Giles Bowkett wrote:
>
> > I definitely and vigorously vote against rash and in favor of rush.

>
> In honor of how Rails and Rolls are both named after drugs, I think
> the shell should be named after some hard drug.
>
> Like maybe 'Rocks', which is slang for crack cocaine.
>
> -Ari
>
>


  Réponse avec citation
Vieux 04/12/2007, 06h46   #23
Giles Bowkett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

Mogok is totally depressing. You must face down evil, but never focus
on it. First rule of whoever that spiritual guy was with the rules
that one time. That's even worse than rash.

Rush sounds exciting and fun, and has decades of drum solos to back up
its reputation. Wow! What a rush!

Besides, I only advocate rush because the project is already named
rush, and was named rush by the people who are programming it. I think
actually the voting process, if there even is one, will heavily bias
the votes of people who contribute code to the project.

On 12/3/07, Christopher Anderson <significants@gmail.com> wrote:
> rash: terrible
> rush: terrible
>
> mogok! it sounds cool, it's related to rubies, erm, and apparently has
> a violent and oppressive history...
>
> hey it would also be humanitarian in how it brings to light an issue
> that people might not have thought about?
>
> 90% of the world's rubies come from Myanmar. The red stones from there
> are prized for their purity and hue. Thailand buys the majority of
> Myanmar's gems. The "Valley of Rubies", the mountainous Mogok area,
> 200 km (125 miles) north of Mandalay, is noted for its rare pigeon's
> blood rubies and blue sapphires. Working conditions in the mines,
> however, are said to be horrendous. Debbie Stothard of the Alternative
> ASEAN Network on Burma stated that mining operators used drugs on
> employees to improve productivity, with needles shared, raising the
> risk of HIV infection: "These rubies are red with the blood of young
> people." Brian Leber (jeweler who founded The Jewellers' Burma Relief
> Project) stated that "for the time being," Burmese gems should not be
> something to be proud of. (from wikipedia)
>
> http://www.ruby-sapphire.com/pigeons-blood-mogok.htm is friendlier.
>
> /usr/bin/mogok! /usr/bin/mogok!
>
> On Dec 3, 2007 5:11 PM, thefed <fedzor@gmail.com> wrote:
> >
> > On Dec 3, 2007, at 8:00 PM, Giles Bowkett wrote:
> >
> > > I definitely and vigorously vote against rash and in favor of rush.

> >
> > In honor of how Rails and Rolls are both named after drugs, I think
> > the shell should be named after some hard drug.
> >
> > Like maybe 'Rocks', which is slang for crack cocaine.
> >
> > -Ari
> >
> >

>
>



--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

  Réponse avec citation
Vieux 04/12/2007, 08h48   #24
botp
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

On 12/4/07, Giles Bowkett <gilesb@gmail.com> wrote:
> Rush sounds exciting and fun, and has decades of drum solos to back up
> its reputation. Wow! What a rush!


i'd be more excited if the shell can run on windows, too. Unix shells
are already very powerful. One can throw just about any language to
it. A windows shell is wanting, and would be a killer app for windows.
The command shell in windows is terrible; heck, i cannot even do a
ctrl-pgup - grr!@#$

kind regards -botp

  Réponse avec citation
Vieux 04/12/2007, 12h38   #25
thefed
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: irb and unix shells

On Dec 4, 2007, at 1:46 AM, Giles Bowkett wrote:

> Mogok is totally depressing. You must face down evil, but never focus
> on it. First rule of whoever that spiritual guy was with the rules
> that one time. That's even worse than rash.
>
> Rush sounds exciting and fun, and has decades of drum solos to back up
> its reputation. Wow! What a rush!
>
> Besides, I only advocate rush because the project is already named
> rush, and was named rush by the people who are programming it. I think
> actually the voting process, if there even is one, will heavily bias
> the votes of people who contribute code to the project.


You are all forgetting about three things:
First, the code. We need code to go along with this!
Second, the rubyunix mailing list. This thread belongs THERE!
Third, Mr Bowket please update your blog with something Rubyish.


Thanks,
Ari

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h27.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,32124 seconds with 33 queries