Public Gists by bguthrie

Gravatar
Sun Nov 08 17:34:26 -0800 2009
1
2
3
package proovy;
 
import groovy.xml.dom.DOMCategory
Gravatar
Tue Oct 20 10:20:49 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
if ARGV.empty?
Gravatar
Sat Oct 10 10:52:02 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
require 'nokogiri'
Gravatar
Sat Sep 12 12:30:28 -0700 2009
1
2
3
class BlankHelper
  include ActionView::Helpers::UrlHelper
  include ActionView::Helpers::TagHelper
Gravatar
Tue Jun 09 20:11:01 -0700 2009
1
2
3
  # Give the stack a name, and describe its members.
  stack = Awsymandias::EC2::ApplicationStack.new("test") do |s|
    s.role "db", :instance_type => "m1.large", ...
Gravatar
Sat May 02 15:05:40 -0700 2009
1
2
3
user should receive(username, name, firstName) andReturn("guybrush")
; is equivalent to
user should receive(username: "guybrush", name: "guybrush", firstName: "guybrush")
Gravatar
Sat May 02 14:59:29 -0700 2009
1
2
3
user = mock! name andReturn("Guybrush", "Elaine", "LeChuck")
user name should == "Guybrush"
user name should == "Elaine"
Gravatar
Sat May 02 14:56:59 -0700 2009
1
2
3
user = User mimic
user should receive(firstName: "Guybrush", authenticate!("Guybrush", "lechucksucks") andReturn(true))
user authenticate!(user name, "lechucksucks") should be true
Gravatar
Sat May 02 14:51:17 -0700 2009
1
2
user stub!(:name) andReturn("Guybrush Threepwood")
user mock!(:occupation) andReturn("Fearsome Pirate") anyNumberOfTimes
Gravatar
Sat Apr 18 21:22:37 -0700 2009
1
2
3
JavaGround java:sql:ResultSet do(
  mimic!(Mixins Enumerable)
  
Gravatar
Sat Apr 11 13:18:19 -0700 2009
1
2
3
Message from = dmacro(
  "returns the message chain for the argument given",
  
Gravatar
Sat Apr 11 13:12:30 -0700 2009
1
*** - couldn't find cell 'name' on 'Origin_0x295106F' (Condition Error NoSuchCell)
Gravatar
Sat Apr 11 13:10:33 -0700 2009
1
["Guybrush", "Elaine", "LeChuck"].each {|name| puts "Hello #{name}"}
Gravatar
Sat Apr 11 13:08:54 -0700 2009
1
["Guybrush", "Elaine", "LeChuck"] each(name, "Hello #{name}" println)
Gravatar
Fri Mar 27 10:55:05 -0700 2009
1
2
3
module BetterToInteger
  def self.included(string_class)
    string_class.alias_method_chain :to_i, :logging
Gravatar
Fri Mar 27 10:44:24 -0700 2009
1
2
3
irb(main):003:0> "".method(:to_widget)
=> #<Method: String#to_widget>
 
Gravatar
Fri Mar 27 10:32:34 -0700 2009
1
2
3
class String
  def to_widget
    Widget.new self.gsub(/foo/, "bar")
Gravatar
Mon Mar 16 18:08:09 -0700 2009
1
2
3
class UsersController < ResourceFull::Base
  identified_by :username, :unless => lambda { |id| id =~ /^[0-9]+$/ }
  
gist: 55706 A patch for ActiveResource ...
Gravatar
Sat Jan 31 15:28:17 -0800 2009
1
2
3
require 'libxml'
 
module LibXML
Gravatar
Fri Oct 03 08:23:35 -0700 2008
1
2
3
module ActiveRecord
  class KindRollback < Rollback
  end