Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View pvh's full-sized avatar

Peter van Hardenberg pvh

View GitHub Profile
require 'spec_helper'
describe Thing do
subject { Thing.new() }
describe "#rating" do
its(:amount) { should == 25 }
end
describe "winning" do
before { subject.win }
(ns states.core)
(def resource-transitions
{:create
[{:condition #(= (% :ec2-state "pending"))
:transition :booting},
{:condition #(> (* 10 60) (% :created_at050))
:transition :failed}]
#!/usr/bin/env ruby
u = URI.parse(ARGV[0])
u.scheme == "postgres" or abort("Must provide a postgres://user:pass@host/dbname form url.")
ENV["PGPASSWORD"] = u.password
cmd = "psql -U #{u.user} -h #{u.host} #{u.path[1..-1]}"
puts cmd
exec cmd
PS1='\h:\W$(__git_ps1 "(%s)") \u\$ '
diff --git a/lib/swirl/ec2.rb b/lib/swirl/ec2.rb
index fd795f5..4f97bf5 100644
--- a/lib/swirl/ec2.rb
+++ b/lib/swirl/ec2.rb
@@ -21,11 +21,11 @@ module Swirl
def initialize(options)
@aws_access_key_id =
- options[:aws_access_key_id] ||
- raise ArgumentError, "no aws_access_key_id provided"
diff --git a/lib/swirl/ec2.rb b/lib/swirl/ec2.rb
index 19b2497..ed02b3a 100644
--- a/lib/swirl/ec2.rb
+++ b/lib/swirl/ec2.rb
@@ -35,7 +35,7 @@ module Swirl
end
def escape(value)
- CGI.escape(value).gsub(/\+/, "%20")
+ CGI.escape(value.to_s).gsub(/\+/, "%20")
pvhbook:bifrost((f8551e6...)) pvh$ bin/bifrost info ruronin
[ ruronin ]
Judo ID : 17wnkw7
Ip : 184.73.174.19
Plan : ronin
CallbackURL :
URL : postgres://w23c56tn748j47:a891myo7zoe815yohbzhjgej4@ec2-184-73-174-19.compute-1.amazonaws.com/w23c56tn748j47
Created At : Tue May 25 11:15:40 -0700 2010
Started At : Tue May 25 11:15:55 -0700 2010
pvhbook:bifrost((f8551e6...)) pvh$ bin/bifrost backup ruronin