We have used Thinking-Sphinx in several projects to implement search engines. Thinking-Sphinx is a wrapper in Ruby to use ActiveRecord with Sphinx. But in the project I’m working right now I had to solve a different problem: the user should be able to search for formatted values, however without using the formatting characters, i.e, suppose [...]
Code blocks with optional arguments in Ruby 1.8.x
Ruby 1.9 has some cool new features. One of them is the ability to define default values for the arguments passed to code blocks, like in the following example: pow = proc { |a, b = 2| a**b } pow.call 3, 3 # 27 pow.call 3 # 9 This is very useful, for instance, when [...]

