TextMate

After my less than wonderful experience with the Eclipse Ruby implementation (and don’t get me wrong, I LOVE Eclipse for Java development, and also learned a lot about how to configure it for other types of languages in this process), I did some research, and it appears that one of the most used IDE environments for RUby is TextMate. ¬†TextMate is not free, though there is a 30 day free trial period. ¬†It appears to be quite fully featured, and so I will be experimenting with it to see if it lives up to its promise.

Documentation is here.

Posted in Uncategorized | Tagged , , | Leave a comment

Installing an Eclipse with Ruby Plug in

Decided to attempt to get Ruby working in an Eclipse environment.  I am using as my tutorial an article from Digerati and Technology Reports (April 17 2011) by Mike Hubbartt and can be found here.

Note this tutorial is only to get Ruby up and running.  My computer already has Ruby up and running.  I selected Eclipse Classic version 4.2.0.  This is a different build from what I normally use which is the Java IDE environment.

Step 2.2:  I needed to add a couple of additional review pages to what was suggested here: mostly to accept the terms of the license agreement.  However, once doing this, it seemed to load.  Once loaded I was prompted to do a restart.

Upon going through the steps, the code snippet was not sufficient in that Mike generated the class object to run, but never instantiated it.  The final comment from RubyFan provided the example code.

One thing that I did not like about this particular installation is that every time I try to run, I am prompted as to whether I want to run Ruby Script or Ruby Test.  This takes a couple of mouse clicks to engage and so is a big productivity suck.

In addition, the Ruby Test does not function:¬†“Testing Engine not configured for this launch configuration”. ¬†I did some research and it seems that for this particular installation, I am supposed to do a debug configuration and select Test::Unit as the Ruby Testing Engine. ¬†However, Eclipse reports “this module does not look like Test:: Unit test.

 

 

Posted in Uncategorized | Tagged , , | Leave a comment

Eclipse

Ruby on Rails provides plugin support for project development in Eclipse. ¬†Here is a link to how to do this (O’Reilly Media, note this is 2007: will find more recent info).

Here you can download an Eclipse Distribution (updated 2009)

Posted in Uncategorized | Tagged , , | Leave a comment

Getting Started

This is a great place to start once you have downloaded the Bitnami stack.  With that in place, all the resources are in place to go through this tutorial.

 

1. Guide Assumptions: Provides some basic resources for Ruby, and what other components are required to run the Rails environment (these are all taken care of with the Bitnami RubyStack).

2. describes Rails and the Rails philosophy, defines the MVC design pattern architecture upon which the Rails philosophy is based, and lists the components of Rails.

3. Creating a New Rails Project: Installation (RubyStack has taken care of this), quick tests to make sure installation is in place.  This then goes through the process of building a Blog application, which includes configuring a database.

4. Hello Rails! Starting up the Web Server and setting the application home page.

5. Scaffolding: Scaffolding allows rails to generate major pieces of an application with very few commands.

6. Creating Resource: Using the rails <generate> command to create all the MVC components required for the Post object.  Migration generates the required tables in your database. Linking to a page.  Investigating the files created by the generate command.  Editing these files to add validation to input. Using the Console to execute Ruby commands within the application context.  Listing. Customizing Layout (changing background color, but that counts!). Creating new posts. Showing a single post. Editing Posts. Destroying Posts.   Note that all these actions were created with only a single generate scaffolding command in rails!

7. Adding a Second Model: This adds the Comment Class, and this time, instead of using Scaffolding, each MVC component is generated individually, and the files required also either created or edited.  This requires a bit more typing and careful grammar checking, but is useful to see what is required in order to get get the different components communicating.  This is where I started to get (only a bit of) a glimmer of the Rails Framework structure.

8. Refactoring: Making partials to clean up the code.  Partials are code snippets that can be used again and again and are similar to PHP include structures.  Partials can be used in collections, forms, and probably other stuff that this tutorial does not go into.

9. Deleting: Some cleanup and thought is always required when dealing with memory management issues.  Whereas the deletion action is easily generated, the programmer needs to be aware of the dependencies and think through the implications of any deletion.

10. Security:  A really simple authentication protocol that can be used to protect certain actions from being done by anyone.  Looks at the syntax as well as Ruby logical operations (:only, :except)

11. Multi-Model Form: Adding Tags to the blog structure.

12. View Helpers:  small snippets of reusable code for views.  This creates a module within the posts_helper.rb file that allows a bunch of tags to be strung together in a comma separated string.

13. What’s Next? ¬†Moving on to guides and tutorials.

14 Configuration gotchas: Watch out for non-UTF-8 datastructures in your database and text editor.

By the end of this tutorial, I had a bare bones blog up and running with individual posts, comments for posts, tags for each post, and the ability to edit or remove Posts or parts thereof.  I still have quite a ways to go in order to gain a strong understanding of how each component is actually connected, but I do have a better idea of what Rails is, how it works, and the potential that it provides.  Yay!

 

Posted in Tutorial | Leave a comment

Macs need XCode

Jumping ahead a touch (some of this posting is retroactive), it is important that if you want to work in this environment on a Mac that you make sure that XCode is installed. ¬†XCode travels with mac installation disks, but lives in the “Optional Installs” in the install DVD.

Posted in Uncategorized | Tagged , | Leave a comment

Download the Stack

Ruby on Rails can be downloaded as a self contained stack from Bitnami.

These are self contained frameworks that contain the complete environment required to work in the Ruby Environment.  I selected Installer for Mac x86.

Posted in Uncategorized | Tagged , | Leave a comment