Posts Tagged “ruby”
2017-07-03 Authoring a Private Gem with Gemfury
RubyGems are a great way to share code, but not all code is for the general public. This article illustrates a (semi-automatic) way and some workflow self-discipline to streamline private Gem authoring using the Gem hosting solution »Gemfury«.
Loading insecure images from within an HTTPS page causes mixed-content warnings. camo is a secure image proxy that lets you get around that. This article explains how to tie camo into your Redcarpet and html-pipeline markdown parsing to rewrite your img tags.
An old gem that's been lying around untouched since 2010 got some refactoring love. Moving away from brutally monkey patching a core class, I used this case as an academic example to illustrate how to test refinements using Test::Unit, MiniTest::Spec and RSpec.
2016-03-11 Including a Module. With Parameters!
The Ruby include statement only allows for one type of argument: the module constant(s) to include. I've found myself in a situation where I wished I could make the include statement more dynamic, like passing extra arguments that influence the module to be included. This article describes how to use a module factory to achieve exactly that.
2013-10-06 Learning Ruby with Tests (Part 2)
The second part expands on the code created in round 1 and fleshes out the existing Vehicle class. It introduces a new test helper, instance variables, explains predicates and the overrides Vehicle's initialize method.