Like Celluloid? Join the Google Group
Like Celluloid? Join the Google Group
foo bar baz monkeys
# Some of the tests for this fail, in a way that's surprising to Python users... | |
# Why? | |
class List | |
def initialize(*elements) | |
@elements = elements | |
@elements.each do |e| | |
return if e.nil? | |
end | |
end |
Like Celluloid? Join the Google Group
Like Celluloid? Join the Google Group
foo bar baz monkeys
def recursive_ostruct(object) | |
case object | |
when Hash | |
hash = {}; object.each{|k,v| hash[k] = recursive_ostruct(v)} | |
OpenStruct.new(hash) | |
when Array | |
object.map {|e| recursive_ostruct(e) } | |
else | |
object | |
end |
require 'bitcoin' | |
def hex_string_to_bytes(string) | |
[string].pack("H*") | |
end | |
def bytes_to_hex_string(bytes) | |
bytes.unpack("H*").first | |
end |
[ | |
"true unless nil.nil?", | |
"true if nil != nil", | |
"true if !!nil", | |
"true unless nil" | |
].each do |source| | |
puts "=====" | |
puts source | |
puts |
def header_rows(labeller = Labeller.new) | |
# This won't handle mismatched sizes yet | |
# Also hack the null case for now | |
number_of_rows = @fragments.map(&:number_of_dimensions).max || 0 | |
bottom_up_header_rows = [ ] | |
number_of_rows.times do |row_index| | |
current_row = bottom_up_header_rows[row_index] = [ ] |
require 'json' | |
module Harvest | |
module HTTP | |
module Server | |
module Resources | |
class FishermanRegistrarServerResource < Resource | |
def trace? | |
true | |
end |
#!/usr/bin/env ruby | |
window do | |
setup do | |
unless ENV['HARVEST_PATH'] | |
puts "You must set the HARVEST_PATH environment variable to your local harvest repo path" | |
end | |
end | |
before do |
RSpec::Matchers.define :have_uncommitted_events do |*expected_events| | |
match do |aggregate_root| | |
expected_events.all? { |expected_event| | |
aggregate_root.uncommitted_events.detect { |event| | |
event.matches?(expected_event) | |
} | |
} | |
end | |
end |
╭─ashmoran – MBP-404:groundwork – git:(bf3aadb)✔ – ‹2.0.0-p195› – 0 | |
╰─% npm install --dev | |
npm http GET https://registry.npmjs.org/grunt-contrib-watch | |
npm http GET https://registry.npmjs.org/grunt-contrib-concat | |
npm http GET https://registry.npmjs.org/grunt-contrib-sass | |
npm http GET https://registry.npmjs.org/grunt-contrib-jade | |
npm http GET https://registry.npmjs.org/grunt | |
npm http GET https://registry.npmjs.org/grunt-contrib-coffee | |
npm http GET https://registry.npmjs.org/grunt-contrib-compass | |
npm http 304 https://registry.npmjs.org/grunt-contrib-sass |