summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgrim Mittal <agrimmittal97@gmail.com>2018-02-26 03:30:36 +0530
committerAgrim Mittal <agrimmittal97@gmail.com>2018-02-26 03:38:05 +0530
commit6d563b03f6ec105b54ebae6bc7fab2eee35e6eec (patch)
tree030616805c32270ca4274a4d45498f0c96be8543
parent86e4b2a636fa2153bcd048dc084ace180cfe5c4a (diff)
downloadbundler-6d563b03f6ec105b54ebae6bc7fab2eee35e6eec.tar.gz
Add config variable and check for platform warnings
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/settings.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 0349af39f2..6b42fe0fb5 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -878,7 +878,7 @@ module Bundler
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
next if !remote && !dep.current_platform?
platforms = dep.gem_platforms(sorted_platforms)
- if platforms.empty?
+ if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
mapped_platforms = dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }
Bundler.ui.warn \
"The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 75e2d4dff2..83c119a562 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -26,6 +26,7 @@ module Bundler
disable_exec_load
disable_local_branch_check
disable_multisource
+ disable_platform_warnings
disable_shared_gems
disable_version_check
error_on_stderr