FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Debug ruby script with arguments in rails project

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
Bryan Wilkerson
Posted via mailing list.





PostPosted: Tue Dec 09, 2008 7:47 pm    Post subject: Debug ruby script with arguments in rails project Reply with quote

Hi all,

I'm trying to debug some server side scripts that are part of a rails app (loads the rails environment, uses models and ActiveRecord). Anyhoo, I see the "Debug scheduler.rb" in the debug menu. Awesome. But where do I put the command line arguments required by my script?

Additionally, is there a way to specify the --name=<test_name> argument when running "Debug test for scheduler.rb"?

Thanks,

-bryan

http://www.liquidplanner.com
Back to top
Martin Krauskopf
Posted via mailing list.





PostPosted: Tue Dec 09, 2008 9:49 pm    Post subject: Debug ruby script with arguments in rails project Reply with quote

Bryan Wilkerson wrote:
Quote:
Hi all,

I'm trying to debug some server side scripts that are part of a rails
app (loads the rails environment, uses models and ActiveRecord).
Anyhoo, I see the "Debug scheduler.rb" in the debug menu. Awesome.
But where do I put the command line arguments required by my script?

Additionally, is there a way to specify the --name=<test_name> argument
when running "Debug test for scheduler.rb"?

Hi Bryan,

it seems to be impossible to set the arguments for Rails project now
(likely for some reason, or just not implemented, Erno?).

In the meantime you might go to:

your_rails_app/nbproject/private/private.properties
(better than nbproject/project.properties which is shared in VCS)

and add line:

application.args=hello world "1 2 three"

which will pass:

ARGV == ["hello", "world", "1 2 three"]

to the debugged or run scripts. Depending or Erno's response we will put
this into the wiki and file an issue. I can't recall whether this is on
purpose or just not implemented.

m.
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 9:07 am    Post subject: Debug ruby script with arguments in rails project Reply with quote

Martin Krauskopf wrote:
Quote:
Bryan Wilkerson wrote:
Quote:
Hi all,

I'm trying to debug some server side scripts that are part of a rails
app (loads the rails environment, uses models and ActiveRecord).
Anyhoo, I see the "Debug scheduler.rb" in the debug menu. Awesome.
But where do I put the command line arguments required by my script?

Additionally, is there a way to specify the --name=<test_name>
argument when running "Debug test for scheduler.rb"?

Hi Bryan,

it seems to be impossible to set the arguments for Rails project now
(likely for some reason, or just not implemented, Erno?).

I think it is just not implemented. As discussed, likely we will need a
new category in the run configurations for running any ruby files in a
Rails project. I'll file an issue for this.

Erno
Back to top
(((Bonsai Studio))) - Giu
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 3:27 pm    Post subject: Debug ruby script with arguments in rails project Reply with quote

I am sorry for the OT, but please, suspend address-removed
he is spamming this newsletter.

Il giorno 10/dic/08, alle ore 10:07, Erno Mononen ha scritto:

Quote:
Martin Krauskopf wrote:
Quote:
Bryan Wilkerson wrote:
Quote:
Hi all,

I'm trying to debug some server side scripts that are part of a
rails app (loads the rails environment, uses models and
ActiveRecord). Anyhoo, I see the "Debug scheduler.rb" in the
debug menu. Awesome. But where do I put the command line
arguments required by my script?

Additionally, is there a way to specify the --name=<test_name>
argument when running "Debug test for scheduler.rb"?

Hi Bryan,

it seems to be impossible to set the arguments for Rails project
now (likely for some reason, or just not implemented, Erno?).

I think it is just not implemented. As discussed, likely we will
need a new category in the run configurations for running any ruby
files in a Rails project. I'll file an issue for this.

Erno







Back to top
Martin Krauskopf
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 3:31 pm    Post subject: Debug ruby script with arguments in rails project Reply with quote

(((Bonsai Studio))) - Giuseppe wrote:
Quote:
I am sorry for the OT, but please, suspend address-removed
he is spamming this newsletter.

We are trying to solve this with forum administrator. He is trying to
enhance spam-prevention forum add-ons.

m.
Back to top
Bryan Wilkerson
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 6:54 pm    Post subject: Debug ruby script with arguments in rails project Reply with quote

Here is the hack I came up with as a workaround:

RUNNING_IN_DEBUGGER = (File.basename($0) == "rdebug-ide")
if( RUNNING_IN_DEBUGGER )
ARGV = ['8']
end

..at the top of the script being debugged. I would be nice to just get a popup that asked for arguments... maybe let you set the RAILS_ENV, oh and I don't know, why not save the info between nb sessions for each file too. I'm one of us can knock that out in our copious space time. Smile On second thought, that hack above pretty much works for me.

-b


From: Bryan Wilkerson <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 11:47:07 AM
Subject: Debug ruby script with arguments in rails project


Hi all,

I'm trying to debug some server side scripts that are part of a rails app (loads the rails environment, uses models and ActiveRecord). Anyhoo, I see the "Debug scheduler.rb" in the debug menu. Awesome. But where do I put the command line arguments required by my script?

Additionally, is there a way to specify the --name=<test_name> argument when running "Debug test for scheduler.rb"?

Thanks,

-bryan

http://www.liquidplanner.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB