1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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
This commit is contained in:
Dan Jensen 2022-01-26 12:35:13 -06:00 committed by git
parent f6894711a4
commit 0b2f6b942b
2 changed files with 35 additions and 1 deletions

View file

@ -73,7 +73,8 @@ module Bundler
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
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

View file

@ -21,6 +21,7 @@ RSpec.describe "bundle info" do
source "#{file_uri_for(gem_repo2)}"
gem "rails"
gem "has_metadata"
gem "thin"
G
end
@ -123,6 +124,30 @@ RSpec.describe "bundle info" do
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