Add new CodeOcean::File#read method

* With a new method, we can simplify our code to handle differences between file.content and file.native_file.read
This commit is contained in:
Sebastian Serth
2022-08-19 22:34:24 +02:00
parent a9aab612b6
commit d762f976a8
8 changed files with 45 additions and 27 deletions

View File

@ -116,7 +116,7 @@ class Runner::Strategy::Poseidon < Runner::Strategy
copy = files.map do |file|
{
path: file.filepath,
content: Base64.strict_encode64(file.content.presence || file.native_file.read || ''),
content: Base64.strict_encode64(file.read || ''),
}
end