Aim
Compare installed chocolatey package with latest available version on Chocolatey Gallery, install (cinst packageName
) latest if latest version > installed version.
Problem
Code from this post which works for java -version
has been used to read the output from clist -lo
.
command = "clist -lo"
require 'open3'
Open3.popen3(command) do | stdrin, stdout, stderr|
p stderr.read
p stdout.read
end
Nor stderr.read
neither stdout.read
returns the output while the command prompt does. The path variables are correct. Executing clist -lo
using cmd on a default path returns the list of installed Chocolatey Packages.
Question
How to get the output from clist -lo
using Ruby?