Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/usr/bin/env ruby | |
# vim: set syntax=ruby | |
# Ensures that changes to the Rails schema.rb file may only be committed if a | |
# migration file is also committed at the same time. | |
def schema_modified? | |
%x[ git diff --cached |grep schema.rb ] == '' | |
end |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
#!/bin/bash | |
# Create the directory structure | |
mkdir -p features/step_definitions | |
mkdir -p features/support | |
# Create a placeholder for the step_definitions folder | |
touch features/step_definitions/"$(basename `pwd`)_steps.rb" | |
# Create the environment file |
class Organization | |
def to_param | |
"42" | |
end | |
def saved? | |
rand > 0.5 | |
end | |
end | |
class TasksController < ApplicationController | |
def complete | |
# add responder as listener, or could subscribe etc... | |
# task could be the actual task, or pass through the ID | |
task.add_subscriber(TaskCompletedResponse.new(self)) | |
task.add_subscriber(TaskEmail.new) | |
task.add_subscriber(TaskIndex) | |
task.complete_by(person) | |
end |
MIT License | |
Copyright (c) 2018 Oleg Yamnikov | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
output = `cat #{ENV["CIRCLE_ARTIFACTS"] || "."}/coverage/index.html | grep Changed -A 2 | grep "[0-9\.]*%"` | |
percentage_match = output.match(/([0-9\.]+)%/) | |
raise "Unable to determine test coverage change" unless percentage_match | |
RED = "\033[0;31m" | |
BOLD = "\033[1m" | |
NO_COLOR = "\033[0m" | |
percentage = percentage_match[0].to_f |