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 'rubygems' | |
$:.unshift "#{File.dirname(__FILE__)}/../lib" | |
require "poolparty" | |
pool :ap do | |
instances 1 | |
access_key "XXXXXX" | |
secret_access_key "XXXXXXX" | |
cloud :app_stack do |
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
cloud-start -s config/clouds.rb | |
Starting cloud app (/home/yann/.ec2/testpoolparty) | |
0 running instances (1 - 1) | |
/usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:261:in `ec2_error?': The key pair 'testpoolparty' does not exist (EC2::InvalidKeyPairNotFound) | |
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:199:in `make_request' | |
from /usr/lib/ruby/1.8/net/http.rb:543:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:173:in `make_request' | |
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:224:in `response_generator' | |
from /usr/lib/rub |
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
# Example of a Rack application that takes advantage to body.each to simulate | |
# a real-time data feed. | |
# | |
# Anyone may use this code AT YOUR OWN RISK. | |
require 'rack' | |
require 'ebb' | |
#This class simulates a server waiting for events. it will yield a line with one of the HTTP Request | |
#headers every half second. If things work right you should see you browser window slowely fill with |
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
module Rack | |
# | |
# A Rack middleware for automatically removing the format token at the end | |
# of a request path and adding its media type to the HTTP_ACCEPT header. | |
# | |
# MIT-License - Rein Henrichs | |
# | |
class FormatAccepts | |
def initialize(app) | |
@app = app |
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 :involver_rails do | |
cloud :nginx do | |
instances 2..2 # binds against 2 elastic IPs | |
has_package "nginx" | |
proxy {:source_port=>80, :destination_port=>8080, :destination_cloud=>:app} | |
end | |
cloud :app do |
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
# Basic pool spec | |
# Shows global settings for the clouds | |
pool :party do | |
# instances 1..3 | |
# set_master_ip_to '174.129.221.207' | |
keypair "#{ENV["HOME"]}/.poolparty/pool_dsa_key" | |
verbose true | |
# ami 'ami-7cfd1a15' | |
# using :vmrun | |
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
######### | |
# Cloud configuration | |
. | |
./test | |
./test/clouds.rb | |
./test/plugins | |
pool :test do | |
cloud :app do | |
instances 2..5 |
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
class Pop | |
def initialize(h={}, &block) | |
options(h) | |
puts "indide #{self.class} #{options.inspect}" | |
instance_eval &block if block | |
end | |
def self.default_options(h={}) | |
@default_options ||= h | |
end |
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
<div id="player"> | |
<canvas id="levels" width="145" height="24"></canvas> | |
</div> |