smuby
SIMPLY - MARVELLOUS - RUBY
Useful Code/Commands
IRB
irb --readline -r irb/completion
When you press Tab, Irb will attempt code completion. If there are several possible matches press Tab twice and Ruby will give you a complete list of them. This works for jirb in JRuby but with some slight differences.
JRuby/Swing
lab = JLabel.new
lab.opaque = true
lab.background = Color::CYAN
If you want to give a label a background colour, set the opaque property to true and then apply the colour.
Miscellaneous
ARGV.clear
Clears out the command line argument array.
string = <<-STRING_END
...
STRING_END
Here documents begin with << or <<- followed by a constant which is the string terminator. If the document begins with << then the terminator must be in the left-most column.