Skip to main content
  1. Categories/

Ruby

2013


A Basic Rakefile

·5 mins

I don’t like spending too much time setting up a new automated build, and rakefiles are an effective way to capture a lot of the boring repetition. Also, in the spirit of “don’t repeat yourself”, I have a rakefile that that I have been gradually building over the past few months. For my purposes, it now just requires a single edit to use in a new project.

Jekyll on Windows

·1 min

Getting Jekyll working on Windows was relatively straight forward:

  • Install ruby
  • Install the devkit
  • gem install jekyll

Then, downgrade pygments as 0.5.1 doesn’t work properly.

And that’s it.

Code Smell

·1 min

There is a type of code smell I’ve noticed in C++ code recently, but I would imagine it extends to other languages as well. Consider this class:

class Widget
{
public:
    const std::string Name() const;
    const SomeComplexObject SomeMethod() const;
};

Now consider this class

class Gadget
{
public:
    void ShowName(const Widget & widget) const { std::cout << widget.Name(); }
};

Rakefiles

·1 min

I thought I would play around with CLang 3.2 on Kubuntu, and needed a quick way to build my code without going through the 1970/80/90s pain of messing around with makefiles and all the associated tab-space nonsense. Rakefiles seemed a good fit.