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
lenny ~/workspace/rack-tidy % ruby app.rb | |
== Sinatra/0.9.1.1 has taken the stage on 4567 for development with backup from Mongrel | |
line 1 column 1 - Warning: missing <!DOCTYPE> declaration | |
line 1 column 60 - Warning: discarding unexpected </div> | |
Info: Document content looks like HTML 3.2 | |
2 warnings, 0 errors were found! | |
127.0.0.1 - - [08/May/2009 20:58:07] "GET / HTTP/1.1" 200 79 0.0054 |
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' | |
require 'tidy' | |
require 'sinatra' | |
module Rack | |
class Tidy | |
def initialize(app) | |
@app = app | |
::Tidy.path = "/usr/lib/libtidy-0.99.so.0" # or "/usr/lib/libtidy.A.dylib" on Mac | |
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
class Array | |
def qsort | |
return self if empty? | |
select { |x| x < first }.qsort + [first] + select { |x| x > first }.qsort | |
end | |
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
require 'ruby2ruby' | |
$q = [] | |
def queue_code(args={}, &blk) | |
(c = Class.new).class_eval { define_method :proc, blk } | |
$q << { :code => Ruby2Ruby.translate(c, :proc), :args => args } | |
end | |
def run_all_queued |
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
# $Id: PKGBUILD,v 1.36 2009/06/22 13:09:26 sergej Exp $ | |
# Maintainer: Sergej Pupykin <[email protected]> | |
# Contributor: Miroslaw Szot <[email protected]> | |
_doc_root=/srv/http/nginx | |
_server_root=/etc/nginx | |
_conf_path=${_server_root}/conf | |
_tmp_path=/var/spool/nginx | |
_log_path=/var/log/nginx | |
_user=http |
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
# $Id: PKGBUILD,v 1.36 2009/06/22 13:09:26 sergej Exp $ | |
# Maintainer: Sergej Pupykin <[email protected]> | |
# Contributor: Miroslaw Szot <[email protected]> | |
_doc_root=/srv/http/nginx | |
_server_root=/etc/nginx | |
_conf_path=${_server_root}/conf | |
_tmp_path=/var/spool/nginx | |
_log_path=/var/log/nginx | |
_user=http |
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
# Copyright 2009 Marcin Kulik (sickill) | |
require 'nokogiri' | |
module Rack | |
class RevisionInfo | |
INJECT_ACTIONS = [:after, :before, :append, :prepend, :swap, :inner_html] | |
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S %Z" | |
def initialize(app, opts={}) |
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 'sinatra' | |
require 'dm-core' | |
require 'dm-types' | |
APP_ROOT = File.dirname(__FILE__) | |
DB_PATH = File.expand_path(File.join(APP_ROOT, 'db.sqlite3')) | |
DataMapper.setup(:default, "sqlite3://#{DB_PATH}") | |
class Media | |
include DataMapper::Resource |
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' | |
require 'sinatra' | |
run Sinatra::Application |
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
$_groups = [] | |
class Spec::Runner::Configuration | |
def before_spec | |
before(:all) do | |
top_level_group = self.class.to_s[/Merb::Test::ExampleGroup::([^:]+)/, 1] | |
unless $_groups.any? { |g| top_level_group == g } | |
$_groups << top_level_group | |
yield | |
end |
OlderNewer