PreviousNext…

Starting with Ruby - part 5

The last four posts have been pretty lengthy, in a bid to get us going along the Ruby way. Now it’s time for something far more brief (but fun!): Ruby Kōans:

The koans walk you along the path to enlightenment in order to learn Ruby. The goal is to learn the Ruby language, syntax, structure, and some common functions and libraries. We also teach you culture. Testing is not just something we pay lip service to, but something we live. It is essential in your quest to learn and do great things in the language.

One starts on this path to enlightenment by downloading and unzipping the kōans file to an appropriate place, and then firing up one’s console, switching to the directory in which the kōans now reside, and issuing a rake command. By way of an example, this is what the first test’s output looks like:

AboutAsserts#test_assert_truth has damaged your karma.

The Master says:
  You have not yet reached enlightenment.

The answers you seek...
  Failed assertion, no message given.

Please meditate on the following code:
  /Users/YOUR_NAME/ruby/koans/about_asserts.rb:10:in `test_assert_truth'

mountains are merely mountains
your path thus far [X_________________________] 0/274

Open up the Ruby source file mentioned, find the issue (identified in the line number), fix it, and rake again, working your way through all the tests in order.

What a great idea (and yes, it’s all very zen!)

Comments

  1. Now, can you show me how to connect Ruby up to a Lotus Domino application? :-)
    I'm trying to create a mobile application for a Domino application I don't control. It's proving to be impossible. When I go to the *.nsf?login file in a browser, it prompts me for a u/p (basic auth) but none of what I'd expect to work works -- however it works fine in Lotus Notes. I tried using POST variables in a PHP app and *.nsf?opendatabase&login=1 too -- it always throws a 401 exception.Benjamin Chodroff#
  2. If you’re dealing with basic authentication, a URL like this would cut it, so it seems strange that you can’t post to the same sort of thing:

    http://example.com/example.nsf?login&username=USER&password=PWD

    This is an old article, but it may be useful—“Building PHP-based UIs for IBM Lotus Domino”:

    http://www.ibm.com/developerworks/lotus/library/domino-php/Ben Poole#

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";