Merge pull request #310 from bhollis/master
Load extension gems even when only using middleman-core
This commit is contained in:
commit
1a25582d6f
3 changed files with 13 additions and 9 deletions
|
@ -46,9 +46,12 @@ rescue LoadError
|
|||
end
|
||||
end
|
||||
|
||||
# Automatically discover extensions in RubyGems
|
||||
Middleman.load_extensions_in_path
|
||||
|
||||
# Change directory to the root
|
||||
Dir.chdir(ENV["MM_ROOT"] || Dir.pwd) do
|
||||
|
||||
# Start the CLI
|
||||
Middleman::Cli::Base.start
|
||||
end
|
||||
end
|
||||
|
|
|
@ -196,12 +196,16 @@ module Middleman
|
|||
#
|
||||
# @private
|
||||
def load_extensions_in_path
|
||||
extensions = rubygems_latest_specs.select do |spec|
|
||||
spec_has_file?(spec, EXTENSION_FILE)
|
||||
end
|
||||
if defined?(Bundler)
|
||||
Bundler.require
|
||||
else
|
||||
extensions = rubygems_latest_specs.select do |spec|
|
||||
spec_has_file?(spec, EXTENSION_FILE)
|
||||
end
|
||||
|
||||
extensions.each do |spec|
|
||||
require spec.name
|
||||
extensions.each do |spec|
|
||||
require spec.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3,6 +3,3 @@ require "middleman-more"
|
|||
|
||||
# Make the VERSION string available
|
||||
require "middleman-core/version"
|
||||
|
||||
# Automatically discover extensions in RubyGems
|
||||
Middleman.load_extensions_in_path
|
Loading…
Reference in a new issue