Tag Archives: ruby

[mongoid] doing a group-by on date

Doing a simple group-by query using mongo and mongoid is actually pretty straightforward. According to the documentation, mongoid does not offer any group/aggregation function itself, but mongo does. And you can directly access the mongo using the collection. So assume we have a mongo collection: and now I want to count all occurrences of the […]

Porting an existing rails 2 site to rails 3

I have created a few rails 3 sites, but i have never before ported an existing rails2 application to rails3. I will describe the problems i encountered. First off there were some very good resources (step-by-step descriptions) to guide me through it: the rails_upgrade plugin The asciicast (readable) upgrading to rails3 part 1 and part […]

Arrrrcamp 29/10/2010

The fourth and most international of all arrrrcamp editions. Also the first paying edition. As i said in my post about the previous edition, i have been to all editions, and it is awesome to see how it has grown. The schedule was amazing, with an amazing array of international speakers, of which for me […]

rails 2 and 3 simultaneously: gemsets to the rescue

I am developing several rails projects. Some are still rails 2.3.9, and some are rails3. But using those at the same time, on the same machine can cause some trouble. I use bundles for all my projects, so the gem dependencies are managed. But still, somehow, when running my tests, i get into trouble. If […]

awesome rspec hints and tips

Read “Pure Rspec”, a great slideshow by Jon “Lark” Larkowski. It contains some really cool rspec tips and hints, how to write your tests more readable and compact.

creating a new gem

I found a few articles that describe easier ways to create a gem. From the entire list of available tools, i want to highlight two: jeweler and (Mr.) bones. Mr. bones seems a very configurable route to take: it allows you to define your own skeletons (application templates) or use those of others, e.g. bort. […]

installing ubuntu for ruby development

I have made the complete switch. My home development machine is no longer Windows XP, no longer dual booting Ubuntu but a full-fledged Ubuntu. After installing the dual-boot, and my machine at work this is the third time to install an ubuntu machine, and getting everything ready for ruby development. I just want to archive […]

use %q to create strings

In my gemspec created by jeweler I saw string creating using %Q. What? I found a page describing ruby string creation, and it seems %Q is the equivalent of double quote delimited strings and %q is the equivalent of single quotes. While i was pondering what the advantage could be of writing it that way, […]

script/plugin install from git fails

I am using ruby 1.8.7 on windows (mingw32), and all of a sudden i cannot run the suggested variations also don’t work, e.g. all give the same error. But, apparently, it has something to do with the mingw32 platform. In C:\Ruby\lib\ruby\gems\1.8\gems\activesupport-2.3.5\lib\active_support\core_ext\kernel\reporting.rb the following line can be found in function silence_stream: Replace that with the correct […]

Arrrrcamp

Went to arrrrcamp last friday (Arrrr as in Ruby, Rails, Radiant and, of course, Rhum!). It was the third edition of this unique ruby-on-rails event, and the third time i visited it ;) So i am a regular :) The first year i was just starting ruby and my then-collegue and me learned a lot. […]