Friday, October 9, 2009

Learning Ruby has always been refreshingly easy.
But thanks to ruby koans, this has been made more easier.
See :
Recommended for intermediate Rubists (people like me, who adore this gem of a language!), this is a fun filled and agile way of learning ruby concepts via unit testing.
Just unpack the distribution and view the README.rdoc file for more information.

Here, simply pass the unit tests and you will gain 'enlightment' as you move along. It's just like a textbook in action, or rather, an activity based learning. Currently I am playing it as a game and hopefully I'll finish it

example of my ruby koans

sumit@darkstar004:~/Desktop/edgecase-ruby_koans$ rake
(in /home/sumit/Desktop/edgecase-ruby_koans)
/usr/bin/ruby1.8 path_to_enlightenment.rb
/usr/lib/ruby/1.8/rake.rb:905: warning: Insecure world writable dir /home/sumit/ant/bin in PATH, mode 040777

Thinking AboutAsserts
test_assert_truth has expanded your awareness.
test_assert_with_message has expanded your awareness.
test_assert_equality has expanded your awareness.
test_a_better_way_of_asserting_equality has expanded your awareness.
test_fill_in_values has expanded your awareness.

Thinking AboutNil
test_nil_is_an_object has expanded your awareness.

test_calling_methods_in_other_objects_require_explicit_receiver has expanded your awareness.
test_calling_private_methods_in_other_objects has expanded your awareness.

Thinking AboutControlStatements
test_if_then_else_statements has damaged your karma.

You have not yet reached enlightenment ...
<"FILL ME IN"> expected but was

Please meditate on the following code:
./about_control_statements.rb:19:in `test_if_then_else_statements'

learn the rules so you know how to break them properly

Note: the stack trace of my passed tests would increase, but then, who is complaining?
Just at the last line, is a random quote, which adds to the mystry factor of the whole setup.
For more info. about this, do write in here !

adiĆ³s for now

No comments: