Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (20 sloc) 0.607 kB
class FixDependencies < ActiveRecord::Migration
def self.up
# fix bad version reqs
Dependency.all.each do |dep|
reqs = dep.requirements
begin
Gem::Requirement.new(reqs)
rescue ArgumentError => ex
list = reqs.split(/(>=)|(<=)|(~>)|(>)|(<)|(=)/).reject(&:empty?)
fixed = list[0] + list[1] + ", " + list[2] + list[3]
dep.update_attribute(:requirements, fixed)
end
end
# kill bad deps too
Dependency.all(:include => :rubygem).select { |v| v.rubygem.nil? }.each { |d| d.destroy }
end
def self.down
# yeah, no way
end
end
Jump to Line
Something went wrong with that request. Please try again.