Sha256: 511fcee0cffe0fcded4073be644b0952f9c973d09bd1f57a59b1405a1272471c
Contents?: true
Size: 440 Bytes
Versions: 19
Compression:
Stored size: 440 Bytes
Contents
module Geminabox class GemListMerge attr_accessor :list IGNORE_DEPENDENCIES = 0..-2 def self.from(*lists) lists.map{|list| new(list)}.inject(:merge) end def initialize(list) @list = list end def merge(other) merged = (list + other.list) merged.uniq! {|val| val.values[IGNORE_DEPENDENCIES] } merged.sort_by! {|x| x.values[IGNORE_DEPENDENCIES] } merged end end end
Version data entries
19 entries across 19 versions & 1 rubygems