From 5f9244f06ccd577087127f1dfdb21fe558bd8e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 16 Oct 2020 13:52:43 +0200 Subject: [PATCH] Merge pull request #4020 from rubygems/bring-back-support-for-path-in-plugin Bring back the possibility to install a plugin from path (cherry picked from commit 62782d392ef6b0e35e1e177adf5aa8777bee6029) --- bundler/lib/bundler/plugin/dsl.rb | 2 +- bundler/spec/plugins/install_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bundler/lib/bundler/plugin/dsl.rb b/bundler/lib/bundler/plugin/dsl.rb index 4bfc8437e0e6..da751d1774ec 100644 --- a/bundler/lib/bundler/plugin/dsl.rb +++ b/bundler/lib/bundler/plugin/dsl.rb @@ -10,7 +10,7 @@ class PluginGemfileError < PluginError; end # So that we don't have to override all there methods to dummy ones # explicitly. # They will be handled by method_missing - [:gemspec, :gem, :path, :install_if, :platforms, :env].each {|m| undef_method m } + [:gemspec, :gem, :install_if, :platforms, :env].each {|m| undef_method m } # This lists the plugins that was added automatically and not specified by # the user. diff --git a/bundler/spec/plugins/install_spec.rb b/bundler/spec/plugins/install_spec.rb index a91175c616c2..370973ad1a5b 100644 --- a/bundler/spec/plugins/install_spec.rb +++ b/bundler/spec/plugins/install_spec.rb @@ -208,6 +208,19 @@ def exec(command, args) plugin_should_be_installed("ga-plugin") end + it "accepts path sources" do + build_lib "ga-plugin" do |s| + s.write "plugins.rb" + end + + install_gemfile <<-G + plugin 'ga-plugin', :path => "#{lib_path("ga-plugin-1.0")}" + G + + expect(out).to include("Installed plugin ga-plugin") + plugin_should_be_installed("ga-plugin") + end + context "in deployment mode" do it "installs plugins" do install_gemfile <<-G