lib/bundler/restrict/cli.rb in bundler-restrict-0.1.0 vs lib/bundler/restrict/cli.rb in bundler-restrict-0.1.1
- old
+ new
@@ -13,10 +13,12 @@
BundlerGems.new.each do |gem|
[
Checks::DateCheck
].map { |ch| ch.new(gem) }.each do |check|
+ next if ignore?(gem)
+
unless check.valid?
print "\n"
puts check.error
errors << check.error
@@ -25,13 +27,22 @@
print '.'
end
if errors.empty?
+ print "\n"
puts "OK"
else
exit 1
end
+ end
+
+ def ignore?(gem)
+ ignored_gems.include? gem.name
+ end
+
+ def ignored_gems
+ ['bundler-restrict'] + ENV.fetch('BUNDLE_RESTRICT_IGNORE_GEMS', '').split(',')
end
end
end
end