Module: Geminabox::Indexer

Defined in:
lib/geminabox/indexer.rb

Class Method Summary collapse

Class Method Details

.updated_gemspecs(indexer) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/geminabox/indexer.rb', line 7

def self.updated_gemspecs(indexer)
  specs_mtime = File.stat(indexer.dest_specs_index).mtime rescue Time.at(0)
  newest_mtime = Time.at 0

  updated_gems = indexer.gem_file_list.select do |gem|
    gem_mtime = File.stat(gem).mtime
    newest_mtime = gem_mtime if gem_mtime > newest_mtime
    gem_mtime >= specs_mtime
  end

  indexer.map_gems_to_specs updated_gems
end