lib/rubygems/dependent.rb in gem-dependent-0.2.3 vs lib/rubygems/dependent.rb in gem-dependent-0.2.4

- old
+ new

@@ -30,11 +30,11 @@ def self.fetch_all_dependencies(specs_and_sources, options={}) parallel = (options[:parallel] || 15) Gem::Dependent::Parallel.map(specs_and_sources, :in_processes => parallel) do |spec, source| yield if block_given? - name, version = if RUBY_VERSION > "2" + name, version = if Gem::VERSION > "2" [spec.name, spec.version] else spec[0,2] end dependencies = fetch_dependencies(spec, source, options) @@ -43,11 +43,11 @@ end def self.fetch_dependencies(spec, source, options={}) begin fetcher = Gem::SpecFetcher.fetcher - if RUBY_VERSION > "2" + if Gem::VERSION > "2" source.fetch_spec(spec).dependencies else fetcher.fetch_spec(spec, URI.parse(source)).dependencies end rescue Object => e @@ -73,19 +73,19 @@ fetcher = Gem::SpecFetcher.fetcher all = true matching_platform = false prerelease = false matcher = without_deprecation_warning { Gem::Dependency.new(//, Gem::Requirement.default) } # any name, any version - specs_and_sources = if RUBY_VERSION > "2" + specs_and_sources = if Gem::VERSION > "2" fetcher.search_for_dependency(matcher, matching_platform).first else fetcher.find_matching matcher, all, matching_platform, prerelease end if options[:all_versions] specs_and_sources else - uniq_by(specs_and_sources){|a| RUBY_VERSION > "2" ? a.first.name : a.first.first } + uniq_by(specs_and_sources){|a| Gem::VERSION > "2" ? a.first.name : a.first.first } end end def self.without_deprecation_warning(&block) previous = Gem::Deprecate.skip