- Why I need to rename stuff (again) when moving from minitest 4 to minitest 5?
- Why a 0.x upgrade of ActiveRecord forces my project to minitest 5 even though my project is on 4?
- Why Rake runs the autorunner for every thread I start within my rake task that has nothing to do with minitest?
- Why there is no "around wrapper" for every test method that is published, and if there is why did it's API had to change between 4 and 5?
- When I require "test/unit" because somethign in my project wants to have Test::Unit, is that really necessary?
- Who is responsible/maintaining the test task that is supplied in Rake?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exceptions = [] | |
tree = {} | |
ObjectSpace.each_object(Class) do |cls| | |
next unless cls.ancestors.include? Exception | |
next if exceptions.include? cls | |
next if cls.superclass == SystemCallError # avoid dumping Errno's | |
exceptions << cls | |
cls.ancestors.delete_if {|e| [Object, Kernel].include? e }.reverse.inject(tree) {|memo,cls| memo[cls] ||= {}} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using worker: worker-linux-10-1.bb.travis-ci.org:travis-linux-17 | |
system_info | |
Build system information | |
Build language: ruby | |
Build image provisioning date and time | |
Sun Dec 7 06:19:19 UTC 2014 | |
lsb_release -a | |
Distributor ID: Ubuntu | |
Description: Ubuntu 12.04 LTS | |
Release: 12.04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Will unpremultiply the currently selected Photoshop layer | |
*/ | |
var doc = app.activeDocument; | |
// Duplicate this layer | |
var premultLayer = app.activeDocument.activeLayer.duplicate(); | |
premultLayer.blendMode = BlendMode.NORMAL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
module Julik | |
module AbsolutizeHelper | |
def canonicalize_hyperlinks(htmlcontent, root, host = nil, prot = nil) | |
htmlcontent.gsub(/(<(img|a)\b[^>]*(src|href)=)(["'])(.*?)\4/) do | |
md = $~ | |
prefix = (host && prot) ? (prot + host) : '' | |
prefix.gsub!(/\/$/, '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make a little report :-) | |
added_keys = preserved.keys - ENV.keys | |
removed_keys = ENV.keys - preserved.keys | |
changed_keys = preserved.keys.select{|k| ENV.keys.include?(k) }.select{|k| preserved[k] != ENV[k] } | |
puts "Added to ENV and not removed #{added_keys.join(', ')}" if added_keys.any? | |
puts "Removed from ENV and not re-added #{removed_keys.join(', ')}" if removed_keys.any? | |
puts "Mutated in ENV and not reset #{changed_keys.join(', ')}" if changed_keys.any? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://blog.coolaj86.com/articles/how-to-control-os-x-system-volume-with-applescript/ | |
set isMuted to output muted of (get volume settings) | |
if isMuted then | |
set volume without output muted | |
else | |
set volume with output muted | |
end if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Wrapper for Rack::Deflater that will prevent | |
# the said Deflater from EVER touching .tgz files | |
class PassthroughDeflater | |
BYPASS_FILES = /\.(t?)gz$/ | |
# bypass_url_regexp will be matched against PATH_INFO | |
def initialize(app, bypass_url_regexp = BYPASS_FILES) | |
@bypass_url_regexp = bypass_url_regexp | |
@app = app | |
@deflater = Rack::Deflater.new(@app) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faraday' | |
class CertificatePinning < Faraday::Adapter::NetHttp | |
def configure_ssl(http, ssl) | |
super # configure MOAR SSL } | |
end | |
end | |
client = Faraday.new(:url => 'https://github.com') do |f| | |
f.request :url_encoded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This line makes me sad | |
Faraday::Adapter.register_middleware File.expand_path(File.dirname(__FILE__)), | |
:certificate_pinning => [:CertificatePinning, 'certificate_pinning/certificate_pinning'] | |
Faraday.new(:url => 'https://fancy-startup.io/api') do |f| | |
f.use :http_cache, store: @cache | |
f.request :url_encoded | |
f.response :logger | |