From 1fb304212ef6461847ebb4fbf1833e53f7bb0587 Mon Sep 17 00:00:00 2001 From: Aditya Prakash Date: Tue, 30 Aug 2016 19:46:15 +0530 Subject: [PATCH] Add path arugment to rake task for updating versions list file usage: rake compact_index:update_versions_file["path_to_file/versions.list"] --- lib/tasks/compact_index.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/compact_index.rake b/lib/tasks/compact_index.rake index 7c976784d5d..e978d07bd5c 100644 --- a/lib/tasks/compact_index.rake +++ b/lib/tasks/compact_index.rake @@ -91,9 +91,9 @@ namespace :compact_index do end desc "Generate/update the versions.list file" - task update_versions_file: :environment do - file_path = Rails.application.config.rubygems['versions_file_location'] - versions_file = CompactIndex::VersionsFile.new file_path + task :update_versions_file, [:file_path] => :environment do |_t, args| + raise "#{args[:file_path]} does not exist" unless File.exist?(args[:file_path]) + versions_file = CompactIndex::VersionsFile.new args[:file_path] # Only indexed versions of a gem go into *new* versions file query = ["SELECT r.name, v.created_at as date, v.info_checksum, v.number, v.platform