Skip to content

Instantly share code, notes, and snippets.

#unverified.list obtained from https://gist.github.com/raw/865b05630be54544ca72/a1a0c114d5eab0e65efccc941ca013fd06e6f43c/unverified.list
File.readlines("unverified.list").map do |line|
gem_file = line.split.last.gsub("./", "")
m = gem_file.match(/(.*)-((?:\d+.)*\d+.*)\.gem/)
[m[1], m[2]]
end.sort.uniq.each do |gem, version|
in_gemfile_lock = system %Q{grep -q "#{gem} (#{version})" Gemfile.lock}
puts "Unsafe #{gem} (#{version})" if in_gemfile_lock
end