alup/puppet-rbenv — pull request #95 by gsamokovarov (2014-01-28 14:41:29+00:00)
Title: Support ruby compilation with piped patches

I just had to install an old Ruby `1.9.3-p448` on CentOS 6.4, however there is a known issue with compiling `2.0.0-p247` and lower on RedHat derivatives. See https://bugs.ruby-lang.org/issues/8384 for the issue. To do that, I needed to patch the Ruby, which I couldn't have done easily with the current version.

If you checkout the [ruby-build wiki], you can see other documented workaround utilising the recently added `--patch` functionality of ruby-build, so I think its worth trying to support it.

While I'm not sure that this is the best interface for it, it seems flexible enough to support my (most?) use cases. I'm currently using it like this:

```puppet
rbenv::compile { '1.9.3-p448':
# Its important to strip the changelog changes from the patch, as they
# won't apply. It's the first file, that's why we're not taking it.
patch => 'curl -fsSL https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff?format=diff | filterdiff --files=2,3',
user => $user
}
```

[ruby-build wiki]: https://github.com/sstephenson/ruby-build/wiki#troubleshooting