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
## That's one way... | |
# Think we can make this less ruby-specific? | |
solution :myapp do | |
cloud :db do | |
mysql :master => 1, :max_slaves => 4 | |
end | |
cloud :web do | |
rails ... |
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
solution :myapp do | |
cloud :db do | |
mysql :master => 1, :max_slaves => 4 | |
end | |
cloud :web do | |
rails ... | |
nginx ... | |
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
pool :poolpartyrb do | |
plugin_directory "plugins" | |
cloud :app do | |
# Configuration | |
configure { :maximum_instances => 1,:keypair => "name" } | |
minimum_instances 1 | |
apache 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
class Doc | |
def method_missing(m, *args, &block) | |
args.empty? ? options[m] : options[m] = args[0] | |
end | |
def options | |
@options ||= {} | |
end | |
def initialize(&block) | |
self.instance_eval(&block) if block_given? | |
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
module MethodMissingSuga | |
def method_missing(m, *args, &block) | |
args[0].instance_eval(&block) if block | |
args.empty? ? options[m] : options[m] = args[0] | |
end | |
def options | |
@options ||= {} | |
end | |
def initialize(&block) | |
self.instance_eval(&block) if block |
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 Image | |
attr_reader :src | |
def self.zoom_crop(src, max_width, max_height, out="thumbs/") | |
# Image details | |
new(src).zoom_crop(max_width, max_height, out) | |
end | |
def initialize(src) | |
@src = src | |
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
## Basic.rb | |
# Basic pool spec | |
# Shows global settings for the clouds | |
# Notice, the clouds take the options set by the cloud | |
pool :app do | |
instances 3..5 | |
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
pool :app do | |
plugin_directory File.join(File.dirname(__FILE__), "plugins") | |
instances 2..10 | |
cloud :app do | |
apache do | |
enable_php | |
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
module Slicehost | |
# the 4 methods (may add a few more) | |
# that are required for an extra base | |
def instances_list | |
... | |
end | |
register_remote_base :slicehost | |
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
apache do | |
installed_as_worker | |
listen("8080") | |
has_virtualhost do | |
name "xnot.org" | |
template ::File.join(File.dirname(__FILE__), "cb/templates", "virtual_host.conf.erb") | |
has_file(:name => "/var/www/xnot.org/public/index.html") do | |
template ::File.join(File.dirname(__FILE__), "cb/templates", "index.html") |
OlderNewer