Skip to content

Instantly share code, notes, and snippets.

@stevenjackson
stevenjackson / functional_query.rb
Last active October 9, 2016 02:12 — forked from searls/market_research.rb
Was chatting with @mfeathers about retaining Ruby's chained Enumerable style, but finding a way to inject names that reflects the application domain (as opposed to just littering functional operations everywhere, which may be seen as a sort of Primitive Obsession)
module FunctionalQuery
def initialize(collection)
@collection = collection
end
def result
@collection
end
def average_by_attr(attr)
@stevenjackson
stevenjackson / gist:4225614
Created December 6, 2012 16:06 — forked from joelbyler/gist:4225565
Cucumber Rerun Rake Task
require 'cucumber/rake/task'
def run_rake_task(name)
begin
Rake::Task[name].invoke
rescue Exception => e
return false
end
true
end