rayh/xcoder — pull request #55 by quirkey (2013-02-20 05:50:46+00:00)
Title: Json and formatting

This branch does a couple things that we needed/wanted to build our workspace based project with xcoder:

1) Using MutliJson instead of JSON - we try not to use the JSON gem because of version inconsistencies and have switched as many gems as we can to using MultiJson which lets the end user pick their backend. This was a simple change.
2) Allowing setting of the configuration on a workspace based build. This is a passable option to `xcodebuild` and we need it to set the configuration to Ad_Hoc even though thats not the default for the scheme.
3) Allowing you to turn off and filter output with a block in every builder command. This was just passing through the `show_output` and `&block` vars for the specific commands. In our project we have show_output = false and then use this lambda as the "filter":

```ruby
clean_output = lambda {|out|
if out !~ /^\s+/
out = out.strip
if out =~ /warning/i
say out, :yellow
elsif out =~ /(\=\=|EXECUTE)/
say out, :cyan
elsif out =~ /^error/i
say out, :red
elsif out =~ /\*\*/
say out, :green
else
say out
end
end
}
```
It may not look pretty but it makes the output from xcodebuild and package a lot easier to parse.

Thanks for the great and very useful project!