Thursday Nov 22, 2007

Creating Custom Rails Rake Tasks in NetBeans 6

I ran across this late yesterday night and thought I should share: If you are using NetBeans for your Ruby on Rails development and you are fond of creating custom rake tasks (as I am due to this awesome podcast), you need go around the NetBeans' GUI in this release. If you create the rakefile through the GUI, it will have a .rb extension (instead of the .rake extension) which Rails doesn't grok as a custom rake task. I get around it this way this way:
  1. open a terminal and cd into your Rails application directory.
  2. touch your custom rake file (with .rake extension) inside lib/tasks with something like:
    touch lib/tasks/example.rake
  3. edit your custom task in the NetBeans editor and create the actual rake task. Maybe something like this excellent db:seed task.
  4. use the Netbeans GUI to refresh your rake tasks (right-click the project and choose Run Rake Tasks > Refresh List
    refresh_rake_tasks.jpg
Hopefully, this will be added to the NetBeans 6.1 (per this bug request). Thanks to this entry at Quoted-Printable for the cool seed rakefile idea.
About

Ken Pepple is Chief Technologist for Sun Microsystem's Systems Line of Business

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
Blogroll

No bookmarks in folder