Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 173977 - Add Capfile (for Capistrano) to Rails Project
Add Capfile (for Capistrano) to Rails Project
Status: RESOLVED FIXED
Product: ruby
Classification: Unclassified
Component: Rails
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Erno Mononen
issues@ruby
: NETFIX
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-07 14:42 UTC by ehartmann
Modified: 2010-04-07 11:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehartmann 2009-10-07 14:42:24 UTC
Erno, Capistrano (http://www.capify.org) seems to be the way for deploying with Rails projects.
Unfortunately, Capfile is not seen under "Projects Tab".

Here are 3 small modifications to allow this :

diff -r c9663ea487db ruby.project/src/org/netbeans/modules/ruby/rubyproject/RubyProjectOperations.java
--- a/ruby.project/src/org/netbeans/modules/ruby/rubyproject/RubyProjectOperations.java	Wed Oct 07 11:11:16 2009 +0200
+++ b/ruby.project/src/org/netbeans/modules/ruby/rubyproject/RubyProjectOperations.java	Wed Oct 07 15:35:40 2009 +0200
@@ -83,6 +83,7 @@
         FileObject projectDirectory = project.getProjectDirectory();
         List<FileObject> files = new ArrayList<FileObject>();
         addFile(projectDirectory, "nbproject", files); // NOI18N
+        addFile(projectDirectory, "Capfile", files); // NOI18N
         addFile(projectDirectory, "README", files); // NOI18N
         addFile(projectDirectory, "LICENSE", files); // NOI18N
         return files;


diff -r c9663ea487db ruby/src/org/netbeans/modules/ruby/ruby-mime-resolver.xml
--- a/ruby/src/org/netbeans/modules/ruby/ruby-mime-resolver.xml	Wed Oct 07 11:11:16 2009 +0200
+++ b/ruby/src/org/netbeans/modules/ruby/ruby-mime-resolver.xml	Wed Oct 07 15:35:29 2009 +0200
@@ -61,6 +61,7 @@
         <!-- Filename matches exactly rakefile or Rakefile. -->
         <name name="rakefile" ignorecase="false"/>
         <name name="Rakefile" ignorecase="false"/>
+        <name name="Capfile" ignorecase="false"/>
         <resolver mime="text/x-ruby"/>
     </file>
     <file>

diff -r c9663ea487db ruby.railsprojects/src/org/netbeans/modules/ruby/railsprojects/SourceRoots.java
--- a/ruby.railsprojects/src/org/netbeans/modules/ruby/railsprojects/SourceRoots.java	Wed Oct 07 11:11:16 2009 +0200
+++ b/ruby.railsprojects/src/org/netbeans/modules/ruby/railsprojects/SourceRoots.java	Wed Oct 07 15:34:54 2009 +0200
@@ -155,6 +155,10 @@
         if (readme != null) {
             plainFiles.add(readme);
         }
+        FileObject capfile = fo.getFileObject("Capfile"); // NOI18N
+        if (capfile != null) {
+            plainFiles.add(capfile);
+        }
         
         // show app/metal for Rack applications, but only if the folder already exists
         boolean metal = fo.getFileObject("app/metal") != null;//NOI18N


Of course a better integration should be to launch Capistrano from the file or the project, but right now, I have no
time to implement this.
Comment 1 ehartmann 2009-10-07 14:44:45 UTC
Oups, sorry I've made a mistake, please ignore the first patch, it was when I testing it with ruby projects not rails.
Here is the correct one :
diff -r c9663ea487db ruby.railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProjectOperations.java
--- a/ruby.railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProjectOperations.java	Wed Oct 07 11:11:16
2009 +0200
+++ b/ruby.railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProjectOperations.java	Wed Oct 07 15:34:42
2009 +0200
@@ -100,6 +100,7 @@
         // additional files
         addFile(project.getProjectDirectory(), "README", files); // NOI18N
         addFile(project.getProjectDirectory(), "Rakefile", files); // NOI18N
+        addFile(project.getProjectDirectory(), "Capfile", files); // NOI18N
         return new ArrayList<FileObject>(files);
     }
  
Comment 2 Erno Mononen 2009-10-08 12:07:47 UTC
Thanks! I'll integrate the patch soon (once our repos are back up).
Comment 3 Erno Mononen 2009-10-09 07:55:11 UTC
Patch integrated in 03cf16bb9a84.
Comment 4 Quality Engineering 2009-10-12 11:45:21 UTC
Integrated into 'main-golden', will be available in build *200910100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/03cf16bb9a84
User: Erno Mononen <emononen@netbeans.org>
Log: #173977: Add Capfile (for Capistrano) to Rails Project
- thanks to ehartmann for the patch
Comment 5 Jiri Kovalsky 2010-04-07 11:31:27 UTC
Issue added to list [1] of community fixed bugs.

[1] http://wiki.netbeans.org/NetFIXIssues


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo