Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Middleman is a simple logging/caching proxy for Net::HTTP which can make developing against remote services easier (especially if they have API limits).
By default, it caches to a file, so the cache is persistent across multiple runs of your app.
gem sources -a http://gems.github.com sudo gem install rlivsey-middleman
require 'rubygems'
require 'twitter'
gem 'middleman'
require 'middleman'
Twitter::Search.new('bacon') # makes the request to Twitter
Twitter::Search.new('bacon') # same search, so returns from the cache
Output information to the console
Middleman.options[:verbose] = true
Change the store used for the cache, see the 'stores' section below for more information, but it's basically an object which acts like a Hash
Middleman.options[:store] = {}
Change where verbose output is sent, by default it's STDOUT
Middleman.options[:logger] = Logger.new('middleman.log')
By default Middleman uses Middleman::Store::File to cache the requests to files in a directory. The file names are MD5 hashes of the request details.
The interface to Middleman::Store::File is basically a Hash, so any object which responds to [], []= and is enumerable can be used as a store.
Using a Hash for the store will work fine, but will not persist across runs of your application.
At the moment this only works against Net::HTTP. I've got plans to make it easier to extend and add the ability to work with other libraries such as Curb etc...
Feel free to fork and send in patches.
FAQs
Unknown package
We found that shadow11-middleman demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.