travis-ci/travis-build — pull request #274 by svenfuchs (2014-07-29 14:25:18+00:00)
Title: Refactor to use an intermediate sexp representation

This builds on https://github.com/travis-ci/travis-build/pull/272, so ignore all commits listed below, except the ones starting at 1df4645 "refactor to use an intermediate sexp representation".

This separates things clearly into these layers:

* `Travis::Shell::Generator::Bash` generates Bash code out of an intermediate sexp tree
* `Travis::Shell::Ast` contains AST node classes that spit out the sexp tree
* `Travis::Shell::Builder` defines a DSL to build up the AST tree
* `Travis::Build::Script::Ruby` defines the build script using the DSL defined by the builder

Lots of previous inconsistencies regarding the AST building DSL were removed. E.g. there's no `self.if ... do |sh| sh,cmd end` any more. Instead we now always use `sh.[method]` in `Travis::Build::Script.*`, e.g. https://github.com/travis-ci/travis-build/blob/1df4645f4a43c446a05a250433d00ed810f9415f/lib/travis/build/script/langs/android.rb#L20-L32

I have also already moved some Bash specific code to the DSL and Bash generator, e.g. `echo foo > ./path/to/file`. E.g. https://github.com/travis-ci/travis-build/blob/sf-sexp/lib/travis/shell/builder.rb#L63-L89 From here on it would be easy to extract more such commands for Windows support, and add a Powershell generator.