dblessing / rundeck-ruby

Rundeck Ruby Client - A Ruby wrapper around the Rundeck API
http://blessing.io/rundeck-ruby/
BSD 2-Clause "Simplified" License
17 stars 11 forks source link

boolean type not preserved #30

Closed kamaradclimber closed 9 years ago

kamaradclimber commented 9 years ago

It seems this gem does not decode boolean properly.

See https://github.com/criteo-cookbooks/rundeck-server/blob/master/providers/job.rb#L126 for an example with sequence.keepgoing parameter.

kamaradclimber commented 9 years ago

cc @rveznaver

dblessing commented 9 years ago

@kamaradclimber I'm not sure if I can do anything about this. If you look at the raw XML that is returned - https://github.com/dblessing/rundeck-ruby/blob/master/spec/cassettes/12/job.yml#L36 - you see that the boolean is returned in quotes and handed to HTTParty for parsing. In order to address this I would have to loop through all key/val returned and look for true/false and transform to a boolean, I think.

I'm open to suggestions if there's a way you think I can accomplish boolean values easily.

kamaradclimber commented 9 years ago

Thanks for your answer. Your example has indeed a quoted boolean.

However documentation defines parameters as boolean and give example without string: http://rundeck.org/docs/man5/job-xml.html#multipleexecutions (using `true`` syntax). In XML it seems also that attributes are always quoted regardless of their type (http://www.w3schools.com/schema/schema_dtypes_misc.asp). I can't find any xml schema description that would give the correct format.

dblessing commented 9 years ago

Yeah that makes sense. So, you agree that there is probably not a way to get boolean types?

kamaradclimber commented 9 years ago

Apart from parsing strings to check for true/false or finding the xld, I don't think there is.

On Fri, Feb 20, 2015 at 9:12 PM, Drew Blessing notifications@github.com wrote:

Yeah that makes sense. So, you agree that there is probably not a way to get boolean types?

— Reply to this email directly or view it on GitHub https://github.com/dblessing/rundeck-ruby/issues/30#issuecomment-75310723 .

Grégoire