Wednesday, July 27, 2005

Rails on Eclipse 3.1

I decided to create a review of the steps and setup I am currently utilizing to develop rails applications on Eclipse 3.1. There has been some discussion about the development of a full Rails implementation plugin on Eclipse, but for now, here is a basic setup to get things going.

Step 1 - Download and install the latest Eclipse IDE (3.1)

Step 2 - Download and install Rails on your machine

Rather than reproducing this portion of the setup, I would recommend following any of the well documented tutorials on this page.


Step 3 - Install the Ruby Development Tools Plugin for Eclipse

This is a plugin for developing in Ruby. It includes a Ruby Editor, Test::Unit Integration, Inherited Eclipse Features, Outline Views, Debugger, and Regular Expressions. It is full featured.

In Eclipse:
# Choose Help->Software Updates->Find and Install
# In the dialog choose "Search for new features to install" and push next
# Select "Add Update Site", enter an arbitrary name and the url http://rubyeclipse.sourceforge.net/nightlyBuild/updateSite/ (I recommend the Nightly Build since it has better support for Eclipse 3.1)
# Check RDT and push next
# Select the feature org.rubypeople.rdt and push next. RDT will be installed and be available after restart.


Be sure to configure the RDT Plugin in Eclipse after reboot (select Windows > Prefrences > Ruby (most importantly tell Eclipse where your local ruby installation lies - "Installed Interpreters" - Interpreter Name "Ruby 1.8.2" - Location "/usr/local/bin") and modify other settings as desired


Step 4 - Create a new Ruby Project in Eclipse (File > New > Other : Ruby > Ruby Project) with project name "Blog" (for this tutorial)
# make sure you are in the RDT perspective (Windows > Open Perspective > Other: Ruby)


Step 5
- Create a new Rails project from a command prompt (terminal window)

From the command line:
d'andrew% rails Blog


Step 6
- Import the newly created Rails Blog files/directory structure into your Eclipse Blog Project

From within Eclipse:
# right-mouse click on your Blog Project
# Select Import > File System
# Browse to your newly created Rails Blog folder and choose this folder
# Check the box next to the Blog Folder
# Under "Options" make sure "Create selected folder only" is checked (should be by default)
# Click finish


Step 7 - Run scripts from command line

Make sure that you are running the scripts from your eclipse workspace directory (when we imported the Rails Blog directory structure, eclipse copied it to your defined workspace)

From the command line ($PROJECT_ROOT):
d'andrew% ./script/server generate controller Blog


Step 8 - Refresh your Eclipse project (F5 for shortcut)

Step 9 and the rest
- Happy coding

Essentially the rest of it is composed of running scripts from the command line (although I am trying to figure out how to do this from within Eclipse) and refreshing your Eclipse project each time, then editing the files you need to.

Some other tricks/helps:
# To show all files in your Eclipse folder (ruby files are only shown by default in RDT plugin)
In the "Ruby Resources" box, there is a little down arrow at the far right. Click on this and un-click the "Show Ruby files only" option.
# Other plugins that are nice to have
CssEditor - for editing css files
XmlBuddy for editing XHTML files, etc.
JavaScript Editor Plugin


Naturally this is just a basic hack. If anyone has any good ideas I am anxious to hear them. And for the brave soul who wants to create the ultimate Rails plugin -- Happy Hacking!!!

Thursday, July 21, 2005

Ruby On Rails

Well, I did it. Finally. I decided to take a close, hard look at Ruby on Rails.

I have to say, WOW! I'm not really sure how to feel about it all, but I can certainly say that I am initially impressed. Here is my synopsis so far, from a complete newbie and hardly-quasi-programmer skill level.

The ability for Ruby On Rails(RoR) to quickly get the developer up and running is quite refreshing. After spending years on a number of different platforms I can honestly say the RoR has been the only experience that has taken me from A to Z in one sitting. And thanks to an excellent demo video, it was easy to follow.

Everything just worked. And without any major configurations I was up and running with a basic CRUD (Create-Retrieve-Update-Delete) web application. RoR easily mapped my database and created the basic scaffolding (web-user-interface) for the elements in the database.

Templating and the UI were easily configured and modified. Error handling and "flash" prompting (alerting users that an action completed successfully) were easily implemented.

Another nice feature is the zero deploy time. That is, the moment you edit and save a file/template/config in the code base, you can refresh your webapp page and it will immediately update (unless you played around with the database config, in which case you will need to restart the ruby server). No more endless restarting of servers and waiting for pages to compile (e.g. J2EE). This feature alone saves countless hours of downtime (and configuration of IDE's like Eclipse for Tomcat).

I don't know what to say yet because I'm still just amazed that it worked the first time. Seriously! I have been putzing around with JSF/Struts/J2EE/etc for over a year now and STILL HAVE NOT FIGURED IT OUT or easily made it work. At least RoR has focused on the real people -- THE PROGRAMMERS!! *cough* JSF *cough* Yes...there don't appear to be any cool GUI tools/IDE's for it yet, but dang...it works without building 20 different files.

With RoR it just made sense to me. Then again, I'm not a programmer extraordinaire. I just want to spend my time on the UI and the database. NOTHING ELSE!!!!

I still don't know if I'll switch over, but I have to say that it is unfortunately compelling. There are alot of things left unseen for me, like the following:

1. Will there be a strong and loyal community?
2. Will the enterprise world pick it up?
3. How scalable is it?
4. Since I am not as familiar with the Ruby community, how sensible is their roadmapping and (reverse) compatibility? Will they break everything I've worked on the moment I want to upgrade?
5. How capable is their i18n? And other features? Testing Framework?

Other than that, great job RoR guys/gals!

Saturday, July 09, 2005

My Book List

After being asked by a number of people I decided that I would put together a running list of books that I feel have been the most important to me.

So here's the list by subject:

My Blog List:
1. Go to My Public Blog List

Business/Entrepreneurship:
1. Rich Dad/Poor Dad (The series) - For a mind-set altercation.
2. The Entrepreneur's Guide to Business Law - Good introduction to law basics.
3. Harvard Business Review on Mergers and Acquisitions - One of the best intro's to the M&A process
4. The Art of M&A Due Diligence - Great introduction to the fine art of due diligence
5. The Wealth of Nations - America's economic foundations
6. Good to Great - some of the best advice for focus and stability in business.
7. Leading Beyond the Walls - virtual collaboration

Personal Growth
1. Emily Post: Etiquette - Common guys...just do it...there's no excuse for offending people. (the same goes for women). You can either be one of the guys/gals, or you can be respected and placed in positions of honor and leadership -- your choice. And a quick note - if you are in the public sector -- then there is NO SUCH THING as private.
2. Dress Smart Men: Wardrobes that win in the new workplace - Great overview of wardrobe basics

Politics/Globalization/Issues
1. The Lexus and The Olive Tree - Globalization and economics
2. Race Matters - Possibly one of the best books on race/discrimination issues
3. Does America Need a Foreign Policy? - Best introduction to the current state of affairs and issues in global American policy
4. Exlusion & Embrace - A Theological Exploration of Identity, Otherness, and Reconciliation (with a focus on the Balcans (Croatia, Servia, Bosnia, etc)

Theology:
1. Francis A. Schaeffer Trilogy: The Three Essential - Great review of current philisophical environment of contemporary christianity.
2. Know Why You Believe - Evidentiary apologetics - and yes, regardless of whether or not you agree with the testimony recorded in the letters contained in the Christian Bible, please...just be honest historically and acknowledge that the authors of the letters actually believed what they were writing. If you believe that they were insane, then at least I will respect your honesty.
3. The Way: What Every Protestant Should Know about the Orthodox Church
4. Modern Theologians: An Introduction to Christian Theology in the Twentieth Century
5. The Christian Bible (I prefer the NASB - more literal translation from the Greek/Hebrew/Aramaic)