Shellwords should work for you 🙂
exec "/usr/bin/mplayer %s" % Shellwords.escape(song.file)
In ruby 1.9.x, it looks like you have to require
it first
require "shellwords"
But in ruby 2.0.x, I didn’t have to explicitly require it.
Shellwords should work for you 🙂
exec "/usr/bin/mplayer %s" % Shellwords.escape(song.file)
In ruby 1.9.x, it looks like you have to require
it first
require "shellwords"
But in ruby 2.0.x, I didn’t have to explicitly require it.