The NetBeans Ruby IDE

Posted by Ryan Baxter Thu, 25 Oct 2007 14:26:00 GMT

Some time ago I wrote about my search for the perfect Ruby IDE. I understand that the criteria for perfect is different for everyone, but in my previous article I outlined the eleven features that best describe my perfect Ruby IDE. I will admit that I haven’t kept up with my analysis. Like everyone else, I have a lot of other things to do and evaluating a dozen IDEs takes a lot of time. Apologies aside – I have found an IDE that fits all of my expectations. My search might be over.

Roman Strobl’s recently published article, NetBeans: Ruby Developer’s New Best Friend, highlights the features and improvements of NetBeans’ efforts in the Ruby IDE arena. I’m consistently amazed by the quality of writing published by InfoQ and Strobl’s work is a fine example. I recommend reading his article and then downloading the NetBeans Ruby IDE to test drive it yourself.

NetBean’s Ruby IDE has the best code completion I’ve found in a Ruby IDE. It rivals Visual Studio on the .NET platform. The IDE is lightweight. At no point during my testing did it ever slow down. Its source control integration works well. The default font is easy on the eyes and compliments the Ruby syntax highlighting scheme. My favorite feature is the garbage collection button located in the upper right-hand corner of the application. Some developers might think the application poorly designed for needing this feature, but coming from Visual Studio, I applaud it.

The NetBean’s Ruby IDE is still in development, but the testing I’ve done hasn’t uncovered any issues worth mentioning. While working on one of my side projects I haven’t noticed any appreciable difference between the Windows and Linux versions. Have I mentioned yet that the NetBean’s Ruby IDE is free? I’ve found my new daily driver. Kudos NetBeans!

Download it here.

I Want My IDE Update

Posted by Ryan Baxter Tue, 21 Aug 2007 04:14:00 GMT

I started writing some Ruby code this past weekend for a new project that I’m involved in. Rather than download an IDE mentioned in my previous article, I Want My IDE, I decided to use the gedit text editor that comes bundled with Ubuntu Linux.

Attempting to capture the experience Mac users get from using TextMate, I installed the Class Browser, File Browser Pane, Project Manager, Snap open, and Snippets plugins from live.gnome.org. I also enabled line numbers, current line highlighting, and bracket matching. It’s not quite TextMate, but it’s not a bad choice either.

I had initially stated that my top two needs of an IDE were Subversion (SVN) integration and code completion. I didn’t have either of these with gedit, but I didn’t find myself missing them either. I’ve grown accustomed to using SVN from the command-line and ruby-doc.org didn’t slow me down too much while looking up class definitions.

Overall I’m quite pleased, but I have to admit that installing gedit plugins was a bit tricky and I never did get my fonts to look like those found in the TextMate-like Gedit tutorial.

Code Snippet: Ruby Image Scraper

Posted by Ryan Baxter Tue, 14 Aug 2007 03:46:00 GMT

I stumbled upon a screen scraping library for Ruby last week called scrAPI. It’s extremely flexible and can be seen in action on the co.mments blog post scraper. The scrAPI library can be installed by issuing the following command from your console:

gem install scrapi

Testing scrAPI was fairly easy once I figured out how to define a scraper. With that aside, I wrote a small script that saves images from a URL provided by the user. The scrAPI library could be used for good or evil, but only you can decide.

#!/usr/bin/ruby

require 'fileutils'
require 'open-uri'
require 'pathname'
require 'rubygems'
require 'scrapi'

# Get the URL input.
puts 'Enter a URL:'
url = gets.chomp

# Get the HTML source.
html = nil
open(url) {|source| html = source.read()}

# Define the scraper.
scraper = Scraper.define do
  array :images
  process "img", :images => "@src"
  result :images
end

# Scrape the HTML for images.
images = scraper.scrape(html)

# Create a directory to save the images in.
directory = url.gsub(/http:\/\//, '')
FileUtils.mkdir directory

images.each do |image_path|
  # Determine if image_path is absolute or relative. 
  path = Pathname.new(image_path)  
  if not path.relative? then image_path = url + image_path end

  # Write the image to disk.
  open(image_path) do |source|
    file_name = image_path.split('/').last
    open(directory + '/' + file_name, 'wb') {|file| file.write(source.read())}
  end
end

puts 'Finished...'

Older posts: 1 ... 4 5 6 7 8