init builder after features are enabled

This commit is contained in:
tdreyno 2009-10-08 11:24:19 -07:00
parent 4c7c3453e9
commit d979c56b69
3 changed files with 8 additions and 5 deletions

View file

@ -4,7 +4,9 @@ ENV['MM_ENV'] = "build"
# Require app # Require app
require File.join(File.dirname(__FILE__), "..", "lib", "middleman") require File.join(File.dirname(__FILE__), "..", "lib", "middleman")
Middleman::Base.init!
require 'middleman/builder' require 'middleman/builder'
Middleman::Base.init!
Middleman::Builder.init!
Middleman::Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV)) Middleman::Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV))

View file

@ -36,9 +36,11 @@ module Middleman
super(name, *args, &block) super(name, *args, &block)
end end
def self.init!
glob! File.basename(Middleman::Base.public), Middleman::Base.supported_formats glob! File.basename(Middleman::Base.public), Middleman::Base.supported_formats
glob! File.basename(Middleman::Base.views), Middleman::Base.supported_formats glob! File.basename(Middleman::Base.views), Middleman::Base.supported_formats
end end
end
module Generators module Generators
extend ::Templater::Manifold extend ::Templater::Manifold

View file

@ -6,7 +6,6 @@ rescue LoadError
end end
if Middleman::Base.environment == "build" if Middleman::Base.environment == "build"
require "middleman/builder"
Middleman::Builder.template :slickmap, "sitemap.html", "sitemap.html" Middleman::Builder.template :slickmap, "sitemap.html", "sitemap.html"
end end