I’ve had some fun toying with Rails views techniques. Russian translation is available.
JRuby: Unicode out-of-box
I’ve started playing with JRuby 0.9.8. I personally think that it has great potential for web development in Rails (they have 98% of rails tests passing already !).
What I was pleased to see is that (thanks to Java) unicode is working in JRuby just fine without any workarounds like String#chars :

That’s very, very good! Continuing to explore JRuby possibilities.
RSpec Generated Spec Name for "be"
I was talking about generated spec names few hours ago. Although, I’ve found that they simply don’t work properly with “be” matchers. I’ve tried to produce a quick workaround for this. That’s what I’ve created:
gem 'activesupport'
require 'active_support'
class Spec::Matchers::Be
def description
"be #{@comparison}#{@expected} #{@args.to_sentence}"
end
end
Now I can run following code:
context "Random number in 0..100 range" do
setup do
@random_number = rand(100)
end
specify do
@random_number.should be < 100
end
specify do
@random_number.should be >= 0
end
specify do
@random_number.should_not be_nil
end
specify do
@random_number.should be_between(0,100)
end
specify do
@random_number.should_not be_between(100,200)
end
end
and get this as output:
Random number in 0..100 range - should be < 100 - should be >= 0 - should not be nil - should be between 0 and 100 - should not be between 100 and 200
Update: This improvement was included into rspec trunk
New (experimental) Caches.rb
- was refactored a bit
- supports caching across rails models now