I used some code from a github based which is used to handle testing and compiling of code. In it there is an extension to the command available to Ceedling (The test harness that I will be using) which uses Ruby in a file called "rakefile.rb".
I am trying to run the following command:
desc "Convert the output binary to a hex file"
task :convert => :release do
cmd = "\"C:/Program Files (x86)/Microchip/xc16/v1.23/bin\"\\\\xc16-bin2hex ./build/release/Output.elf -a -omf=elf"
puts "Generating Output.hex..."
puts cmd
sh cmd
end
If I put the code, below, in to my "Start Command Prompt With Ruby" program, then the output is correct and the action is taken:
"C:/Program Files (x86)/Microchip/xc16/v1.23/bin"\\xc16-bin2hex ./build/release/Output.elf -a -omf=elf
If I don't include the \" and the \'s then the program will not work.
At present I get the output:
Generating Output.hex...
"C:/Program Files (x86)/Microchip/xc16/v1.23/bin"\\xc16-bin2hex ./build/release/Output.elf -a -omf=elf
rake aborted!
Command failed with status (127): ["C:/Program Files (x86)/Microchip/xc16/v1....]
rakefile.rb:16:in `block in <top (required)>'
C:/Ruby24-x64/bin/ceedling:23:in `load'
C:/Ruby24-x64/bin/ceedling:23:in `<main>'
Tasks: TOP => convert
(See full trace by running task with --trace)
What am I doing wrong and where can I read more about the basics of Ruby?