Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: b1b4e26a89
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (25 sloc) 0.805 kb
class ReallyRegenerateRuntimeDependenciesList < ActiveRecord::Migration
def self.up
each_dependency do |row|
$redis.lrem "rd:#{row['full_name']}", 0, "#{row['name']} #{row['requirements']}"
end
end
def self.down
each_dependency do |row|
$redis.lpush "rd:#{row['full_name']}", "#{row['name']} #{row['requirements']}"
end
end
def self.each_dependency
dependencies = <<-SQL
select dependencies.*, name, full_name
from dependencies
inner join versions on versions.id = dependencies.version_id
inner join rubygems on rubygems.id = dependencies.rubygem_id
where scope = 'development'
SQL
connection.select_all(dependencies).each_with_index do |row, index|
puts index if index % 10000 == 0
yield row
end
end
end
Jump to Line
Something went wrong with that request. Please try again.