Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Quorning bquorning

View GitHub Profile
View rspec-syntax-cheat-sheet.rb
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@bquorning
bquorning / payex.rb
Created May 16, 2011 — forked from dbackeus/payex.rb
Simple helper module to help communicate with payex.
View payex.rb
module Payex
mattr_accessor :account_number
mattr_accessor :encryption_key
MD5_CHECK_FIELDS = {
"pxorder/pxorder.asmx/Initialize7" => [:accountNumber, :purchaseOperation, :price, :priceArgList, :currency, :vat, :orderID, :productNumber, :description, :clientIPAddress, :clientIdentifier, :additionalValues, :externalID, :returnUrl, :view, :agreementRef, :cancelUrl, :clientLanguage],
"pxagreement/pxagreement.asmx/CreateAgreement3" => [:accountNumber, :merchantRef, :description, :purchaseOperation, :maxAmount, :notifyUrl, :startDate, :stopDate],
"pxagreement/pxagreement.asmx/DeleteAgreement" => [:accountNumber, :agreementRef],
"pxorder/pxorder.asmx/Complete" => [:accountNumber, :orderRef],
"pxagreement/pxagreement.asmx/AutoPay2" => [:accountNumber, :agreementRef, :price, :productNumber, :description, :orderId, :purchaseOperation],
View gist:150903
#!/usr/bin/env ruby
grep_result = `grep -ri "def " #{ARGV.join(' ')}`
methods = grep_result.split("\n").collect do |line|
line[/.*:\s+def ([a-z_]+)(\((.*)\))?/i, 1]
end
filtered_methods = methods.uniq - ["initialize"]
dirs = (Dir.glob("*") - ['vendor', 'log']).join(" ")
You can’t perform that action at this time.