Class: GemDigest::Categorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_digest/categorizer.rb

Instance Method Summary collapse

Instance Method Details

#categorize(gems_data) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gem_digest/categorizer.rb', line 5

def categorize(gems_data)
  categorized = {
    major: [],
    minor: [],
    patch: [],
    up_to_date: []
  }

  gems_data.each do |gem_data|
    current = parse_version(gem_data[:current_version])
    latest = parse_version(gem_data[:latest_version])
    
    next unless current && latest

    category = determine_update_category(current, latest)
    categorized[category] << gem_data
  end

  categorized
end