This file contains hidden or 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
# This method is heavily adapted from the Rails method of determining the subdomain. | |
require 'rubygems' | |
require 'sinatra' | |
helpers do | |
def subdomains(tld_len=1) # we set tld_len to 1, use 2 for co.uk or similar | |
@subdomains ||= if (!request.host.nil? && | |
/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.match(request.host)) | |
request.host.split('.')[0...(1 - tld_len - 2)] | |
else |
This file contains hidden or 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
Integrity.new "config/config.yml" do |app| | |
DataMapper.logger = app.logger = Integrity.logger | |
run app | |
end |
This file contains hidden or 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 Sinatra | |
module CuackExtension | |
def cuack(something) | |
get "/#{something}" do | |
"cuack!" | |
end | |
end | |
end | |
register CuackExtension |
This file contains hidden or 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 "sinatra" | |
require "sinatra/rendering" | |
render_with :haml | |
get "/" do | |
render :homepage | |
end | |
get "/some-ajax-action", :provides => "application/javascript" do |
This file contains hidden or 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
# entp.rb | |
# from Jeremy McAnally | |
plugin 'context', :git => 'git://github.com/jeremymcanally/context.git' | |
plugin 'matchy', :git => 'git://github.com/jeremymcanally/matchy.git' | |
plugin 'rr', :git => 'git://github.com/btakita/rr.git' | |
plugin 'machinist', :git => 'git://github.com/notahat/machinist.git' | |
plugin 'storyteller', :git => 'git://github.com/foca/storyteller.git' | |
plugin 'webrat', :git => 'git://github.com/brynary/webrat.git' | |
This file contains hidden or 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
foca ~/.rake-compiler/sources/sqlite3-ruby (git: master) | |
▸ rake cross compile RUBY_CC_VERSION=1.8.6 | |
(in /Users/foca/.rake-compiler/sources/sqlite3-ruby) | |
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009. | |
mkdir -p vendor/sqlite3/lib | |
cd vendor | |
--2009-04-04 03:50:37-- http://www.sqlite.org/sqlitedll-3_6_6_2.zip | |
Resolving www.sqlite.org... 67.18.92.124 | |
Connecting to www.sqlite.org|67.18.92.124|:80... connected. | |
HTTP request sent, awaiting response... 200 OK |
This file contains hidden or 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
diff --git a/lib/bob/builder.rb b/lib/bob/builder.rb | |
index a316799..b5c2ea3 100644 | |
--- a/lib/bob/builder.rb | |
+++ b/lib/bob/builder.rb | |
@@ -5,6 +5,7 @@ module Bob | |
def initialize(buildable, commit_id) | |
@buildable = buildable | |
@commit_id = commit_id | |
+ @build_status = nil | |
@build_output = nil |
This file contains hidden or 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 __ROOT__ | |
File.expand_path(File.dirname(__FILE__) + "/../") | |
end | |
require "test/unit" | |
require "contest" | |
require "matchy" | |
require "rr" | |
begin |
This file contains hidden or 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 Test::Unit::TestCase | |
def self.setup(&block) | |
include module_with_callback(:setup, &block) | |
end | |
def self.teardown(&block) | |
include module_with_callback(:teardown, &block) | |
end | |
def self.global_setup(&block) |
This file contains hidden or 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 Integrity | |
module Notifiers | |
def self.notify(&block) | |
block.call(Notificator.new) | |
end | |
def self.register(name, notifier) | |
notifiers[name.to_s] = notifier | |
end |