This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 91402 - Unable to run single script
Summary: Unable to run single script
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
: 120265 (view as bug list)
Depends on: 102081
Blocks:
  Show dependency tree
 
Reported: 2006-12-21 11:40 UTC by Martin Krauskopf
Modified: 2009-08-21 06:15 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2006-12-21 11:40:46 UTC
1) Menu --> Open File
2) Choose some_script.rb

Colorization, code-completion and everything seems to work nicely. But file
cannot be run.
Comment 1 Torbjorn Norbye 2006-12-22 19:15:15 UTC
The key to reproducing this is that the script should be outside of an existing
project. (I had tried reproducing this by just opening files from other projects
without opening them, but that's not sufficient.)
Comment 2 Torbjorn Norbye 2006-12-22 19:18:59 UTC
It looks like the "Run File" action is project sensitive. When there is no
project, it is not enabled.  I see the same behavior for Java files. If I just
open up /tmp/Foo.java (where Foo is a main-method enabled Java class), I have
the same problem - Shift-F6/Run File is not enabled.
Comment 3 Martin Krauskopf 2006-12-22 19:50:20 UTC
Yes, it is project-sensitive (o.n.m.ruby.rubyproject.RubyActionProvider). I
think that just a popup-menu with "Run" would be OK for such cases.
For ruby is is IMHO more probably that one wants to run some Ruby script than
for abandoned Java class with main.
Comment 4 Torbjorn Norbye 2006-12-22 21:02:03 UTC
We could add a special "Run File" context menu to Ruby files (files and/or
editor). The problem is that it wouldn't be -the- Run File action - Shift-F6
won't work, and the one you find in the main menu won't work. That seems
unfortunate.

The problem is that the Run File action is provided by the projects
infrastructure
(projects/projectui/src/org/netbeans/modules/project/ui/actions/Actions.java)
and is tied to a project.

It certainly makes sense for Run File to provide project-context when it is
available, but it would be better if the action also allowed out-of-project
execution. I think we should raise this issue with the projects group before
adding a workaround. It's not clear how this could be solved though - I assume
an ActionProvider should still be involved ot handle the execution, but will it
work correctly when it is not associated with a project, and how is the
ActionProvider associated with the DataObject in the first place? Perhaps we
should leave this issue open for a while and think about it.  I can also see
that I should be able to execute a Ruby file within a Java project, in which
case the RubyActionProvider will not be involved, so standalone execution is
necessary. I know we used to have an Execution cookie, but I'm not sure how that
interacts with the new projects stuff; I was under the impression that it's
deprecated.
Comment 5 Marco Walther 2006-12-23 01:05:06 UTC
I'll come a little bit later to the same problem;-)

So we should find a way which works for all the different [scripting] 
languages which work well even without a project;-)
Comment 6 Jiri Skrivanek 2007-04-12 19:05:57 UTC
Run file action is still missing on *.rb file node although it is enabled in
main menu Run|Run File.
Comment 7 Jiri Kovalsky 2007-07-03 14:01:06 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 8 Torbjorn Norbye 2007-08-02 20:14:58 UTC
Can't fix with the current infrastructure.
Comment 9 Martin Krauskopf 2007-10-30 11:39:44 UTC
*** Issue 120265 has been marked as a duplicate of this issue. ***
Comment 10 nocturnalone 2008-01-14 21:00:41 UTC
Hi,

just wanted to let you know I also ran into this and hope you'll fix it soon. Being able to use NetBeans as an 'adhoc'
editor and debugger besides the current project-centric approach will make it more widely applicable.

Thanks for your consideration,

  Sander
Comment 11 Jesse Glick 2009-07-16 16:27:55 UTC
Yes, long known to require a new API.
Comment 12 Erno Mononen 2009-08-18 14:20:02 UTC
I've implemented Run File for ruby files that are not part of a project, working on Debug File now.
Comment 13 Erno Mononen 2009-08-19 08:43:59 UTC
Implemented also Debug File in 1d92fde01e47.
Comment 14 Quality Engineering 2009-08-21 06:15:24 UTC
Integrated into 'main-golden', will be available in build *200908210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1d92fde01e47
User: Erno Mononen <emononen@netbeans.org>
Log: #91402 (part 2 - debug file): Unable to run single script