Finish up the plugin manager

And so it shall be.
This commit is contained in:
Parker Moore 2014-11-05 19:29:54 -08:00
parent b0a7f9c8c9
commit 8ee1b2a1fd
3 changed files with 12 additions and 4 deletions

View File

@ -31,4 +31,4 @@ Feature: Configuring and using plugins
Then the _site directory should exist
And I should see "Whatever" in "_site/index.html"
And the "_site/test.txt" file should exist
And I should see "this is a test" in "_site/test.txt"
And I should see "this is a test" in "_site/test.txt"

View File

@ -17,7 +17,7 @@ module Jekyll
def conscientious_require
require_plugin_files
require_gems
self.require_from_bundler
self.class.require_from_bundler
end
# Require each of the gem plugins specified.
@ -33,9 +33,9 @@ module Jekyll
def self.require_from_bundler
unless ENV["JEKYLL_NO_BUNDLER_REQUIRE"]
require "bundler/setup"
require "bundler"
Bundler.require(:jekyll_plugins)
ENV["JEKYLL_NO_BUNDLER_REQUIRE"] = true
ENV["JEKYLL_NO_BUNDLER_REQUIRE"] = "true"
end
rescue LoadError
false

View File

@ -0,0 +1,8 @@
require 'helper'
class TestPluginManager < Test::Unit::TestCase
def test_requiring_from_bundler
Jekyll::PluginManager.require_from_bundler
assert ENV["JEKYLL_NO_BUNDLER_REQUIRE"], 'Gemfile plugins were not required.'
end
end