markaby submodule

This commit is contained in:
tdreyno 2009-07-28 08:42:21 -07:00
parent 4371ade28c
commit e3751e1448
4 changed files with 9 additions and 9 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "vendor/sinatra-markaby"]
path = vendor/sinatra-markaby
url = git://github.com/sbfaulkner/sinatra-markaby.git

View file

@ -14,7 +14,6 @@ begin
gem.executables = %w(sm-init sm-build sm-server)
gem.add_dependency("templater")
gem.add_dependency("sinatra")
gem.add_dependency("sbfaulkner-sinatra-markaby")
gem.add_dependency("haml", ">=2.1.0")
gem.add_dependency("chriseppstein-compass")
end

View file

@ -2,7 +2,9 @@ require 'rubygems'
require 'haml'
require 'compass' #must be loaded before sinatra
require 'sinatra/base'
require 'sinatra/markaby'
# Include markaby support
require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra', 'markaby')
class Middleman < Sinatra::Base
set :app_file, __FILE__
@ -42,6 +44,7 @@ class Middleman < Sinatra::Base
def render_haml_or_sass(path)
if path.match /.html$/
haml(path.gsub('.html', '').to_sym)
#markaby
elsif path.match /.css$/
content_type 'text/css', :charset => 'utf-8'
sass(path.gsub('.css', '').to_sym, Compass.sass_engine_options)
@ -52,13 +55,7 @@ class Middleman < Sinatra::Base
path = path.gsub(%r{^/}, '')
path = "index.html" if path == ''
if path.match /.html$/
haml(path.gsub('.html', '').to_sym)
#markaby
elsif path.match /.css$/
content_type 'text/css', :charset => 'utf-8'
sass(path.gsub('.css', '').to_sym, Compass.sass_engine_options)
else
if !render_haml_or_sass(path)
pass
end
end

1
vendor/sinatra-markaby vendored Submodule

@ -0,0 +1 @@
Subproject commit 654e41735fcc021fe5682a10485e676331497f4e