Skip to content

Commit

Permalink
Adding rake task to fix broken deps
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Oct 27, 2009
1 parent 93eb4ac commit ec1c662
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/tasks/gemcutter.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ namespace :gemcutter do
Rake::Task["gemcutter:import:process"].execute
end

desc "Fix dependencies"
task :fix_deps => :environment do
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
end

namespace :index do
desc "Create the index"
task :create => :environment do
Expand Down Expand Up @@ -259,6 +274,7 @@ namespace :gemcutter do
end
end

desc "Backup all .gem files"
task :backup do
require 'open-uri'
gemcutter_gems = Marshal.load(Gem.gunzip(open("http://gemcutter.org/specs.4.8.gz").read))
Expand Down

0 comments on commit ec1c662

Please sign in to comment.