Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gemcutter:import:process #5198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/tasks/gemcutter.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ namespace :gemcutter do
desc "Bring the gems through the gemcutter process"
task :process, %i[gems_cache_path] => :environment do |_task, args|
gems = Dir[File.join(args[:gems_cache_path] || "#{Gem.path.first}/cache", "*.gem")].reverse
api_key = ApiKey.first
raise("Importing gems requires a user with an API key. Run `bin/rails db:seed` to do so.") if api_key.nil?

puts "Processing #{gems.size} gems..."
gems.each do |path|
puts "Processing #{path}"
cutter = Pusher.new(User.new, File.open(path))
cutter = Pusher.new(api_key, File.open(path))

cutter.process
puts cutter.message unless cutter.code == 200
Expand Down