[前][次][番号順一覧][スレッド一覧]

ruby-changes:71065

From: Dan <ko1@a...>
Date: Tue, 1 Feb 2022 20:07:30 +0900 (JST)
Subject: [ruby-changes:71065] 0b2f6b942b (master): [rubygems/rubygems] Skip "seller shipped" notification after delivery

https://git.ruby-lang.org/ruby.git/commit/?id=0b2f6b942b

From 0b2f6b942b0c38bf4925f4e8ad662f6a14954060 Mon Sep 17 00:00:00 2001
From: Dan Jensen <djensen@a...>
Date: Wed, 26 Jan 2022 12:35:13 -0600
Subject: [rubygems/rubygems] Skip "seller shipped" notification after delivery

If a Shipment has been delivered, there is no point in notifying the
buyer that the seller shipped. Instead, we should simply notify the
buyer that the shipment was delivered. This is relevant in cases where
the seller is late to mark a Shipment as shipped, so the first EasyPost
Tracker update marks it as delivered, or in cases where the seller
fails to mark as shipped and the buyer marks it as delivered.

This fixes a Shipment event handler so the buyer notification for
shipment is no longer invoked if the Shipment is already delivered.

https://github.com/rubygems/rubygems/commit/09c2cadc86
---
 lib/bundler/cli/info.rb            | 11 ++++++++++-
 spec/bundler/commands/info_spec.rb | 25 +++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
index 76c8cf60c01..38bc008cb55 100644
--- a/lib/bundler/cli/info.rb
+++ b/lib/bundler/cli/info.rb
@@ -73,7 +73,8 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L73
       gem_info << "\tBug Tracker: #{metadata["bug_tracker_uri"]}\n" if metadata.key?("bug_tracker_uri")
       gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri")
       gem_info << "\tPath: #{spec.full_gem_path}\n"
-      gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
+      gem_info << "\tDefault Gem: yes\n" if spec.respond_to?(:default_gem?) && spec.default_gem?
+      gem_info << "\tReverse Dependencies: \n\t\t#{gem_dependencies.join("\n\t\t")}" if gem_dependencies.any?
 
       if name != "bundler" && spec.deleted_gem?
         return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
@@ -81,5 +82,13 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L82
 
       Bundler.ui.info gem_info
     end
+
+    def gem_dependencies
+      @gem_dependencies ||= Bundler.definition.specs.map do |spec|
+        dependency = spec.dependencies.find {|dep| dep.name == gem_name }
+        next unless dependency
+        "#{spec.name} (#{spec.version}) depends on #{gem_name} (#{dependency.requirements_list.join(", ")})"
+      end.compact.sort
+    end
   end
 end
diff --git a/spec/bundler/commands/info_spec.rb b/spec/bundler/commands/info_spec.rb
index 7f618b5f6cc..74943703a20 100644
--- a/spec/bundler/commands/info_spec.rb
+++ b/spec/bundler/commands/info_spec.rb
@@ -21,6 +21,7 @@ RSpec.describe "bundle info" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/info_spec.rb#L21
         source "#{file_uri_for(gem_repo2)}"
         gem "rails"
         gem "has_metadata"
+        gem "thin"
       G
     end
 
@@ -123,6 +124,30 @@ RSpec.describe "bundle info" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/info_spec.rb#L124
         expect(out).to_not include("Homepage:")
       end
     end
+
+    context "when gem has a reverse dependency on any version" do
+      it "prints the details" do
+        bundle "info rack"
+
+        expect(out).to include("Reverse Dependencies: \n\t\tthin (1.0) depends on rack (>= 0)")
+      end
+    end
+
+    context "when gem has a reverse dependency on a specific version" do
+      it "prints the details" do
+        bundle "info actionpack"
+
+        expect(out).to include("Reverse Dependencies: \n\t\trails (2.3.2) depends on actionpack (= 2.3.2)")
+      end
+    end
+
+    context "when gem has no reverse dependencies" do
+      it "excludes the reverse dependencies field from the output" do
+        bundle "info rails"
+
+        expect(out).not_to include("Reverse Dependencies:")
+      end
+    end
   end
 
   context "with a git repo in the Gemfile" do
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]