Read more

Alternative for Ruby singletons

Thomas Klemm
August 12, 2014Software engineer
require 'net/http'

module Cheat
  extend self # the magic ingredient

  def host
    @host ||= 'http://cheat.errtheblog.com/'
  end

  def http
    @http ||= Net::HTTP.start(URI.parse(host).host)
  end

  def sheet(name)
    http.get("/s/#{name}").body
  end
end

# use it
Cheat.sheet 'migrations'
Cheat.sheet 'singletons'
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot
Posted by Thomas Klemm to makandra dev (2014-08-12 19:37)