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 > Netbeans with Ruby!
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Netbeans with Ruby!

Réponse
 
LinkBack Outils de la discussion
Vieux 24/02/2008, 11h40   #1
Steve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Netbeans with Ruby!

Hi all
Hope I`m ok posting a Netbeans query here?. I`m trying to learn Ruby
using the Netbeans IDE. It seems a pretty slick application but I`m
wondering if its possible to run a prog without creating a `new
project` each time?. I just want to be able to type in a few lines of
code and run it but it keeps running the `main project` which might be
an earlier prog I have written??. I`m sure the solution is staring me
in the face but would be grateful for any tips folk could provide.
Cheers
Steve
  Réponse avec citation
Vieux 24/02/2008, 11h53   #2
Mikel Lindsaar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

On Sun, Feb 24, 2008 at 10:44 PM, Steve <stevecuth@btinternet.com> wrote:
> Hi all
> Hope I`m ok posting a Netbeans query here?. I`m trying to learn Ruby
> using the Netbeans IDE. It seems a pretty slick application but I`m
> wondering if its possible to run a prog without creating a `new
> project` each time?. I just want to be able to type in a few lines of
> code and run it but it keeps running the `main project` which might be
> an earlier prog I have written??. I`m sure the solution is staring me
> in the face but would be grateful for any tips folk could provide.


Wrong tool for the job...

Use IRB.

Open a command line and type "irb" and then type your lines.

Or save a file with the lines in it and from a command line type "ruby file.rb"

Mikel
http://lindsaar.net/

  Réponse avec citation
Vieux 24/02/2008, 12h18   #3
Jari Williamsson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

Steve wrote:

> Hope I`m ok posting a Netbeans query here?. I`m trying to learn Ruby
> using the Netbeans IDE. It seems a pretty slick application but I`m
> wondering if its possible to run a prog without creating a `new
> project` each time?. I just want to be able to type in a few lines of
> code and run it but it keeps running the `main project` which might be
> an earlier prog I have written??. I`m sure the solution is staring me
> in the face but would be grateful for any tips folk could provide.


2 alternatives:
1. Use IRB. If you're already in NetBeans, you can get to the built-in
IRB by chosing "Window/Other/Ruby Shell (IRB)". Or you can use the MRI
or JRuby versions of IRB.
2. Use a "scratch project" where you put your test code. (I have a
source file where I constantly add snippets to the top with "exit" at
the end of the code chunk. That way I can save old code chunks and reuse
in a real project at a later date.)


Best regards,

Jari Williamsson

  Réponse avec citation
Vieux 24/02/2008, 14h41   #4
Phlip
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

Steve wrote:

> Hope I`m ok posting a Netbeans query here?. I`m trying to learn Ruby
> using the Netbeans IDE.


No. You might get answers like this one.

> It seems a pretty slick application but I`m
> wondering if its possible to run a prog without creating a `new
> project` each time?. I just want to be able to type in a few lines of
> code and run it but it keeps running the `main project` which might be
> an earlier prog I have written??. I`m sure the solution is staring me
> in the face but would be grateful for any tips folk could provide.


Netbeans obeys Eclipse's thought-leadership. Eclipse is a Java-style
application. After launching in geological time, it makes you fill out forms
in triplicate (bury them in peat, send them to relevant offices, etc) just
to get anything done. No language shows a bigger contrast with this nonsense
than Ruby.

To run the current script, get SciTE, write a little Ruby, and hit <F5>.

--
Phlip
http://assert2.rubyforge.org/


  Réponse avec citation
Vieux 24/02/2008, 15h07   #5
Ashley Wharton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

[Note: parts of this message were removed to make it a legal post.]

Hi - to run the "current" screen - i.e. what you have just typed use CTRL +
F6

On Sun, Feb 24, 2008 at 6:44 AM, Steve <stevecuth@btinternet.com> wrote:

> Hi all
> Hope I`m ok posting a Netbeans query here?. I`m trying to learn Ruby
> using the Netbeans IDE. It seems a pretty slick application but I`m
> wondering if its possible to run a prog without creating a `new
> project` each time?. I just want to be able to type in a few lines of
> code and run it but it keeps running the `main project` which might be
> an earlier prog I have written??. I`m sure the solution is staring me
> in the face but would be grateful for any tips folk could provide.
> Cheers
> Steve
>
>


  Réponse avec citation
Vieux 24/02/2008, 15h57   #6
Steve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!



> To run the current script, get SciTE, write a little Ruby, and hit <F5>.
>


Hi Phlip
Tried SciTe , wrote a little Ruby, had a little dance, made a little
love, pretty well got down tonight sorry... hit <F5>
and .......nothing.
Presumably it needs saving each time before running?
As a newbie I did want to avoid having to save files each time hence
the use of Netbeans. I`m just not used to the various IDE`s and the
running of Ruby yet but thanks for the suggestion.
Cheers
Steve
ps forgive the bad attempt at humour if you`ve not heard the song it
means nothing ;-)

  Réponse avec citation
Vieux 24/02/2008, 16h06   #7
Phlip
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

>> To run the current script, get SciTE, write a little Ruby, and hit <F5>.

> Tried SciTe , wrote a little Ruby, had a little dance, made a little
> love, pretty well got down tonight sorry... hit <F5>
> and .......nothing.


I just hit <F5> in either the SciTE bundled with One Click Installer, or the
one bundled with Ubuntu.

It's on Tools -> Go. Maybe your SciTE has an inferior keymap.



  Réponse avec citation
Vieux 24/02/2008, 16h08   #8
Ashley Wharton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

[Note: parts of this message were removed to make it a legal post.]

Hi Steve you can avoid saving each time in netbeans. if you want to run the
lines you have just input hold down the ctrl key and hit F6 ... this will
run your current "window". Make sure that the "output window" is open within
the ide ... you can make changes and run as many times as you wish without
saving. I am also new to Ruby and love netbeans ... it makes it very easy to
play with.

On Sun, Feb 24, 2008 at 10:59 AM, Steve <stevecuth@btinternet.com> wrote:

>
>
> > To run the current script, get SciTE, write a little Ruby, and hit <F5>.
> >

>
> Hi Phlip
> Tried SciTe , wrote a little Ruby, had a little dance, made a little
> love, pretty well got down tonight sorry... hit <F5>
> and .......nothing.
> Presumably it needs saving each time before running?
> As a newbie I did want to avoid having to save files each time hence
> the use of Netbeans. I`m just not used to the various IDE`s and the
> running of Ruby yet but thanks for the suggestion.
> Cheers
> Steve
> ps forgive the bad attempt at humour if you`ve not heard the song it
> means nothing ;-)
>
>
>


  Réponse avec citation
Vieux 24/02/2008, 17h40   #9
Phlip
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

> Hi - to run the "current" screen - i.e. what you have just typed use CTRL
> +
> F6


Does the current document have to be part of the current project?



  Réponse avec citation
Vieux 24/02/2008, 19h09   #10
Steve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

On Feb 24, 5:40 pm, "Phlip" <phlip2...@gmail.com> wrote:
> > Hi - to run the "current" screen - i.e. what you have just typed use CTRL
> > +
> > F6

>
> Does the current document have to be part of the current project?


In SciTe I type a few lines of code like so
puts 'Hi what`s your name ?'
name = gets
puts 'Hi ' + name
and then try ctrl + <F5> nothing happens and the Tools/Go option is
faded out in fact the top four options are not available. If I then
save the code as say `test` the Tools/Go is enabled but clicking that
just opens a small command line window and nothing else until I close
it then the output panel to the right shows -
>ruby test.rb

Hi whats your name
>Exit code: -1073741510

all very strange, not sure about the keymap or how to change it?.
I have tried Netbeans a few times and its starting to do what I want
now so might stick with that for now.
Regards
Steve

  Réponse avec citation
Vieux 24/02/2008, 19h15   #11
Steve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!



> > Hi - to run the "current" screen - i.e. what you have just typed use CTRL
> > +
> > F6


> Does the current document have to be part of the current project?




In SciTe I type a few lines of code like so
puts 'Hi what`s your name ?'
name = gets
puts 'Hi ' + name
and then try ctrl + <F5> nothing happens and the Tools/Go option is
faded out in fact the top four options are not available. If I then
save the code as say `test` the Tools/Go is enabled but clicking that
just opens a small command line window and nothing else until I close
it then the output panel to the right shows -
>ruby test.rb

Hi whats your name
>Exit code: -1073741510


all very strange, not sure about the keymap or how to change it?.
I have tried Netbeans a few times and its starting to do what I want
now so might stick with that for now. Thanks Ashley for the pointer.
Regards
Steve
  Réponse avec citation
Vieux 25/02/2008, 12h14   #12
marc
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Netbeans with Ruby!

Steve said...
> Hi all
> Hope I`m ok posting a Netbeans query here?. I`m trying to learn Ruby
> using the Netbeans IDE. It seems a pretty slick application but I`m
> wondering if its possible to run a prog without creating a `new
> project` each time?. I just want to be able to type in a few lines of
> code and run it but it keeps running the `main project` which might be
> an earlier prog I have written??. I`m sure the solution is staring me
> in the face but would be grateful for any tips folk could provide.


Just add all your test scripts to one project and run the current file
with Ctrl+F6 - although I also add a mapping for the same thing to F12.

scite is also great.

--
Cheers,
Marc


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


É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,19455 seconds with 20 queries