mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
enable less and builder support
This commit is contained in:
parent
2647c1da80
commit
8d2c070104
9 changed files with 80 additions and 25 deletions
4
Rakefile
4
Rakefile
|
@ -21,6 +21,8 @@ begin
|
|||
gem.add_dependency("sprockets")
|
||||
gem.add_dependency("sinatra", ">=1.0")
|
||||
gem.add_dependency("sinatra-content-for")
|
||||
gem.add_dependency("less")
|
||||
gem.add_dependency("builder")
|
||||
gem.add_dependency("rack-test")
|
||||
gem.add_dependency("yui-compressor")
|
||||
gem.add_dependency("haml", ">=3.0")
|
||||
|
@ -51,4 +53,4 @@ end
|
|||
|
||||
task :spec => :check_dependencies
|
||||
|
||||
task :default => [:cucumber, :spec]
|
||||
task :default => [:cucumber, :spec]
|
||||
|
|
|
@ -11,10 +11,15 @@ module Middleman
|
|||
autoload :MinifyCSS, "middleman/rack/minify_css"
|
||||
end
|
||||
|
||||
module Renderers
|
||||
autoload :ERb, "middleman/renderers/erb"
|
||||
autoload :Builder, "middleman/renderers/builder"
|
||||
autoload :Less, "middleman/renderers/less"
|
||||
end
|
||||
|
||||
autoload :Base, "middleman/base"
|
||||
autoload :ERb, "middleman/erb"
|
||||
autoload :Haml, "middleman/haml"
|
||||
autoload :Sass, "middleman/sass"
|
||||
autoload :Haml, "middleman/renderers/haml"
|
||||
autoload :Sass, "middleman/renderers/sass"
|
||||
autoload :Helpers, "middleman/helpers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -126,10 +126,11 @@ module Middleman
|
|||
end
|
||||
end
|
||||
|
||||
require "middleman/erb"
|
||||
# Haml is required & includes helpers
|
||||
require "middleman/haml"
|
||||
require "middleman/sass"
|
||||
require "middleman/renderers/erb"
|
||||
require "middleman/renderers/haml"
|
||||
require "middleman/renderers/sass"
|
||||
require "middleman/renderers/less"
|
||||
require "middleman/renderers/builder"
|
||||
|
||||
class Middleman::Base
|
||||
helpers Middleman::Helpers
|
||||
|
@ -184,4 +185,4 @@ class Middleman::Base
|
|||
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
23
lib/middleman/renderers/builder.rb
Normal file
23
lib/middleman/renderers/builder.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
require "builder"
|
||||
|
||||
module Middleman
|
||||
module Renderers
|
||||
module Builder
|
||||
def self.included(base)
|
||||
base.supported_formats << "builder"
|
||||
end
|
||||
|
||||
def render_path(path, layout)
|
||||
if template_exists?(path, :builder)
|
||||
builder(path.to_sym, :layout => layout)
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Middleman::Base
|
||||
include Middleman::Renderers::Builder
|
||||
end
|
|
@ -1,8 +1,8 @@
|
|||
require "erb"
|
||||
|
||||
module Middleman
|
||||
module ERb
|
||||
module Renderer
|
||||
module Renderers
|
||||
module ERb
|
||||
def self.included(base)
|
||||
base.supported_formats << "erb"
|
||||
end
|
||||
|
@ -20,5 +20,5 @@ module Middleman
|
|||
end
|
||||
|
||||
class Middleman::Base
|
||||
include Middleman::ERb::Renderer
|
||||
end
|
||||
include Middleman::Renderers::ERb
|
||||
end
|
23
lib/middleman/renderers/less.rb
Normal file
23
lib/middleman/renderers/less.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
require "less"
|
||||
|
||||
module Middleman
|
||||
module Renderers
|
||||
module Less
|
||||
def self.included(base)
|
||||
base.supported_formats << "less"
|
||||
end
|
||||
|
||||
def render_path(path, layout)
|
||||
if template_exists?(path, :less)
|
||||
less(path.to_sym)
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Middleman::Base
|
||||
include Middleman::Renderers::Less
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
# Generated by jeweler
|
||||
# DO NOT EDIT THIS FILE
|
||||
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
||||
# DO NOT EDIT THIS FILE DIRECTLY
|
||||
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
|
@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["Thomas Reynolds"]
|
||||
s.date = %q{2010-06-09}
|
||||
s.date = %q{2010-08-06}
|
||||
s.email = %q{tdreyno@gmail.com}
|
||||
s.executables = ["mm-init", "mm-build", "mm-server"]
|
||||
s.extra_rdoc_files = [
|
||||
|
@ -99,23 +99,23 @@ Gem::Specification.new do |s|
|
|||
s.rdoc_options = ["--charset=UTF-8"]
|
||||
s.require_paths = ["lib"]
|
||||
s.rubyforge_project = %q{middleman}
|
||||
s.rubygems_version = %q{1.3.7}
|
||||
s.rubygems_version = %q{1.3.6}
|
||||
s.summary = %q{A static site generator utilizing Haml, Sass and providing YUI compression and cache busting}
|
||||
s.test_files = [
|
||||
"spec/builder_spec.rb",
|
||||
"spec/fixtures/sample/init.rb",
|
||||
"spec/spec_helper.rb",
|
||||
"spec/builder_spec.rb",
|
||||
"spec/helpers_spec.rb",
|
||||
"spec/spec_helper.rb"
|
||||
"spec/fixtures/sample/init.rb"
|
||||
]
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
||||
s.specification_version = 3
|
||||
|
||||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
||||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
||||
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
||||
s.add_runtime_dependency(%q<thin>, [">= 0"])
|
||||
s.add_runtime_dependency(%q<shotgun>, [">= 0"])
|
||||
s.add_runtime_dependency(%q<shotgun>, [">= 0.8"])
|
||||
s.add_runtime_dependency(%q<templater>, [">= 0"])
|
||||
s.add_runtime_dependency(%q<sprockets>, [">= 0"])
|
||||
s.add_runtime_dependency(%q<sinatra>, [">= 1.0"])
|
||||
|
@ -134,7 +134,7 @@ Gem::Specification.new do |s|
|
|||
else
|
||||
s.add_dependency(%q<rack>, [">= 0"])
|
||||
s.add_dependency(%q<thin>, [">= 0"])
|
||||
s.add_dependency(%q<shotgun>, [">= 0"])
|
||||
s.add_dependency(%q<shotgun>, [">= 0.8"])
|
||||
s.add_dependency(%q<templater>, [">= 0"])
|
||||
s.add_dependency(%q<sprockets>, [">= 0"])
|
||||
s.add_dependency(%q<sinatra>, [">= 1.0"])
|
||||
|
@ -154,7 +154,7 @@ Gem::Specification.new do |s|
|
|||
else
|
||||
s.add_dependency(%q<rack>, [">= 0"])
|
||||
s.add_dependency(%q<thin>, [">= 0"])
|
||||
s.add_dependency(%q<shotgun>, [">= 0"])
|
||||
s.add_dependency(%q<shotgun>, [">= 0.8"])
|
||||
s.add_dependency(%q<templater>, [">= 0"])
|
||||
s.add_dependency(%q<sprockets>, [">= 0"])
|
||||
s.add_dependency(%q<sinatra>, [">= 1.0"])
|
||||
|
@ -172,3 +172,4 @@ Gem::Specification.new do |s|
|
|||
s.add_dependency(%q<jeweler>, [">= 0"])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue