diff --git a/features/plugins.feature b/features/plugins.feature index 4e6d9d86..a36c6c82 100644 --- a/features/plugins.feature +++ b/features/plugins.feature @@ -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" \ No newline at end of file + And I should see "this is a test" in "_site/test.txt" diff --git a/lib/jekyll/plugin_manager.rb b/lib/jekyll/plugin_manager.rb index d484ef35..cf5860c5 100644 --- a/lib/jekyll/plugin_manager.rb +++ b/lib/jekyll/plugin_manager.rb @@ -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 diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb new file mode 100644 index 00000000..8cc1d8f8 --- /dev/null +++ b/test/test_plugin_manager.rb @@ -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