Skip to content

Instantly share code, notes, and snippets.

@i0rek
Created Feb 13, 2013
Embed
What would you like to do?
require "rubygems"
require "bundler/setup"
require 'typhoeus'
class Cache
attr_reader :memory
def initialize
@memory = {}
end
def get(request)
memory[request]
end
def set(request, response)
memory[request] = response
end
end
c = Cache.new
Typhoeus::Config.cache = c
puts Typhoeus.get("127.0.0.1:3001").inspect
puts Typhoeus.get("127.0.0.1:3001/wp-content/plugins").inspect
source "http://rubygems.org"
gem 'typhoeus', :git => "https://github.com/typhoeus/typhoeus.git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment