This file contains 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
module Heuristics | |
TARGET_PRIORITY = { | |
RubyWarrior::Units::Archer => 1, | |
RubyWarrior::Units::Wizard => 2, | |
RubyWarrior::Units::ThickSludge => 3, | |
RubyWarrior::Units::Sludge => 4, | |
RubyWarrior::Units::Captive => 999, | |
RubyWarrior::Units::Warrior => 999, | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Jasmine Spec Runner</title> | |
<link rel="shortcut icon" type="image/png" href="jasmine-1.3.1/jasmine_favicon.png"> | |
<link rel="stylesheet" type="text/css" href="jasmine-1.3.1/jasmine.css"> | |
<script type="text/javascript" src="jasmine-1.3.1/jasmine.js"></script> | |
<script type="text/javascript" src="jasmine-1.3.1/jasmine-html.js"></script> |
This file contains 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
private | |
- def method_missing(method, *args) | |
- if method.to_s =~ /^create_(.+)$/ | |
- send("new_#{$1}", *args).tap(&:save!) | |
- else | |
- super | |
- end | |
+ def self.included(base) | |
+ ObjectCreationMethods.public_instance_methods(false).each do |new_method_name| |
This file contains 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
- def create_user(overrides = {}) | |
- new_user(overrides).tap(&:save!) | |
- end | |
- | |
private | |
+ def method_missing(method, *args) | |
+ if method.to_s =~ /^create_(.+)$/ | |
+ send("new_#{$1}", *args).tap(&:save!) |
This file contains 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
module ObjectCreationMethods | |
def new_user(attributes = {}) | |
defaults = { | |
email: "user#{counter}@example.com", | |
password: "password", | |
} | |
User.new { |user| apply(user, defaults, overrides) } | |
end | |
def create_user(attributes = {}) |
This file contains 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
# Extensions to heroku_san tasks | |
# Never runs on Heroku | |
if Rails.env.development? | |
STAGES = %w[ci acceptance staging production] | |
require 'auto_tagger' | |
def create_and_push(stage) | |
auto_tag = AutoTagger::Base.new(stages: STAGES, stage: stage, verbose: true, push_refs: false, refs_to_keep: 100) |
This file contains 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
source 'https://rubygems.org' | |
gem 'octopress', '~> 3.0' | |
# gem 'drjekyll' | |
gem 'html2markdown' | |
group :jekyll_plugins do | |
gem 'octopress-codefence' | |
gem 'octopress-debugger' |
This file contains 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
#Slows down selenium so you can see what's going on | |
#http://stackoverflow.com/questions/4815516/how-can-i-run-selenium-used-through-capybara-at-a-lower-speed/5150855#5150855 | |
#require 'selenium-webdriver' | |
#module ::Selenium::WebDriver::Remote | |
# class Bridge | |
# def execute(*args) | |
# result = raw_execute(*args)['value'] | |
# sleep 0.1 | |
# result | |
# end |
This file contains 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
class BrandSweeper < ActionController::Caching::Sweeper | |
observe Brand # Observers will introspect on the class, but Sweepers don't | |
def after_update(brand) | |
expire_action :controller => "brand", :action => :preview, :brand_id => brand.to_param | |
end | |
... |
This file contains 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
# For mocha integration, add this file into features/support folder | |
require "mocha" | |
World(Mocha::API) | |
Before do | |
mocha_setup | |
end |