Skip to content

Commit

Permalink
Merge pull request #876 from samvera/file_close
Browse files Browse the repository at this point in the history
Files should respond to #close.
  • Loading branch information
eliotjordan authored Oct 18, 2021
2 parents 60b5a4f + 5db467b commit 5ca68fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/valkyrie/specs/shared_specs/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
it { is_expected.to respond_to(:read) }
it { is_expected.to respond_to(:rewind) }
it { is_expected.to respond_to(:id) }
it { is_expected.to respond_to(:close) }
describe "#disk_path" do
it "returns an existing disk path" do
expect(File.exist?(file.disk_path)).to eq true
Expand Down
2 changes: 1 addition & 1 deletion lib/valkyrie/storage_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def adapter_for(id:)
class File < Dry::Struct
attribute :id, Valkyrie::Types::Any
attribute :io, Valkyrie::Types::Any
delegate :size, :read, :rewind, to: :io
delegate :size, :read, :rewind, :close, to: :io
def stream
io
end
Expand Down

0 comments on commit 5ca68fa

Please sign in to comment.