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 117668 - Ruby project layout should follow Ruby conventions
Summary: Ruby project layout should follow Ruby conventions
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on: 112531 124096
Blocks:
  Show dependency tree
 
Reported: 2007-10-03 16:45 UTC by dudleyf
Modified: 2008-04-25 13:04 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Sample Ruby project (2.18 KB, application/octet-stream)
2007-10-03 16:46 UTC, dudleyf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dudleyf 2007-10-03 16:45:48 UTC
The current Ruby Application project doesn't look like a Ruby project. The Rakefile should not be in the lib directory,
but in the project root (like a build.xml file) and should not have a .rb extension. I'm attaching an example skeleton
project that follows the Ruby path a little closer.
Comment 1 dudleyf 2007-10-03 16:46:35 UTC
Created attachment 50118 [details]
Sample Ruby project
Comment 2 Martin Krauskopf 2007-10-04 12:57:44 UTC
Yup, I've already filed this sometime ago (issue 112531). I'll retake that issue and fix it. Thanks for the feedback.

*** This issue has been marked as a duplicate of 112531 ***
Comment 3 dudleyf 2007-10-04 17:46:03 UTC
I apologize, my description was a bit lacking. The Rakefile naming and location is only one part of the problem. The
default project layout should also include, at the bare minimum, LICENSE and README files, a test and/or spec directory,
an optional bin directory.
The generated Rakefile should have a gem specification and tasks for packaging the gem, running the tests and/or specs,
and generating rdocs. 
The sample project I attached has a Rakefile with the basic rake tasks and gemspec included. I left the Ruby files
blank, as there's more room for discussion about what they should look like.
Comment 4 Martin Krauskopf 2007-10-05 13:07:57 UTC
Ok, I see.

> at the bare minimum, LICENSE and README files

I agree with README (fixed, the rest is rather enhancement). Something developer might modify from time to time like any
other sources. LICENSE is nothing which is modified too often - enough to have it in the Files view.

> The generated Rakefile should have a gem specification and tasks for packaging the gem, running the tests and/or
> specs, and generating rdocs.

Probably we could have separate way to set up "Gem project" - separate wizard "New Project -> Ruby Gem". I suppose a lot
of users does not care about generating gem at all for their project(?)

Let me know what do you think. Thanks for feedback.

Fixing README:

projects/src/org/netbeans/modules/ruby/rubyproject/ui/SourceNodeFactory.java;
new revision: 1.8; previous revision: 1.7
projects/test/unit/src/org/netbeans/modules/ruby/rubyproject/ui/RubyLogicalViewProviderTest.java;
new revision: 1.2; previous revision: 1.1
Comment 5 dudleyf 2007-10-05 14:12:12 UTC
>LICENSE is nothing which is modified too often - enough to have it in the Files view.

Oh, sure. I just meant that every Ruby project should have these files, so we should generate stubs for them. 

> Probably we could have separate way to set up "Gem project" - separate wizard "New Project -> Ruby Gem". 

The difference between a "Ruby Gem" project and a "Ruby" project is 10 lines in the Rakefile, so I don't think it's
different enough to warrant a separate project type, but separate project type is better than nothing.

> I suppose a lot of users does not care about generating gem at all for their project(?)

Creating a Gem is the Ruby equivalent of creating a .jar file. It's how you package your code for distribution. You also
get the ability to create a .tar.gz or a .zip file of your project. A lot of users don't care about distributing their
code, and that's fine, they don't have to, but we don't lose anything by including the ability by default.
Comment 6 Martin Krauskopf 2007-10-05 14:54:08 UTC
> I just meant that every Ruby project should have these files, so we should generate stubs for them.

Still not sure by this. E.g. Rails project generator also do not generate README for the project nor LICENSE.

> The difference between a "Ruby Gem" project and a "Ruby" project is 10 lines in the Rakefile, so I don't think it's
> [...]
> code, and that's fine, they don't have to, but we don't lose anything by including the ability by default.

That's true. And actually also Java project in NetBeans behaves in the same way (a lot of pregenerated Ant targets).
User just does not need to care about those task and moreover there will be some "examples" for Ruby/Rake newcomers.
I'll add them.
Comment 7 dudleyf 2007-10-05 15:08:14 UTC
> Still not sure by this. E.g. Rails project generator also do not generate README for the project nor LICENSE.

Rails generates two README's (one for the framework, one in doc/README_FOR_APP), but no LICENSE. Rails projects are a
different beast altogether, though.
Comment 8 Martin Krauskopf 2007-10-08 13:05:06 UTC
> Rails generates two README's (one for the framework, one in doc/README_FOR_APP)

Did not notice this, thanks. README part fixed.

  projects/src/org/netbeans/modules/ruby/rubyproject/Bundle.properties;
  new revision: 1.15; previous revision: 1.14
  projects/src/org/netbeans/modules/ruby/rubyproject/RubyProjectGenerator.java;
  new revision: 1.6; previous revision: 1.5
  projects/test/unit/src/org/netbeans/modules/ruby/rubyproject/RubyProjectGeneratorTest.java;
  new revision: 1.3; previous revision: 1.2

Comment 9 Martin Krauskopf 2008-04-01 12:47:02 UTC
Larger part fixed (91f3b395ba67). Just LICENSE to be add. But firstly I need to fix other issue 124096.
Comment 10 Martin Krauskopf 2008-04-04 12:32:05 UTC
The rest fixed as well: 1f47c844826c