Skip to content

Commit c6025f1

Browse files
ccutrerhsbt
authored andcommitted
remove validate_plugins!
it's not core to this PR, and can be debated separately
1 parent d09e24b commit c6025f1

2 files changed

Lines changed: 0 additions & 83 deletions

File tree

bundler/lib/bundler/definition.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
484484
def validate_runtime!
485485
validate_ruby!
486486
validate_platforms!
487-
validate_plugins!
488487
end
489488

490489
def validate_ruby!
@@ -520,19 +519,6 @@ def normalize_platforms
520519
@resolve = SpecSet.new(resolve.for(current_dependencies, @platforms))
521520
end
522521

523-
def validate_plugins!
524-
missing_plugins_list = []
525-
plugin_dependencies.each do |plugin|
526-
missing_plugins_list << plugin unless Plugin.installed?(plugin.name)
527-
end
528-
missing_plugins_list.map! {|p| "#{p.name} (#{p.requirement})" }
529-
if missing_plugins_list.size > 1
530-
raise GemNotFound, "Plugins #{missing_plugins_list.join(", ")} are not installed"
531-
elsif missing_plugins_list.any?
532-
raise GemNotFound, "Plugin #{missing_plugins_list.join(", ")} is not installed"
533-
end
534-
end
535-
536522
def add_platform(platform)
537523
return if @platforms.include?(platform)
538524

spec/plugins/install_spec.rb

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -596,75 +596,6 @@ def exec(command, args)
596596
end
597597
end
598598

599-
it "fails bundle commands if plugins are not yet installed" do
600-
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
601-
602-
gemfile <<-G
603-
source 'https://gem.repo2'
604-
group :development do
605-
plugin 'foo'
606-
end
607-
source 'https://gem.repo1' do
608-
gem 'rake'
609-
end
610-
G
611-
612-
plugin_should_not_be_installed("foo")
613-
614-
bundle "check", raise_on_error: false
615-
expect(err).to include("Plugin foo (>= 0) is not installed")
616-
617-
bundle "exec rake", raise_on_error: false
618-
expect(err).to include("Plugin foo (>= 0) is not installed")
619-
620-
bundle "config set --local without development"
621-
bundle "install"
622-
bundle "config unset --local without"
623-
624-
plugin_should_not_be_installed("foo")
625-
626-
bundle "check", raise_on_error: false
627-
expect(err).to include("Plugin foo (>= 0) is not installed")
628-
629-
bundle "exec rake", raise_on_error: false
630-
expect(err).to include("Plugin foo (>= 0) is not installed")
631-
632-
plugin_should_not_be_installed("foo")
633-
634-
bundle "install"
635-
plugin_should_be_installed("foo")
636-
637-
bundle "check"
638-
bundle "exec rake -T", raise_on_error: false
639-
expect(err).not_to include("Plugin foo (>= 0) is not installed")
640-
end
641-
642-
it "fails bundle commands gracefully when a plugin index reference is left dangling" do
643-
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
644-
645-
build_lib "ga-plugin" do |s|
646-
s.write "plugins.rb"
647-
end
648-
649-
install_gemfile <<-G
650-
source "https://gem.repo1"
651-
plugin 'ga-plugin', :path => "#{lib_path("ga-plugin-1.0")}"
652-
G
653-
654-
expect(out).to include("Installed plugin ga-plugin")
655-
plugin_should_be_installed("ga-plugin")
656-
657-
FileUtils.rm_rf(lib_path("ga-plugin-1.0"))
658-
659-
plugin_should_not_be_installed("ga-plugin")
660-
661-
bundle "check", raise_on_error: false
662-
expect(err).to include("Plugin ga-plugin (>= 0) is not installed")
663-
664-
bundle "exec rake -T", raise_on_error: false
665-
expect(err).to include("Plugin ga-plugin (>= 0) is not installed")
666-
end
667-
668599
context "inline gemfiles" do
669600
it "installs the listed plugins" do
670601
code = <<-RUBY

0 commit comments

Comments
 (0)