summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-01 12:43:58 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-12 10:15:43 +0100
commit8cbbb3985607bbfffa2d26666da163631c4c5acd (patch)
tree1a6430bcc5b8365866098e38828e91b0f31fa337
parentecd437368cb5193347fc0d5b4dc2f84261b2eef3 (diff)
downloadbundler-8cbbb3985607bbfffa2d26666da163631c4c5acd.tar.gz
Delay custom sources deprecation to bundler 3
And thus its removal even further.
-rw-r--r--lib/bundler/dsl.rb4
-rw-r--r--lib/bundler/feature_flag.rb2
-rw-r--r--spec/bundler/dsl_spec.rb15
-rw-r--r--spec/other/major_deprecation_spec.rb14
4 files changed, 24 insertions, 11 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 3849cff339..3b9f432ee7 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -479,8 +479,8 @@ repo_name ||= user_name
"do |repo_name|\n#{replacement.to_s.gsub(/^/, " ")}\n end"
end
- Bundler::SharedHelpers.major_deprecation 2, <<-EOS
-The :#{name} git source is deprecated, and will be removed in Bundler 2.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work:
+ Bundler::SharedHelpers.major_deprecation 3, <<-EOS
+The :#{name} git source is deprecated, and will be removed in Bundler 3.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:#{name}) #{replacement}
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 48eec1cca6..8b7b836e42 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -50,7 +50,7 @@ module Bundler
settings_flag(:prefer_gems_rb) { bundler_2_mode? }
settings_flag(:print_only_version_number) { bundler_2_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_2_mode? }
- settings_flag(:skip_default_git_sources) { bundler_3_mode? }
+ settings_flag(:skip_default_git_sources) { bundler_4_mode? }
settings_flag(:specific_platform) { bundler_2_mode? }
settings_flag(:suppress_install_using_messages) { bundler_2_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb
index 2a4a198d24..bc40ab94b2 100644
--- a/spec/bundler/dsl_spec.rb
+++ b/spec/bundler/dsl_spec.rb
@@ -100,7 +100,7 @@ RSpec.describe Bundler::Dsl do
end
end
- context "default git sources", :bundler => "3" do
+ context "default git sources", :bundler => "4" do
it "has none" do
expect(subject.instance_variable_get(:@git_sources)).to eq({})
end
@@ -294,6 +294,19 @@ RSpec.describe Bundler::Dsl do
describe "#github", :bundler => "3" do
it "from github" do
+ spree_gems = %w[spree_core spree_api spree_backend]
+ subject.github "spree" do
+ spree_gems.each {|spree_gem| subject.send :gem, spree_gem }
+ end
+
+ subject.dependencies.each do |d|
+ expect(d.source.uri).to eq("https://github.com/spree/spree.git")
+ end
+ end
+ end
+
+ describe "#github", :bundler => "4" do
+ it "from github" do
expect do
spree_gems = %w[spree_core spree_api spree_backend]
subject.github "spree" do
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index d53f840a38..075046efa0 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -172,7 +172,7 @@ RSpec.describe "major deprecations" do
describe Bundler::Dsl do
let(:msg) do
<<-EOS
-The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
+The :github git source is deprecated, and will be removed in Bundler 3.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
@@ -191,7 +191,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
end
it "upgrades to https by default", :bundler => "2" do
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed")
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "https://github.com/indirect/sparks.git"
@@ -200,7 +200,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
it "upgrades to https on request", :bundler => "< 2" do
Bundler.settings.temporary "github.https" => true
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed")
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "https://github.com/indirect/sparks.git"
@@ -212,7 +212,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate)
msg = <<-EOS
-The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add this code to the top of your Gemfile to ensure it continues to work:
+The :bitbucket git source is deprecated, and will be removed in Bundler 3.0. Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:bitbucket) do |repo_name|
user_name, repo_name = repo_name.split("/")
@@ -221,7 +221,7 @@ The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add
end
EOS
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
subject.gem("not-really-a-gem", :bitbucket => "mcorp/flatlab-rails")
end
end
@@ -230,10 +230,10 @@ The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add
it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate)
msg = "The :gist git source is deprecated, and will be removed " \
- "in Bundler 2.0. Add this code to the top of your Gemfile to ensure it " \
+ "in Bundler 3.0. Add this code to the top of your Gemfile to ensure it " \
"continues to work:\n\n git_source(:gist) {|repo_name| " \
"\"https://gist.github.com/\#{repo_name}.git\" }\n\n"
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
subject.gem("not-really-a-gem", :gist => "1234")
end
end