
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.
= rVM
rVM is the implementation of a VirtualMachine in pure Ruby. To clarify, no virtual machine as in VMWare that lets you virtualize a computer. But rather like ruby 1.9 or JRuby that both implement a virtual machine (written in C or Java) to execute Ruby code. Just that rVM takes it the other way around, it is written in ruby and lets you execute code within ruby.
= So what is so cool about that?
For once, the challenge to pull this off ;P. Then it has on huge advantage. It makes it pretty easy to give ruby programs a interface for scripting.
Now you might think 'wow cool but I could just use ruby!' that is right, and wrong. Imagine just short code snippets to make a query, perhaps you want to implement a SQL based language to let a user query data in your program? Also consider you want your website to allow user side scripts. I would not want to have ruby code executed for random visitors. Then again I might be more tempted to let them execute code within a VM that has no access to anything outside it's VM neither variables nor hardware nor memory.
= Example
The following example implements a pretty easy calculator using the the math language shipped with rVM. Set variables and are not used outside one line
require 'rubygems' require 'rvm' # This loads the rVM gem require 'rvm/languages/math' #This loads the math plugin as well as the math function library s ='' compiler = RVM::Languages[:math].new #Lets get us the compiler while s!= 'QUIT' s=gets.chomp puts compiler.compile(s).execute(compiler.env) # We pass an fresh environment as we don't need an environment. end
Here one example that keeps set variables due to using one environment for all the calls.
require 'rubygems' require 'rvm' # This loads the rVM gem require 'rvm/languages/math' #This loads the math plugin as well as the math function library s ='' compiler = RVM::Languages[:math].new #Lets get us the compiler env = compiler.env while s!= 'QUIT' s=gets.chomp puts compiler.compile(s).execute(env) # We pass an fresh environment as we don't need an environment. end
FAQs
Unknown package
We found that rVM demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.