From e3751e1448a7cf008b75c5aa6ac7738701a28c1d Mon Sep 17 00:00:00 2001 From: tdreyno Date: Tue, 28 Jul 2009 08:42:21 -0700 Subject: [PATCH] markaby submodule --- .gitmodules | 3 +++ Rakefile | 1 - lib/middleman.rb | 13 +++++-------- vendor/sinatra-markaby | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .gitmodules create mode 160000 vendor/sinatra-markaby diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..65ed706c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/sinatra-markaby"] + path = vendor/sinatra-markaby + url = git://github.com/sbfaulkner/sinatra-markaby.git diff --git a/Rakefile b/Rakefile index 98d6a4f8..f88e9bb2 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/lib/middleman.rb b/lib/middleman.rb index 400db172..c60c856f 100644 --- a/lib/middleman.rb +++ b/lib/middleman.rb @@ -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 diff --git a/vendor/sinatra-markaby b/vendor/sinatra-markaby new file mode 160000 index 00000000..654e4173 --- /dev/null +++ b/vendor/sinatra-markaby @@ -0,0 +1 @@ +Subproject commit 654e41735fcc021fe5682a10485e676331497f4e