Ruby Koans

  1. Make sure you have installed the appropriate version of Ruby.

  2. Download rubykoans.zip.

    Use the link above. Do not download the public Ruby Koans off the internet! I’ve chosen a special subset, in a special order, for this class. (Also, I had to fix a few of them to work in Ruby 3.)

  3. Uncompress the zip file, then open a command line in the expanded koans/ directory.

    Make sure you actually cd into koans! It will not work if you are in the wrong directory.

    Contact me for help if you need tips on using the command line.

  4. Run the rake command.

    If you get an error that rake is not found, try gem install rake and then try rake again.

  5. If it is working, you should get an error about how “AboutAsserts#test_assert_truth is an obstacle on your path to awareness.”

    Read the details underneath. They tell you to look at a specific line in a specific file. Edit that file.

    You can use any text editor you like: VS Code, Sublime Text, vim, whatever. You do not need to download a Ruby-specific IDE! (I don’t use one even for full-size Ruby projects; it’s certainly not worth it for the small assignments you’ll do in class.)

  6. Change what you need to change to make the test pass, then run rake again to see if you got it. If you did, move on to the next exercise.

  7. Now that you’re in the flow, look at the path_to_enlightenment.rb file. I’ve divided the koans into “For day one,” “For day two,” and “Extra ones” that you don’t necessarily need for this class.

    Note that day two and extras are commented out. You will need to uncomment those when it is time to work on them.

    Please try to make it through the For day one portion soon, and try to complete For day two by Friday. The extras are only if you are curious and want to explore more.

Learn what you can, but your main goal here is not to remember every tiny detail. Rather, your goal is to get your brain used to and comfortable with looking at Ruby. Have fun!