I hereby claim:
- I am myobie on github.
- I am myobie (https://keybase.io/myobie) on keybase.
- I have a public key whose fingerprint is 69D2 E49C B648 2AF7 165D 6DC7 0C2B ADEB 54D2 48F1
To claim this, I am signing this object:
module Workflow | |
extend ActiveSupport::Concern | |
included do | |
extend ActiveModel::Naming | |
include ActiveModel::Validations | |
end | |
def call | |
if valid? |
class TasksController | |
def index | |
Task.where(IndexParams.new(params).params) | |
end | |
def create | |
Task.create!(CreateParams.new(params).params) | |
end | |
private |
module MySinatraTestMethods | |
def self.included(other) | |
other.send :include, Rack::Test::Methods | |
end | |
def app | |
Sinatra::Application.new | |
end | |
def session |
# example that works | |
get "/", {}, "rack.session" => { user_id: 1 } | |
# example that I wish worked | |
logged_in_as(1) { get "/" } | |
# or this |
# Heavily inspired and modified from http://www.quirksmode.org/js/xmlhttp.html | |
XMLHttpFactories = [ | |
(-> return new XMLHttpRequest()), | |
(-> return new ActiveXObject("Msxml2.XMLHTTP")), | |
(-> return new ActiveXObject("Msxml3.XMLHTTP")), | |
(-> return new ActiveXObject("Microsoft.XMLHTTP")) | |
] | |
class Response |
require 'monitor' | |
class Promise | |
include MonitorMixin | |
NOTHING = Object.new.freeze | |
def initialize(&blk) | |
@blk = blk | |
@value = NOTHING | |
end |
require 'monitor' | |
require 'forwardable' | |
module Wunderlist | |
module SDK | |
AlreadyComplete = Class.new(StandardError) | |
class Future | |
include MonitorMixin | |
NOTHING = Object.new.freeze |
I hereby claim:
To claim this, I am signing this object:
require 'spec_helper' | |
describe DiscussionsController do | |
before { stub_current_user } | |
describe "index" do | |
context "(with a project and some discussions)" do | |
before do | |
@project = create :project, owner: current_user, member_ids: [current_user.id] | |
@discussions = 3.times.map do |
require "curses" | |
require "monitor" | |
class Timer | |
def initialize(amount) | |
@amount = amount | |
end | |
def after(&blk) | |
@after = blk |