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
{ | |
'ogg' => Audio::OGG::Decoder, | |
'mp3' => Audio::MPEG::Decoder, | |
}.each do |type,klass| | |
define_method(:"decode_#{type}") do |filename| | |
reader = klass.new | |
name = File.join(Dir::tmpdir, | |
"#{File.basename(filename, ".#{type}")}.wav") | |
File.open(filename, 'rb') { |input| | |
File.open(name, 'wb') { |tmpfile| |
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
require File.join(File.dirname(__FILE__), '..', 'test_helper') | |
require "webrat" | |
Webrat.configure do |config| | |
config.mode = :rails | |
config.open_error_files = false | |
end | |
class UserFlowsTest < ActionController::IntegrationTest | |
include Webrat |
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
bob = test_user_flow do |bob| | |
bob.visits '/login' | |
bob.does_something_else' | |
end | |
bob.yet_another _thing | |
sally...... |
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
require File.join(File.dirname(__FILE__), '..', 'test_helper') | |
require "webrat" | |
Webrat.configure do |config| | |
config.mode = :rails | |
config.open_error_files = false | |
end | |
module MyTestingDSL | |
def logs_in(login, password) |
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
<div id="player"> | |
<canvas id="levels" width="145" height="24"></canvas> | |
</div> |
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 test_create_and_accept | |
ask = Order.create(:created_by => @sally, | |
:type => 'Ask', | |
:shares=>10, :price=>11, | |
:company=>@company, | |
:expires => 2.days.from_now, | |
:purchase_agreement_acceptance => '1', | |
:proof_of_ownership => '1', | |
:escrow_acceptance => '1') | |
assert_equal 4, ask.contracts.count |
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
pool :att do | |
cloud :rails_apps do | |
using :ec2 | |
instances 2..50 | |
expand_when load > 0.8 | |
expand_when instances > 10 do | |
load > 0.8 to :slicehost | |
load > 1.4 to :slicehost |
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
# jEdit :folding=explicit:collapseFolds=1:indentSize=2:tabSize=2: | |
# add requires here #{{{ | |
#}}} | |
# handle command line #{{{ | |
def usage #{{{ | |
puts <<-USAGE |
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 any_verb(path, block) | |
get path, &block | |
post path, &block | |
put path, &block | |
delete path, &block | |
head path, &block | |
end | |
any_verb "/" do | |
"foo" |
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
converse:open_and_send({66,214,143,157}, 8765, {data, whisper:encrypt("hi Ari")}). | |
Error econnrefused | |
Error in sending message to {66,214,143,157}:8765: econnrefused | |
error | |
3> converse:open_and_send({66,214,143,157}, 8765, {data, whisper:encrypt("hi Ari")}). | |
Error econnrefused | |
Error in sending message to {66,214,143,157}:8765: econnrefused | |
error | |
4> | |
=INFO REPORT==== 19-Feb-2009::00:16:05 === |