tags:

views:

138

answers:

1

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?

+2  A: 

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.

Aaron Hinni
That works. Thank you.
Bryan Oakley