Ruby IDE – Ruby development tools for Eclipse

RDT is an open source IDE for Ruby implemented as an eclipse plugin. So if you are familiar with eclipse platform, this is the best way to start Ruby development. RDT is written in Java along with some Ruby scripts to interface with Ruby code being written.

This tools is far from perfect. It features syntax highlighting, code completion and code formatting. It also provides a basic Test::Unit integration. RDT also comes with a simple regular expression tester.

RDT requires eclipse 3 or above version. You can download Ruby Development Tools here.

RubyUnit – A simple testing framework for Ruby

RubyUnit is a simple Ruby testing framework developed by Masaki Suketa. Like Junit, RubyUnit requires your test cases to extend from RUNIT::TestCase. The license under which it is release is same as that of Ruby.

You can download RubyUnit from here.

Following is a sample RubyUnit test case code,

require 'rubyunit'

class SimpleTest < RUNIT::TestCase

  def setup
    @fval1 = 2.0
    @fval2 = 3.0
  end
  
  def test_add
    result = @fval1 + @fval2
    assert(result == 6.0)
  end

  def test_divide_by_zero
    zero = 0
    result = 8 / zero
  end

  def test_equals
    assert_equal(12, 12)
    assert_equal(12, 13)
  end

  def test_match
    assert_match(/foo/, 'foobar')
    assert_match(/foo/, 'barbaz')
  end
end

3 reasons why you must learn ruby language

Ruby ProgrammingThere are dozens of programming languages out there. For a beginner, typically the first language these days are Java, C++ or C#. Each programming language has its own strengths and weaknesses. In fact, Ruby language implementation is still way behind some of the powerful Java virtual machines. But still I feel Ruby is a must learn language for a programmer. Here is why,

1. Ruby is the most elegant language – Ruby is the most elegant language I have come across.  It is also the most flexible language. You can redefine almost anything and can add to builtin classes. In fact class definitions can be extended on the fly!

2. Ruby makes you ultra productive – Ruby makes you ultra productive. There is minimum plumbing code required and you can focus on the programming problem. A beautiful feature called blocks (closure) can make your code efficient and intuitive.

3. Ruby is on the growth phase – Ruby has been out there for sometime. But lately it is getting a lot of attention mainly due to the ruby on rails Web application framework. Ruby on rails lets you build instant Web applications with minimum effort.  If you are a programmer, your next project may be on Ruby!

Ruby on Rails and Java?

Guys at the RailsEnvy.com site has created a video comparing Ruby on Rails with Java. Actually they are comparing J2EE with ROR. It seems to suggest that to develop any Web application, you need everything from Hibernate to Spring.

But reality is slightly different. None of the technologies are essential. You can create industry strength Java Web application by using Spring DAO. Hibernate is not a must for it!

I do agree that being a recent framework, Ruby on Rails is an improvement in many respects over other frameworks. At the same time it may not be that safe to use it on a heavy duty site as the twitter debacle had shown.

Anyway I am not envious of Ruby or Rails. In fact I don’t understand the friction between Ruby and other languages. My advice is this, if you feel threatened by Ruby, learn it. :-) At the same time I don’t understand why some Ruby developers are so arrogant. I guess they have no practical experience in other languages!

First post on Ruby Tips

Welcome to Ruby Tips. This Website is dedicated to the most beautiful programming language on earth – Ruby Language. Like any programming book, I will start this site by writing a “Hello World” program in Ruby.

puts "Hello World"

Can it be any simpler?

Ruby is a reflective, dynamic, object-oriented programming language. Ruby programs are intuitive, yet highly compact. Many call it as “programmer’s best friend”.