Wednesday Nov 07, 2007

NetBeans Ruby Shortcuts

The other day, Tor Norbye sent us an email listing some NetBeans Ruby navigation shortcuts, which we thought we'd highlight in the blog. We did a little further research on the subject and also list here some favorite user shortcuts that we undercovered.

(For a complete list of NetBeans Ruby Keyboard Shortcuts, see Ruby Shortcuts).

Navigation Shortcuts

Navigation is important - jumping between files and their tests, or between Rails actions and views. Here are some navigation shortcuts:

  • If you're in a controller file, and realize you need to modify its corresponding view, press Ctrl-Shift-A (Command-Shift-A on the Mac) to jump to it. Press again to go in the opposite direction.
  • Similarly, if you're in a Rails controller file (for example) and want to go edit its unit test, hit Ctrl-Shift-T (Command-Shift-T on the Mac) to jump to it - and again to jump back.

User Favorite Shortcuts

Here are some more frequently used shortcuts.

Action Shortcut Mac Shortcut
Show code completion alternatives Ctrl-Space. If Ctrl-Space does not work for your language, try using Ctrl-\\ Ctrl-Space
Open File by name prefix (not path) Alt-Shift-O Ctrl-Shift-O
Show name of current parameter (when editing an argument list for a method call) Ctrl-P Command-P
Format Code Alt-Shift-F Ctrl-Shift-F
Reformat the current comment paragraph Ctrl-Shift-P Command-Shift-P
Jump to matching parenthesis / brace / bracket, or other matching Ctrl-[ Command-[
Show Documentation Ctrl-Shift-Space Command-Shift-Space

NetBeans Shortcuts

You can download a shortcut card that lists the highlights of the NetBeans IDE 6.0 keyboard shortcuts and code templates. In the NetBeans IDE, choose Help > Keyboard Shortcuts Card from the main menu. Similarly, you can view the shortcuts online from the NetBeans IDE 6.0 Keyboard Shortcuts Specification.

Friday Nov 02, 2007

Confessions of a NetBeans Ruby User

Teera Kanokkanjanarat is a Sun campus ambassador who recently contributed the tutorial Swing with JRuby: Developing a Desktop Application with the JRuby and Java Swing APIs. Here we interview Teera to find out more about his interest in NetBeans Ruby.

First, tell us a little bit about yourself.

I've been working as a freelance software developer for about 8 years ever since finishing high school. My work mainly focuses on the web platform with various technologies ranging from Java, ASP.NET, PHP, and recently I got started on Ruby and Rails. Since November 2006, I've been hired by Sun as a campus ambassador at Simon University in British Columbia, Vancouver, where I'm completing my degree in Computing Science and Business Administration.

What is your interest in Ruby?

Coming from the strongly-typed language world of Java and C#, I find the flexibility and dynamic of the Ruby language to be very interesting. I believe that the productivity of developers has a heavy impact on the cost of software projects. I often find that I waste time waiting for the project to compile and re-deploy to web or application servers. So that's the first thing I found really appealing when I started working with the Ruby and Rails framework. Ruby seems to gain a lot of momentum on the web platform with the Rails framework. Now I'm more interested in the future of Ruby as a rich client on the desktop.

How did you learn Ruby?

I started out on Hal Fulton's The Ruby Way book to learn the Ruby language itself and the Ruby way of doing things. I often watch screencasts and vodcasts for techniques on learning Rails. I'm also a member of the Vancouver Ruby and Rails user group, where I attend monthly meetings. This is an interesting group; as a Java guy, I learn so much from others who work with Ruby on a daily basis.

What do you like and dislike about Ruby?

The Ruby language itself is beautiful. There are not many programming languages that are as intuitive and give me that "wow this is cool stuff!" sort of thrill. Of course, this is also because of Ruby's coding conventions and key principles.

I actually did a small experiment re-creating one of my old, small Java-based web projects with Ruby on Rails. I found that the entire project on RoR actually contains fewer lines of code than that in the previous version's configuration files!

In my opinion, performance and deployment are still the key issues of Ruby. JRuby and other initiatives are really aiming on these two issues.

How has NetBeans helped you build Ruby apps?

I tried RadRails, TextMate, and InstantRails. Yet, I like Netbeans Ruby support the most, especially in code editing, the Ruby debugger, and the auto-complete capability. Netbeans is tightly integrated with JRuby as well.

Tell us about the NetBeans Ruby app you are currently building?

I'm developing JSF web components for one of the my clients. There's future planning to release these components in rich client version (Swing and SWT). I'm doing an experimental project on how to leverage JRuby for developing these desktop components.

What was your favorite experience as a Sun ambassador?

Meeting with people! I made a lot of friends from around the world through this program. I also learned a lot from talking to people when I do evangelizing work, whether it's a tech demo or a presentation at a user group. Nothing beats learning from those who do real work out there in the field.

What are some things you like to do outside school and work?

I started a small coffee shop back when I was 19 and opened up a day-spa with my sister about two years ago. Both of them are in Thailand. So, I'm helping my sister run them remotely.

Where do you see yourself in five years?

Completing my degree is my first priority (it has been delayed several times due to my work). After finishing my term at Sun at the end of this year, I'll be joining Business Objects as a software developer. In the next five years, I might do another startup if there some good ideas come along, but things change, you never know.

Monday Oct 29, 2007

Community-Contributed NetBeans Ruby Docs

In this blog, we would like to acknowledge two NetBeans Ruby community-contributed tutorials:

Thanks to Teera and Amit, we have a richer documentation set, which you can view in its entirety on the NetBeans Ruby Tutorials and Screencasts page.

If you are interested in contributing documentation to the NetBeans Community, consider joining the dev@userguide.netbeans.org email alias. This alias is for community members who want to not only contribute documentation but also provide input and feedback regarding existing NetBeans documentation. You can sign up for the alias as follows:

  1. Go to the NetBeans Mailing Lists Page
  2. Log on with your user name. If you don't have a user name, click Login and then register for a login name.
  3. Scroll to the dev@usersguide.netbeans.org mailing list.
  4. Click subscribe to send a subscription request.

Friday Oct 19, 2007

Got Ruby Questions?

Next week (October 22 - 26) you will have the opportunity to submit written questions about all things NetBeans to a team of NetBeans evangelists, including Ruby technology evangelist Brian Leonard.. You can submit a question any time during that week, and the evangelists will try to answer as many questions as possible. They will also post a selected set of questions and answers. To learn more, visit the Ask the Experts events page.

Monday Oct 15, 2007

Chart for NetBeans Ruby Database Access Setup

I have written both an installation and configuration article and an accessing databases FAQ for projects built using NetBeans Ruby support. However, because there are lots of different configuration paths, and each path requires some in-depth information, neither of these documents make it easy to quickly figure out what you must do to set up your Rails project to access your database server. I created this chart to hopefully make the steps simpler, and more clear. If you need more details, then consult the two documents that I mention above.

Steps for Accessing Databases Using NetBeans Ruby Support
 
Using JRuby
 
Using MySQL
 
   Using JDBC
Do:  Put the MySQL JDBC 3.0 compliant driver in netbeans-install-dir/ruby1/jruby-1.0.1/lib.
Do:  Select the database server from the drop-down list in the New Project wizard.
Do:  Select the Access Database Using JDBC checkbox in the New Project wizard.
 
  Using the Bundled MySQL Adapter
Do:  Select the database server from the drop-down list in the New Project wizard.
Do:  Clear the Access Database Using JDBC checkbox in the New Project wizard.
 
Not Using MySQL
   Do:  Put database's JDBC 3.0 compliant driver in netbeans-install-dir/ruby1/jruby-1.0.1/lib
Do: Select the database server from the drop-down list in the New Project wizard.
Do: Select the Access Database Using JDBC checkbox in the New Project wizard.
Notes: Currently, the supported databases are: MySQL, PostgresSQL, Oracle, HSQLDB, and Java DB (also known as Derby). The database's JDBC driver must be a pure Java driver. If you are deploying to GlassFish, you must also put a copy of your database server's JDBC driver in glassfish-install-dir/lib and start (or restart) the GlassFish server.

 
Using Native Ruby
 
Using MySQL
  
Using the Bundled MySQL Adapter
   Do:  Select the database server from the drop-down list in the New Project wizard.
Do:  Clear the Access Database Using JDBC checkbox in the New Project wizard.
  
Using a MySQL Gem
   Do:  Consult Ruby on Rails MySQL page. Download and install appropriate software.
Do:  Select the database server from the drop-down list in the New Project wizard.
Do:  Clear the Access Database Using JDBC checkbox in the New Project wizard.
  
Not Using MySQL
   Do:  Consult the Ruby on Rails Database Drivers page. Download and install appropriate software.
Do:  Select the database server from the drop-down list in the New Project wizard.
Do:  Clear the Access Database Using JDBC checkbox in the New Project wizard.
All
   Do:  Edit database.yml to specify username, password, and, if necessary, database name.

Tuesday Oct 09, 2007

Generating Rails Models

Our NetBeans Ruby tutorials show how to use the Rails Generator dialog box to add models to a Ruby on Rails web application. We show one step that uses the Rails Generator wizard to create the following:

  • Model File: This file contains the model's unique methods and business rules.
  • Initial Migration Files: Migration file for creating the database table. You run the migration files to create and modify the database table, and to back out changes
  • Unit Text Files: Files for testing your development.

In the subsequent step we have you edit the migration file to specify the column names and types. Did you know that you can can create the model and edit the migration file in one step by passing arguments in the Rails Generator? For example, let's say that I wanted a categories database table. I can right-click the project's node and choose Generate. In the Rails Generator wizard, I choose model from the Generate drop-down list. Then, I enter the following text in the Argument text box, and click OK to create the files:

Category name:string description:text level:integer created:timestamp icon:binary

The arguments list begins with the model name and is followed by column-name:type parameters. The type can be one of :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean. To learn more about model arguments, see the TableDefinition API.

After the IDE finishes creating the files, I can click on the create db/migrate/002_create_categories.rb link in the Rails Generator tab in the Output window to open the file in the editor. The contents looks like this:

class CreateCategories < ActiveRecord::Migration
  def self.up
    create_table :categories do |t|
      t.column :name, :string
      t.column :description, :text
      t.column :level, :integer
      t.column :created, :timestamp
      t.column :icon, :binary
    end
  end

  def self.down
    drop_table :categories
  end
end

Once you have a migration file set up, you can move your application to another machine and have the IDE create the tables automatically. The same is true for database changes. With the up and down methods, you can quickly add or back out changes. Migrations also make it easier to switch to a different database server, say from JavaDB to MySQL.

Note: If you have an existing database, and you want to quickly create migration files, right-click the project node and choose Run Rake Task > db > schema > dump. The IDE writes the schema for your database to Database Migration > schema.rb. You can copy the create statements from the schema dump into migration files.

Wednesday Sep 26, 2007

Using jMaki 1.0 With NetBeans Ruby

The jMaki 1.0 framework, with support for Java, PHP, and Ruby, was released yesterday. Last week, Arun Gupta posted a screencast showing how to use jMaki wrappers of button and table widgets from Dojo and Yahoo frameworks in a Ruby on Rails application built using the NetBeans 6.0 Beta IDE.

With Arun's permission, I am supplying the steps to recreate a similar jMaki on Rails project. To save steps, I changed the order a bit. If you don't already have NetBeans Ruby Support, go to the Installing and Configuring Ruby Support tutorial for instructions.

  1. Before you begin, create the database for this Rails application. You need a database server that is supported by JRuby, such as MySQL, Java DB, PostgresSQL, Oracle, or HSQLDB. Add a database instance named rorjmakitables_development. For example, for MySQL, start the server and type the following at a command prompt.
    mysqladmin -u root -p create rorjmakitables_development
    If you don't need a password, omit the -p.

  2. If you haven't already, download the jMaki NetBeans plugin (This is org-netbeans-modules-sun-jmaki.nbm. The installer tells me it is version 1.6.11, and the info.xml in the NBM says its release date is Sept. 25, 2007).

  3. To install it into the IDE, complete the following steps:

    1. In the IDE, choose Tools > Plugins from the main menu.

    2. Click the Downloaded tab and click Add Plugins.

    3. Navigate to and select the downloaded org-netbeans-modules-sun-jmaki.nbm module, then click Open.

    4. Click Install, and click Next.

    5. Select the radio button to accept the license agreement and click Install.

    6. Select Restart IDE Now and click Finish.

  4. To create a new Ruby on Rails project, complete these steps:

    1. Right-click on a blank spot in the Projects window, and choose New Project from the pop-up menu.

    2. Select Ruby in the Categories pane, select Ruby on Rails Application in the Projects pane and click Next.

    3. If you have other Ruby installations in your path besides the bundled JRuby installation, you are asked to choose a Ruby interpreter. This dialog only pops up the first time the IDE needs to access the interpreter. For this tutorial, choose JRuby and then click Close. Note that this choice affects all Ruby projects. You can switch this setting whenever you want. See Installing and Configuring Ruby Support to learn how.

      If you have configured the IDE to not use JRuby, please use the Options wizard to switch back to JRuby for this tutorial, as described in Installing and Configuring Ruby Support.

    4. Type rorjmakitables, and accept the default location or, optionally, enter a different path.

    5. Choose a Database from the drop-down list. Your choice specifies how to set up the database.yml file. This tutorial uses MySQL.

      At the time of this writing, Java DB is not on the list, but it probably will be added later. So, if you are using the Java DB, and you don't see it on the list, don't bother selecting a database. You can edit the database.yml file instead. See Using Database Servers With JRuby for instructions.

    6. With JRuby, if you don't use MySQL, you must select the Access Database Using JDBC checkbox. This causes the project to modify the environment.rb configuration file to use the ActiveRecord-JDBC gem. So, unless you are using MySQL, check this box.

    7. Click Next.

    8. Because you are using the bundled JRuby, which includes Rails, the wizard shows that Rails is already installed. The wizard gives you the option of updating the installed version, but let's skip that.

      Click Finish.

      The Generate Rails Project tab in the Output window shows all the folders and files that the IDE creates.

  5. The IDE opens the database.yml file in the editor. Set the username for the development configuration, as shown below. If your database requires a password, set the password too.
      development:
      adapter: mysql
      database: rorjmakitables_development
      username: root
      password: root_password
      host: localhost
    
  6. To add a controller, right-click the rorjmakitables project node in the Projects window, and choose Generate. Select controller from the Generate drop-down list, set the Name to say and set the View to table, then click OK.

  7. In the Projects window, expand Configuration and double-click routes.rb to open it in the editor.

  8. Add the following line above all the other map.connect entries.
      map.connect '', :controller => 'say', :action=>'table'
    
  9. In the Projects window, expand Public, right-click index.html and choose Delete (or Rename if you would rather rename the file).

  10. In the Projects window, expand Views, expand say, and double-click table.rhtml to open it in the editor.

  11. On the right-side of the IDE is the Palette, as shown below. Expand jMaki Yahoo.



  12. Drag a Button widget from the jMaki Yahoo section and drop it on the file.

  13. Drag and drop a second Button widget.

  14. Replace the widget code fragments with the following code.
    <%= jmaki_widget 'yahoo.button',
      :value => { :label => 'Select 1',
      :action => { :topic => '/jmaki/table/select',
        :message => { :targetId => '1' }
      }
    } -%>
    <%= jmaki_widget 'yahoo.button',
      :value => { :label => 'Select 2',
      :action => { :topic => '/jmaki/table/select',
        :message => { :targetId => '2' }
      }
    } -%>
    
    These buttons use the jMaki publish/subscribe mechanism to publish to the /jmaki/table/select topic, which you will program two table widgets to listen to. The table widgets will select either the first row or the second row, depending on which button is clicked. For more details on how to use publish/subscribe, see Carla Mott's Widgets Talking To Widgets blog entry.

  15. Drag a Data Table widget from the jMaki Yahoo section onto the file.

  16. Expand jMaki Dojo and drag a Table widget from that section onto the file.

    Both these widgets use the jMaki Table Data Model.

  17. Add :subscribe=> "/jmaki/table", to each table widget, as shown in bold below, to make both tables listen to all the /jmaki/table topics.

    (Important)Also, change the row data to include numeric ids, as shown in bold, so that they match the target ids in the button code. For the first row, you have to add :id= > '1',. For the second row, which already has the :id argument, simply change bar to 2.
    <%= jmaki_widget 'yahoo.dataTable', :subscribe=> "/jmaki/table",
      :value =>
      {:columns => [
        { :label => 'Title', :id => 'title'},
        { :label => 'Author', :id => 'author'},
        { :label => 'ISBN', :id => 'isbn'},
        { :label => 'Description', :id => 'description'}
      ],
      :rows => [
        { :id=> '1', :title => 'Book Title 1', 
              :author => 'Author 1', :isbn => '4412', 
              :description => 'A Some long description'},
        { :id => '2', :title => 'Book Title 2', 
              :author => 'Author 2', :isbn => '4412', 
              :description => 'A Some long description'}
      ]
    }
    -%>
    <%= jmaki_widget 'dojo.table', :subscribe=> "/jmaki/table",
      :value =>
      {:columns => [
        { :label => 'Title', :id => 'title'},
        { :label => 'Author', :id => 'author'},
        { :label => 'ISBN', :id => 'isbn'},
        { :label => 'Description', :id => 'description'}
      ],
      :rows => [
        { :id=> '1', :title => 'Book Title 1', 
              :author => 'Author 1', :isbn => '4412', 
              :description => 'A Some long description'},
        { :id=> '2', :title => 'Book Title 2', 
              :author => 'Author 2', :isbn => '4412', 
              :description => 'A Some long description'}
      ]
    }
    -%>
    
  18. Click the Run Main Project button on the main menu (the green arrow). This starts the server and opens the table view in a browser.

  19. Click the first button to select the first row, and click the second button to select the second row.

  20. In order to display database data in the table, we must first create a model. In the Projects window, right-click the project node, and choose Generate from the pop-up menu.

  21. Choose model from the Generate drop-down list, type grid in the Arugments text box, and click OK.

  22. To define the model's data structure, expand Data Migrations in the Projects window, then expand migrate and double-click 001_create_grids.rb to open it in the editor.

  23. Replace the up method with the code shown in bold.
    class CreateGrids < ActiveRecord::Migration
    
     def self.up
        create_table :grids do |t|
          t.column :title, :string
          t.column :author, :string
          t.column :isbn, :string
          t.column :description, :string
        end
        Grid.create(:title=> 'Marathon',
           :author=> 'Jeff Galloway',
           :isbn=> '0936070250',
           :description => 'A running book for everybody');   
        Grid.create(:title=> 'The Runners Bible',
           :author=> 'Marc Bloom',
           :isbn=> '0385188749',
           :description => 'How to train, race, and get in shape');   
      end
    
      def self.down
        drop_table :grids
      end
    end
    
  24. To create the database table and populate it with the two rows of data, right-click the project node in the Projects window and choose Migrate Database > To Current Version from the pop-up menu.

  25. Now you can define a variable that contains the data from the database table. In the Projects window, expand Controllers and double-click say_controller.rb to open it in the editor.

  26. Replace the table definition with the following code shown in bold.
    class SayController  < ApplicationController
    
      def index
        table
        render :action => 'table'
      end
     def table
        @rows_data = []
        Grid.find_all().each do |data|
          @rows_data  << { :id => data.id,
            :title => data.title,
            :author => data.author,
            :isbn => data.isbn,
            :description => data.description
          }
        end
      end
    end
    
    The above code defines the rows_data variable and initializes it to an empty array. It uses the active record to find all the rows from the database and, for each row, add a hash of the fields to the rows_data array.

  27. Return to the table.rhtml view by right-clicking in the editor and choosing Navigate > Go To Rails Action or View.

  28. Replace the static rows data in the table fragments with the @rows_data variable as shown in bold below.
    <%= jmaki_widget 'dojo.table',
    :value =>
    {:columns => [
         { :label => 'Title', :id => 'title'},
         { :label =>'Author', :id => 'author'},
         { :label => 'ISBN', :id => 'isbn'},
         { :label => 'Description', :id => 'description'}
         ],
      :rows => @rows_data
      }
    -%>
    <%= jmaki_widget 'yahoo.dataTable',
    :value =>
    {:columns => [
         { :label => 'Title', :id => 'title'},
         { :label => 'Author', :id => 'author'},
         { :label => 'ISBN', :id => 'isbn'},
         { :label => 'Description', :id => 'description'}
         ],
      :rows => @rows_data
      }
    -%>
    
  29. Choose File > Save All from the main menu to save all your changes.

  30. Go back to the browser and refresh the page. The data now comes from the database table.

There you have it! To learn more about jMaki, go to www.jmaki.com. To learn more about NetBeans support for Ruby, go to wiki.netbeans.org/wiki/view/Ruby.

Thursday Sep 20, 2007

Installing and Configuring NetBeans Ruby

Netbeans Beta 1 was released Monday, and you can download a version of the IDE that contains Ruby support from the NetBeans IDE 6.0 Download Page. A good resource to help you get started is the new tutorial Installing and Configuring Ruby Support. This tutorial provides everything you need to know from downloading, installing, and configuring Ruby support, to working with databases, to deploying a JRuby application to Glassfish.

If you are creating Ruby on Rails applications, we have another new tutorial in that area, Building Relationships Between Rails Models. This tutorials enhances the tutorial Creating a Ruby Weblog in 10 Minutes. by enabling readers to add comments to a blog post. In particular, the new tutorial describes how to create a one-to-one and a one-to-many relationship between models in a NetBeans Ruby on Rails project.

If you are interested in contributing to NetBeans Ruby, please consider joining the Ruby mailing lists: dev@ruby.netbeans.org, used to discuss development of the Ruby features for NetBeans, and users@ruby.netbeans.org, for general support and discussions of NetBeans Ruby. To subscribe to and participate in the aliases, please visit the Mailing List page.

Monday Sep 17, 2007

Arun Pushes the Edge of the JRuby/GlassFish Envelope

Last week, Arun Gupta paid a visit to the NetBeans Ruby writers. It was great to finally meet this dynamo in person and find out what a nice guy he is. When we first started writing about NetBeans Ruby, we used Arun's blog Miles to Go as one of our resources to quickly learn about the technology. Arun tells us that the blog's name has a double meaning: he is both an avid runner and he feels like he has a lot to learn in his job.

In addition to Ruby/JRuby and GlassFish, Arun blogs on a variety of topics, including jMaki, web services, WSIT, Ajax, and Web 2.0. Arun somehow manages to be one of the first to write about how to use emerging technologies, so we like to keep an eye on his blog to find out what we will be writing about in the future. For example, last Friday, he blogged about a new GlassFish gem for Rails. We also like to follow his popular "Tip of the Day" entries. You will often see his information folded into our tutorials. Arun seems to really understand his audience's information needs and he has been very helpful by providing good suggestions as to what to include in our tutorials.

Wednesday Sep 12, 2007

Native Ruby and JRuby Support in NetBeans IDE 6.0

There is a rumor floating around that the NetBeans IDE Ruby support only works for JRuby. Don't believe it. The IDE makes it very easy to use your own Ruby installation in addition to the bundled JRuby software. As a matter of fact, the first time that you open or create a Ruby project, the IDE looks on your system for other Ruby installations. If it finds any, it pops up a dialog box listing the available installations and lets you choose which one to use.

Using JRuby is just like using Ruby, and you don't have to know anything about Java to use JRuby. You can open your existing Ruby applications for development in the IDE and work with them using the IDE's features regardless of whether you have chosen to use the JRuby interpreter or your native Ruby interpreter. The one exception that I know of is that with JRuby you have to use the ActiveRecord-JDBC adapter if you are using a database server other than MySQL. However, all you have to do is to put the client driver in JRuby's lib folder, make a couple of simple changes to your database.yml, and add a snippet to your environment.rb. Tom Enebro writes about it here. The ActiveRecord-JDBC adapter works with MySQL, Postgresql, Oracle, Derby/Java DB, HQLSDB, and H2 database management systems.

One of the advantages of using JRuby is that you can access Java libraries from your Ruby application. Tor and Cindy put together a great video about this for NetBeans TV.

Another benefit is that you can war up a JRuby application and deploy it to a Java application server, such as GlassFish, just like you would with a Java web application. Arun Gupta has written several blog entries about this and the upcoming Installing and Setting Up Ruby tutorial provides step-by-step instructions for one of the simpler methods of deploying to the GlassFish server. One advantage of deploying to Java application servers is that they are designed to be multi-threaded and thus can handle more than one request at a time. In addition, Java application servers provide tools that make it easier to manage your deployed applications. For detailed information about creating and deploying JRuby applications, see the Rails Integration page on the JRuby wiki.

Monday Sep 10, 2007

New NetBeans Ruby Videos and Articles

Cindy Church and Tor Norbye have teamed up to create two more videos on NetBeans Ruby, this time focusing on the Ruby editor:

Also recently published is Brian Leonard's and Beth Stearns' article titled Test-Driven Rails Development. This article describes the features of the NetBeans IDE that can help you test your Ruby and Rails code.

Be sure to check out the NetBeans Ruby Wiki and let us know what docs you would like and if you have docs to contribute. The wiki is a community site, and the instructions for contributing are there.

Friday Aug 31, 2007

Publishing Now Belongs to the Community

Just watched this interesting video which pretty much sums up my 10 years at Sun.

At first I wrote "man" pages and hard-copy manuals that were published once a year. By the time they came out, they were already obsolete. I never knew if anyone read my stuff or if it met their needs. We eventually started writing technical articles in HTML, but these were not published until the official release. Any errors or updates could not be corrected until the next release. In the past few years, we have been publishing our tutorials on the web as soon as we write them and updating them whenever necessary. We put feedback buttons on the page so people could report errors or make suggestions. We wrote back and often started dialogs. We requested tutorial suggestions and got lots of input. Then we started this blog and started pushing out information as soon as we learned it, so that people didn't have to wait until we had put it in some polished tutorial. Now we have joined the NetBeans Ruby team and our roles have totally changed. We are no longer a group of writers who take information from the engineers and make it available to the software users, we are members of a community of contributors to the NetBeans Ruby Wiki. When I have questions about the topic I am working on, I don't just turn to the engineers, I turn to the community. They help me write my docs, and hopefully, I can help them write theirs. These are exciting times.

New Video on Java and Ruby Development

Check out the new video on NetBeans TV titled Mixing Java and Ruby Development. In this video, Ruby developer Tor Norbye uses NetBeans IDE 6.0 to integrate a Java CRUD application with a Ruby on Rails application. The video highlights many of the features of the NetBeans Ruby editor, including code completion. Also included are the Rails code generator and the IDE's JUnit module.

Our coworker, Cindy Church, put in long hours producing the video and it shows in the content and quality of the video. The video is fairly fast-paced, so a written version of the video script is also available.

Wednesday Aug 29, 2007

Opening a File From the Command Line

I learned a neat trick in the dev@ruby.netbeans.org mailing list this week, one that I wish I had discovered long ago -- how to open a file in the Netbeans editing area from the command line, even if the file is not in an opened project.

Make sure that the NetBeans bin directory is in your path. Then use the following command to open the file in the NetBeans editing area.

netbeans --open file

Even better, make an alias:

alias nb='netbeans --open '

Then you can simply type nb file. The command will start up the NetBeans IDE if necessary. If the IDE is already open, the command simply opens the file and pops it to the front of the editing area.

If you are using Windows, you can also do the following to open a file in the IDE.

  1. Right-click on a file in an explorer window.
  2. Choose Open With > Choose Program.
  3. Select NetBeans from the program list. If NetBeans is not on the program list, click Browse, navigate to and select netbeans-install-dir/bin/netbeans.exe, and click open.
  4. Click OK. The file opens in the IDE. Sometimes the IDE does not show the file's tab right away so it looks like the file has a different name. If you hover over another tab, the file's tab usually appears.

For more information, see wiki.netbeans.org/wiki/view/FaqCliOpen

Friday Aug 17, 2007

Check Out the NetBeans Ruby Wiki

Gail has been very busy this week working on the docs pages at the NetBeans Ruby Wiki Check it out and let us know what you think. This is a community site, so if you have stuff to contribute, the instructions are there.

At the bottom of the main page is a link to Documents Under Construction. I have the honor of listing the first draft to be offered up for review, "Installing and Configuring Ruby Support in the NetBeans IDE." This is a very raw draft, as I am still in the learning and exploring phase of information gathering. I thought it would be good to get this out so we can get feedback on what kind of information you really need during your initial use of the Ruby Support Package.

A lot of the stuff we put in here was due to the suggestions you have sent us so far. I also want to give Tor, Brian, Arun and other developers a big applause for providing most of the information that I added to this draft through their blogs and their wiki contributions.

Friday Jul 20, 2007

NetBeans Ruby Docs

We are in the process of planning the documentation for NetBeans Ruby and would like to know what information you are interested in. Is there a certain tutorial that you want? Is there a video that you would like to see? Please let us know what information would help you better complete your job, and we will add it to our documentation plan wiki. Feel free to edit the wiki and add your own document requests.

Also, take a look at our two existing tutorials, Creating a Ruby Weblog in 10 Mintues and Putting Flickr on Rails, contributed by NetBeans evangelist Brian Leonard. To send comments on these tutorials, use the Send Us Your Feedback button on the bottom of the tutorial. It's been fun corresponding with the readers who have already sent feedback.

We welcome your contributions in other ways as well:

  • Contribute to the NetBeans Ruby wiki. These contributions might include tutorials, FAQs, articles, and tips and tricks. You can write a whole article, or send us the information and we will turn it into an article for you. If you are unsure where to start, an excellent source of information is the NetBeans Community Docs Page. Additionally, if you need any help or have any questions, please contact us. We work closely with James Branam, the NetBeans Community Docs Manager.

  • Write a hint. Tor Norbye just implemented the Quick Fix feature for Ruby in NetBeans and has invited the community to jump in and add their own quick fixes. Tor's written a How to Write a Hint document, which tells you everything you need to know.

  • Join the mailing lists. Of particular interest are dev@ruby.netbeans.org, used to discuss development of the Ruby features for NetBeans, and users@ruby.netbeans.org, for general support and discussions of NetBeans Ruby. To subscribe to and participate in the aliases, please visit the Mailing List page.
About

divas

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