lib/yard/cli/gems.rb in yard-0.9.5 vs lib/yard/cli/gems.rb in yard-0.9.6

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true module YARD module CLI # @since 0.6.0 class Gems < Command def initialize @@ -43,12 +44,13 @@ end end def add_gems(gems) 0.step(gems.size - 1, 2) do |index| - gem, ver_require = gems[index], gems[index + 1] || ">= 0" - specs = Gem.source_index.find_name(gem, ver_require) + gem = gems[index] + ver_require = gems[index + 1] || ">= 0" + specs = YARD::GemIndex.find_all_by_name(gem, ver_require) if specs.empty? log.warn "#{gem} #{ver_require} could not be found in RubyGems index" else @gems += specs end @@ -69,15 +71,14 @@ common_options(opts) parse_options(opts, args) add_gems(args) - if !args.empty? && @gems.empty? log.error "No specified gems could be found for command" elsif @gems.empty? - @gems += Gem.source_index.find_name('') if @gems.empty? + @gems += YARD::GemIndex.find_all_by_name('') if @gems.empty? end end end end -end \ No newline at end of file +end