lib/rubygems/dependent.rb in gem-dependent-0.2.1 vs lib/rubygems/dependent.rb in gem-dependent-0.2.2
- old
+ new
@@ -64,17 +64,25 @@
def self.all_specs_and_sources(options={})
fetcher = Gem::SpecFetcher.fetcher
all = true
matching_platform = false
prerelease = false
- matcher = Gem::Dependency.new(//, Gem::Requirement.default) # any name, any version
+ matcher = without_deprecation_warning { Gem::Dependency.new(//, Gem::Requirement.default) } # any name, any version
specs_and_sources = fetcher.find_matching matcher, all, matching_platform, prerelease
if options[:all_versions]
specs_and_sources
else
uniq_by(specs_and_sources){|a| a.first.first }
end
+ end
+
+ def self.without_deprecation_warning(&block)
+ previous = Gem::Deprecate.skip
+ Gem::Deprecate.skip = true
+ yield
+ ensure
+ Gem::Deprecate.skip = previous
end
# get unique elements from an array (last found is used)
# http://drawohara.com/post/146659159/ruby-enumerable-uniq-by
def self.uniq_by(array, &block)