Skip to content

Commit

Permalink
[rubygems/rubygems] Add ignore_funding_requests config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
m-o-e authored and matzbot committed Jul 26, 2022
1 parent 64f9f7d commit c3d9849
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 25 deletions.
1 change: 1 addition & 0 deletions lib/bundler/cli/common.rb
Expand Up @@ -15,6 +15,7 @@ def self.print_post_install_message(name, msg)
end

def self.output_fund_metadata_summary
return if Bundler.settings["ignore_funding_requests"]
definition = Bundler.definition
current_dependencies = definition.requested_dependencies
current_specs = definition.specs
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-add.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-ADD" "1" "June 2022" "" ""
.TH "BUNDLE\-ADD" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-binstubs.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-BINSTUBS" "1" "June 2022" "" ""
.TH "BUNDLE\-BINSTUBS" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-cache.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CACHE" "1" "June 2022" "" ""
.TH "BUNDLE\-CACHE" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-check.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CHECK" "1" "June 2022" "" ""
.TH "BUNDLE\-CHECK" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-clean.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CLEAN" "1" "June 2022" "" ""
.TH "BUNDLE\-CLEAN" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
Expand Down
5 changes: 4 additions & 1 deletion lib/bundler/man/bundle-config.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CONFIG" "1" "June 2022" "" ""
.TH "BUNDLE\-CONFIG" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options
Expand Down Expand Up @@ -205,6 +205,9 @@ The following is a list of all configuration keys and their purpose\. You can le
\fBglobal_gem_cache\fR (\fBBUNDLE_GLOBAL_GEM_CACHE\fR): Whether Bundler should cache all gems globally, rather than locally to the installing Ruby installation\.
.
.IP "\(bu" 4
\fBignore_funding_requests\fR (\fBBUNDLE_IGNORE_FUNDING_REQUESTS\fR): When set, no funding requests will be printed\.
.
.IP "\(bu" 4
\fBignore_messages\fR (\fBBUNDLE_IGNORE_MESSAGES\fR): When set, no post install messages will be printed\. To silence a single gem, use dot notation like \fBignore_messages\.httparty true\fR\.
.
.IP "\(bu" 4
Expand Down
2 changes: 2 additions & 0 deletions lib/bundler/man/bundle-config.1.ronn
Expand Up @@ -204,6 +204,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
Whether Bundler should cache all gems globally, rather than locally to the
installing Ruby installation.
* `ignore_funding_requests` (`BUNDLE_IGNORE_FUNDING_REQUESTS`):
When set, no funding requests will be printed.
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`):
When set, no post install messages will be printed. To silence a single gem,
use dot notation like `ignore_messages.httparty true`.
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-doctor.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-DOCTOR" "1" "June 2022" "" ""
.TH "BUNDLE\-DOCTOR" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-doctor\fR \- Checks the bundle for common problems
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-exec.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-EXEC" "1" "June 2022" "" ""
.TH "BUNDLE\-EXEC" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-gem.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-GEM" "1" "June 2022" "" ""
.TH "BUNDLE\-GEM" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-info.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-INFO" "1" "June 2022" "" ""
.TH "BUNDLE\-INFO" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-info\fR \- Show information for the given gem in your bundle
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-init.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-INIT" "1" "June 2022" "" ""
.TH "BUNDLE\-INIT" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-inject.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-INJECT" "1" "June 2022" "" ""
.TH "BUNDLE\-INJECT" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-install.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-INSTALL" "1" "June 2022" "" ""
.TH "BUNDLE\-INSTALL" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-list.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-LIST" "1" "June 2022" "" ""
.TH "BUNDLE\-LIST" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-list\fR \- List all the gems in the bundle
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-lock.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-LOCK" "1" "June 2022" "" ""
.TH "BUNDLE\-LOCK" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-open.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-OPEN" "1" "June 2022" "" ""
.TH "BUNDLE\-OPEN" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-outdated.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-OUTDATED" "1" "June 2022" "" ""
.TH "BUNDLE\-OUTDATED" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-outdated\fR \- List installed gems with newer versions available
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-platform.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-PLATFORM" "1" "June 2022" "" ""
.TH "BUNDLE\-PLATFORM" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-platform\fR \- Displays platform compatibility information
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-pristine.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-PRISTINE" "1" "June 2022" "" ""
.TH "BUNDLE\-PRISTINE" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-remove.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-REMOVE" "1" "June 2022" "" ""
.TH "BUNDLE\-REMOVE" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-remove\fR \- Removes gems from the Gemfile
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-show.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-SHOW" "1" "June 2022" "" ""
.TH "BUNDLE\-SHOW" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-update.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-UPDATE" "1" "June 2022" "" ""
.TH "BUNDLE\-UPDATE" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-update\fR \- Update your gems to the latest available versions
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-viz.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-VIZ" "1" "June 2022" "" ""
.TH "BUNDLE\-VIZ" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE" "1" "June 2022" "" ""
.TH "BUNDLE" "1" "July 2022" "" ""
.
.SH "NAME"
\fBbundle\fR \- Ruby Dependency Management
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/gemfile.5
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GEMFILE" "5" "June 2022" "" ""
.TH "GEMFILE" "5" "July 2022" "" ""
.
.SH "NAME"
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
Expand Down
27 changes: 27 additions & 0 deletions spec/bundler/install/gems/fund_spec.rb
Expand Up @@ -52,6 +52,33 @@
end
end

context "when gems include a fund URI but `ignore_funding_requests` is configured" do
before do
bundle "config set ignore_funding_requests true"
end

it "does not display the plural fund message after installing" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
gem 'has_funding_and_other_metadata'
gem 'has_funding'
gem 'rack-obama'
G

expect(out).not_to include("2 installed gems you directly depend on are looking for funding.")
end

it "does not display the singular fund message after installing" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
gem 'has_funding'
gem 'rack-obama'
G

expect(out).not_to include("1 installed gem you directly depend on is looking for funding.")
end
end

context "when gems do not include fund messages" do
it "does not display any fund messages" do
install_gemfile <<-G
Expand Down

0 comments on commit c3d9849

Please sign in to comment.