-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* can break up bagit zips by a hardcoded record amount * breaking bags into folders appropriately * splitting bagit zips by size * missed an "end" * zip using only the new method * add rerun_all_exporters task * move a puts * multiple zips show up on the exporter index page * wip: new download button * able to download zips from index page again! co-author: shana@scientist.com * able to download zips from the exporter show page co-author: shana@scientist.com * splitting download sizes for csv exports too * style the download buttons co-author: shana@scientist.com * lint fix * more linting * specs pass * fix extra count issue * sort download options in ui * handle works with more than one file_set, move 1000 to a method * always find or create the file set entry on export * sort the exported zip files properly * fixing specs * add bagit parser spec for #find_child_file_sets * 100% coverage for #find_child_file_sets * remove byebug * add spec for #records_split_count * create exporter specs * create spec for #setup_export_file * add bagit parser specs for new folder system * consistent use of "subject" instead of "parser" in the bagit parser specs * all specs passing * add a spec for #write_files * linting * refactor #find_child_file_sets Co-authored-by: kirkkwang <k3wang@gmail.com>
- Loading branch information
Showing
14 changed files
with
282 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<%= form.select :exporter_export_zip_files, | ||
exporter.sort_zip_files(form.object.exporter_export_zip_files.flatten), | ||
{}, | ||
{ | ||
class: 'btn btn-default form-control', | ||
style: 'width: 200px' | ||
} | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
# desc "Explaining what the task does" | ||
# task :bulkrax do | ||
# # Task goes here | ||
# end | ||
namespace :bulkrax do | ||
desc "Remove old exported zips and create new ones with the new file structure" | ||
task rerun_all_exporters: :environment do | ||
if defined?(::Hyku) | ||
Account.find_each do |account| | ||
puts "=============== updating #{account.name} ============" | ||
next if account.name == "search" | ||
switch!(account) | ||
|
||
rerun_exporters_and_delete_zips | ||
|
||
puts "=============== finished updating #{account.name} ============" | ||
end | ||
else | ||
rerun_exporters_and_delete_zips | ||
end | ||
end | ||
|
||
def rerun_exporters_and_delete_zips | ||
begin | ||
Bulkrax::Exporter.all.each { |e| Bulkrax::ExporterJob.perform_later(e.id) } | ||
rescue => e | ||
puts "(#{e.message})" | ||
end | ||
|
||
Dir["tmp/exports/**.zip"].each { |zip_path| FileUtils.rm_rf(zip_path) } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.