I tried installing the Ruby gem, but it failed with “MSYS2 could not be found. Please run ‘ridk install’ or download and install MSYS2 manually from https://msys2.github.io/”
You shouldn’t need to move tidy.exe, as the system will locate it through the path. But you should be able to specify the input and output file locations relative to your current directory.
COMMAND = "c:\\tidy.exe -utf8 -indent -xml -o %s %s" % ["output.txt", "input.txt"]
puts COMMAND
#Returns true if the command was found and run successfully, false otherwise.
result = system( COMMAND )
if result
puts "Command ran OK"
else
puts "Command failed"
end
Ruby has a lot of different ways to run an external command:
There are a couple of Ruby Gems that package the Tidy library. This would mean you’d get the functionality of Tidy inside Ruby, and you wouldn’t need to shell out to it. I don’t know if they work on Windows, however…