Skip to content

Instantly share code, notes, and snippets.

sdfsdfsdfsdfsdfsdfsdf
@ddollar
ddollar / test.pl
Created July 23, 2008 15:07 — forked from maio/test.pl
use strict;
print "Hello World!\n";
# config.ru
require 'rubygems'
# Uncomment if your app uses bundled gems
#gems_dir = File.expand_path(File.join(File.dirname(__FILE__), 'gems'))
#Gem.clear_paths
#$BUNDLE = true
#Gem.path.unshift(gems_dir)
require 'merb-core'
# this is the plugin lib
module ActsAsTraceable
class TracedClass
def initialize(object)
@object = object
end
def method_missing(method, *args, &block)
puts "[TRACE] START: #{@object.class.to_s}##{method}(#{args.map { |arg| arg.inspect }.join(', ')})"
@object.send(method, *args, &block)
#!/usr/bin/env ruby
require 'yaml'
CONFIG_FN = ".git-wtfrc"
class Numeric; def pluralize s; "#{to_s} #{s}" + (self != 1 ? "s" : "") end end
def die s
$stderr.puts "Error: #{s}"
exit(-1)
# ansi control sequences
BLACK="\[\033[0m\]"
BOLD_BLACK="\[\033[1;30m\]"
RED="\[\033[0;31m\]"
BOLD_RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
BOLD_GREEN="\[\033[1;32m\]"
YELLOW="\[\033[0;33m\]"
BOLD_YELLOW="\[\033[1;33m\]"
BLUE="\[\033[0;34m\]"
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
require 'rubygems'
require 'wirble'
Wirble.init
# ansi control sequences
BLACK="\[\033[0m\]"
BOLD_BLACK="\[\033[1;30m\]"
RED="\[\033[0;31m\]"
BOLD_RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
BOLD_GREEN="\[\033[1;32m\]"
YELLOW="\[\033[0;33m\]"
BOLD_YELLOW="\[\033[1;33m\]"
BLUE="\[\033[0;34m\]"
configuration do
application 'test-application'
path "/srv/app/test/#{application}"
repository '[email protected]:project.git'
tunnel true
end
target :staging do
branch 'staging'
app '[email protected]'
validate_presence_of :name, :if => :should_validate_name?
def should_validate_name?
parent_object.has_certain_properties?
end