When you use heredoc, string interpolation is enabled by default: x = "Universe" <<-MESSAGE Hello #{x} MESSAGE # => "Hello Universe"
In Ruby 1.9, instance_eval calls the block the with receiver as the first argument: In Ruby 1.8, receiver.instance_eval...
MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...
Ruby 1.9 changed the default behavior of Module.const_defined? from what it was in Ruby 1.8 -- this can be especially...
This error can happen in Ruby 1.9. To fix it, add the following line to the top of your .js.erb...
Rails 2.3.16+ on Ruby 1.9 causes warnings like this: .../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string...
So you have a method returning a regular expression but one case that should not yield a matching Regexp object...
Stringex is a gem that offers some extensions to Ruby's String class. Ruby 1.9 compatible, and knows its way...
UnicodeUtils implements Unicode algorithms for case conversion, normalization, text segmentation and more in pure Ruby code.
RVM needs to be updated regularly to know of Ruby versions released since installation (or last update).
TLDR: Ruby class variables (@@foo) are dangerous in many ways. You should avoid them at all cost. See bottom of...
This works well in the simplified case, when your link disappears after it was clicked. Let link_to_remote behave...
Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...
January has been a very bad month for Ruby on Rails developers, with two high-severity security bugs permitting remote...
If you worked with a system Ruby before switching to RVM, this system Ruby will be in your way when...
If you use Tempfile and pass your own filename containing an extension, it will just be consumed by the Tempfile...
Use Socket.gethostname. So for a machine whose hostname is "happycat", it will look like this: >> Socket.gethostname => "happycat" That should work...
While you are probably using will_paginate to paginate ActiveRecord scopes, it can actually paginate plain Ruby arrays. The resulting...
With the impending release of Ruby on Rails 4, it looks like a lot of developers will be updating their...
I’ve worked on huge applications in Ruby and Rails before. I very much want to believe in DCI, but...
You can define methods in any example group using Ruby's def keyword or define_method method: describe "example" do...
If you ever wondered why a constant wasn't defined or wasn't available where you expected it to be...
Great solution in a GitHub issue.
So you are debugging like a boss and lost track of where you actually are in your code? No problem...