
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
= open-temporary the "real file" temporary one.
OK, so you dropped into a tempfile pitfall. Like Rails.
https://github.com/rails/rails/pull/2068
Why not just fix the situation so that you can safely dup?
= How to use it?
You first add
gem "open-temporary"
to your Gemfile, then from your .rb file,
require 'open-temporary'
And that's it. Now you have the "open" method extended, just like the open-uri standard library.
File.open # => gives you a temporary file
This time the null (zero-arity) argument indicates this is a temporary file. You get a REAL instance of File, no proxy, no tweak. It can be dup'ed, it can be used with process forks, and still, you can just leave it, and the GC reclaims the whole resources.
= Great! So why this isn't a standard?
Because it has absolutely zero portability. The magic behind the scene is that we just let your operating system to reclaim what's necessary. That way, the behaviour detail is much much OS specific. Especially, this kind of API is not doable on a Windows environment. Might not also on Java (not sure). So this can never be a part of gospel ruby.
FAQs
Unknown package
We found that open-temporary demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.