The Caboteria / Tech Web / TechNotes > ProgrammingNotes / RubyNotes (27 Nov 2015, TobyCabot)
Citrus is a fun parser generator for Ruby. It lets you mix small bits of Ruby code in with your parser grammar.

Invoking a method with an ampersand-parameter:

Github's style guide: - metaprogramming basics - object model intro


RVM is a nice tool that manages multiple installations of Ruby, JRuby, gems, etc. It's very useful if you're working on both Ruby and JRuby projects.
Since RVM compiles each version of ruby locally you need to make sure that you've installed the -dev packages for the features that you want. Readline, for example: libreadline-dev on debian.

When you install RVM, run rvm requirements and install everything it recommends. You'll probably also need libpq-dev (postgresql) and libcurl-dev (curl).

Debian - when I used RVM on Debian for the first time, I had to use RVM to install copies of zlib and openssl in RVM's tree. For some reason configure couldn't see the Debian's versions.

Debugging - ruby debugger user's guide - ruby debugger project page

You want to run Debugger.start as soon as you can (preferably at the top level) so the debugger can capture the full stack frame.

Tips on debugging memory leaks:

Rails Development - this is the "official" Rails bug tracking system. The Rails "trac" and "lighthouse" sites appear to be obsolete although they have powerful Google-fu

Run a single unit test:

$ ruby -I"lib:test" test/test_filename.rb -n test_launch_should_create_a_response_set
The "test_" prefix and underscores need to be added, so this invocation would match a method named "launch should create a response set".


Security - 13 Security Gotchas You Should Know About


I prefer minitest to rspec. is a good explanation of the relative complexity of the two packages.

Edit | Attach | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | Raw edit | More topic actions
Copyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback