content_for support

This commit is contained in:
tdreyno 2009-07-29 11:58:28 -07:00
parent 178415b007
commit 2176bb3427
3 changed files with 14 additions and 0 deletions

3
.gitmodules vendored
View file

@ -7,3 +7,6 @@
[submodule "vendor/rack-test"]
path = vendor/rack-test
url = git://github.com/brynary/rack-test.git
[submodule "vendor/sinatra-content-for"]
path = vendor/sinatra-content-for
url = git://github.com/foca/sinatra-content-for.git

View file

@ -9,6 +9,9 @@ require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-markaby', 'li
# Include maruku support
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-maruku', 'lib', 'sinatra', 'maruku')
# Include content_for support
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-content-for', 'lib', 'sinatra', 'content_for')
class Middleman < Sinatra::Base
set :app_file, __FILE__
set :static, true
@ -17,6 +20,13 @@ class Middleman < Sinatra::Base
helpers Sinatra::Markaby
helpers Sinatra::Maruku
helpers Sinatra::ContentFor
helpers do
def link_to(title, url="#")
%Q{<a href="#{url}">#{title}</a>}
end
end
def self.run!(options={}, &block)
set options

1
vendor/sinatra-content-for vendored Submodule

@ -0,0 +1 @@
Subproject commit e586a107ed19cdee69cfb81e31c01de51f39d54d