Skip to content

Instantly share code, notes, and snippets.

# Simple example of using ShadowFacter with RSpec to verify system configuration
# http://twitter.com/bradleyktaylor | http://railsmachine.com
#
# run with 'spec -c installed_test.rb'
require 'shadow_facter'
def installed_fact(n)
name = n
fact(name) { exec("#{name.to_s} --version") ? true : false }
# Bradley Taylor - railsmachine.com
# Collect Cucumber metrics for a given path and send them to Dash.
module Dash::Sensor::Plugins
class Cucumber
include SensorPlugin
register :cucumber, :url => 'http://dash.fiveruns.com' do |recipe|
recipe.absolute :scenarios do
stats[:scenarios]
@wrecked
wrecked / gist:72537
Created March 2, 2009 00:04
dash_steps.rb
# Step definitions for testing metrics from Dash - http://dash.fiveruns.com
#
# bradley - railsmachine.com
# add your key
APPKEY = "YOUR_KEY_HERE"
When /^I check the "(.*)" metric$/ do |metric|
visit "https://dash.fiveruns.com/apps/#{APPKEY}/metrics/#{metric}.txt"
end
Feature: Sustained productivity testing
In order to ensure programmer sustained productivity
As a mean, insensitive boss
I want to test development progress
Scenario: failed steps
Given no one wrote crappy code
When I check the "failed" metric
Then the value should equal 0
@wrecked
wrecked / riak_csv_etl.erl
Created February 10, 2011 23:28
csv_loader: loader for csv files into Riak
%% -------------------------------------------------------------------
%%
%% riak_csv_etl: etl tools for csv files in Riak
%%
%% Copyright (c) 2011 Bradley Taylor. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at