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 109944 - create new project - "Looks like a Rails directory"
Summary: create new project - "Looks like a Rails directory"
Status: RESOLVED WONTFIX
Alias: None
Product: ruby
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
: 109945 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-17 02:49 UTC by jamespb
Modified: 2008-08-19 00:12 UTC (History)
0 users

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 jamespb 2007-07-17 02:49:37 UTC
Go to File > New Project > Ruby > Ruby Project with Existing Sources and choose a Ruby (not rails) existing project.

Get a little message saying "Looks like a Rails directory - Use a Rails project instead"

But it's not a Rails project - the Rails layout is pretty common for Ruby projects (although I'm not sure exactly what
NetBeans is looking for, or why it cares), and this seems like a strange thing to say.  If it's not a Rails project,
seems like I shouldn't claim to NetBeans that it's a Rails project.
Comment 1 Torbjorn Norbye 2007-07-17 03:05:47 UTC
It looks to see if the proposed directory contains "config/environment.rb", and if so warns that it may be a Rails project. Note that it only warns - it doesn't 
mark the input as invalid, so the Finish button is still enabled and you can proceed if you're sure you really don't want a Rails project.

I added this warning a while back to help avoid some usability problems where users would try to create a Ruby project for a Rails application, and then 
wonder why none of the Rails functionality would work (since that's tied to Rails projects).

The approach I'm using now was based on something I read ZenTest is doing:
"The autotest command will automatically discover a Rails directory by looking for config/environment.rb."
http://zentest.rubyforge.org/ZenTest/classes/Autotest.html

Do you have any ideas for how it could more accurately detect it a project structure is a Rails project?
Comment 2 jamespb 2007-07-18 17:34:34 UTC
What are the implications of marking something as a Rails project instead of a Ruby project?  The only things I can
think of that I use regularly would be the controller/test keyboard shortcuts, and I can't think of why you'd want to
disable those in a Ruby project.
Comment 3 Torbjorn Norbye 2007-07-19 19:05:53 UTC
*** Issue 109945 has been marked as a duplicate of this issue. ***
Comment 4 Torbjorn Norbye 2007-07-19 19:10:37 UTC
The Rails project type is quite different. It has a different context menu (actions like code generation, migrate db), it has a different set of source paths (app/
controllers, app/helpers) etc., it has different options (a ruby project has a "main" class (the Run entry point) as well as program arguments, whereas for Rails 
there's a server port setting and Run means start the server and warp to the main index.)   Also, the available file templates a different - from a Rails project 
you can create RHTML files and RJS files whereas these don't show up in vanilla Ruby projects.
Comment 5 jamespb 2007-07-19 19:26:45 UTC
autotest is a good source.

I would have thought you'd want to go deeper than that - maybe look in config/environment.rb for some Rails strings -
but at least the current way has at least one other substantial project doing the same thing.  

I'd post to the rails mailing list to see if people had other thoughts - I'm not a good authority here.
Comment 6 Martin Krauskopf 2007-10-26 09:10:18 UTC
> I'd post to the rails mailing list to see if people had other thoughts - I'm not a good authority here.

James did you find anything what would help with analysis whether it is a Rails project or not? Thanks.
Comment 7 Martin Krauskopf 2008-08-19 00:12:10 UTC
1) ZenTest sources also decides for Ruby on Rails project on config/environment.rb

   http://zentest.rubyforge.org/svn/ZenTest/dev/lib/autotest/discover.rb

2) It is just a warning and is actually right "Looks like a Rails directory"

The case is rare and harmelss. Closing as "Will not fix" for now.