-
Notifications
You must be signed in to change notification settings - Fork 212
Closed
Description
Normally I expect open method to initialise something, yield it, ensure closing and return result of block. For example for File I will get 10 bytes from /dev/zero in result variable:
result = File.open('/dev/zero') do |f|
f.read(10)
endThis is not the case for SQLite3::Database.open, as it is an alias to method new, so when called with block, it will return the already closed instance of SQLite3::Database instead of block result.
Is there a reason not to return block result? Otherwise what do you think about changing this? From one side it is a breaking change, as someone maybe relying on it, from the other side - it is not explicitly documented that open will not return block result when called with block.
Metadata
Metadata
Assignees
Labels
No labels