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.executables = %w(sm-init sm-build sm-server)
gem.add_dependency("templater") gem.add_dependency("templater")
gem.add_dependency("sinatra") gem.add_dependency("sinatra")
gem.add_dependency("sbfaulkner-sinatra-markaby")
gem.add_dependency("haml", ">=2.1.0") gem.add_dependency("haml", ">=2.1.0")
gem.add_dependency("chriseppstein-compass") gem.add_dependency("chriseppstein-compass")
end end

View file

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

1
vendor/sinatra-markaby vendored Submodule

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