Tutorial :using ruby, how to create hexBinary data required by hudson's postBuildResult?



Question:

I'm wanting to submit build results to hudson via a ruby script. What little documentation I can find says the data within the tag is in "hexBinary" format. How do I take a simple ruby string like "Hello, world" and convert it to that format?


Solution:1

I am not sure about hudson, and am not positive that the following is hexBinary. But here is my best stab at it.

"Hello world".unpack("H*")  # => ["48656c6c6f20776f726c64"]  

So to just get the string...

"Hello world".unpack("H*").first  

I am confused about the hexBinary format, as I couldn't find any definitive examples on what it really is.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »