ruby

TwitterFacebook
Get flash to fully experience Pearltrees
http://en.wikibooks.org/wiki/Ruby_Programming/Unit_testing

Ruby Programming/Unit testing - Wikibooks, collection of open-content textbooks

Unit testing is a great way to catch errors early in the development process, if you dedicate time to writing appropriate and useful tests. As in other languages, Ruby provides a framework in its standard library for setting up, organizing, and running tests called Test::Unit. # File: simpleNumber.rb class SimpleNumber def initialize ( num ) raise unless num. is_a ? ( Numeric ) @x = num end def add ( y ) @x + y end def multiply ( y ) @x * y end end

Ruby Best Practices - Reading Ruby's Standard Library for Fun and Profit

Note: This post is inspired by JEG2’s excellent code reading talk at MWRC 2009, called LittleBIGRuby Go watch it if you have time, then come back and read this. You might also want to check out the Question 5 Ways interview at Pat Eyler’s “On Ruby” blog for more code reading goodness. We all need to hunt bugs and we all need to integrate our code with other systems. http://blog.rubybestpractices.com/posts/gregory/005-code-reading-stdlib.html
http://bogojoker.com/readline/

Ruby Readline

The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. (…) The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands. Users that have worked with the shell are very familiar with readline. This is the library that provides ⌃A , ⌃E , ↑ , ↓ , and a number of other keyboard shortcuts that you probably expect to have when working in a shell. Ruby ships with support for working with readline (or libedit). You just need to include the Readline module: It takes just a few lines of Ruby to get the basic functionality and the core advantages that Readline provides such as keyboard shortcuts and history.
Make sure to add Gemfile.lock to your repository. This will ensure that other developers on your app, as well as your deployment environment, use exactly the same third-party code as you just installed. In some cases, running executables without bundle exec may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle. However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine.

Bundler: The best way to manage Ruby applications

http://gembundler.com/

Katz Got Your Tongue?

This impression, which I admittedly shared in my early days as a Ruby/JavaScript developer, misses an important subtlety that turns out to have large implications. This subtlety is often referred to as “Tennent’s Correspondence Principle”. In short, Tennent’s Correspondence Principle says: “For a given expression expr , lambda expr should be equivalent.” http://yehudakatz.com/

Ruby Programming Language

http://www.ruby-lang.org/en/ The Award for the Advancement of Free Software is given annually to an individual who has made a great contribution to the progress and development of free software, through activities that accord with the spirit of free software. This year, it was given to Yukihiro Matsumoto (aka Matz), the creator of the Ruby programming language. Matz has worked on GNU, Ruby, and other free software for over 20 years…