Skip to content

Instantly share code, notes, and snippets.

@patrobinson
Last active August 29, 2015 14:18
Show Gist options
  • Save patrobinson/3ff278f264fdb1384a87 to your computer and use it in GitHub Desktop.
Save patrobinson/3ff278f264fdb1384a87 to your computer and use it in GitHub Desktop.
Get Puppet 2.7 to work with Ruby 1.9
# I can't believe I'm doing this horrible hack, but Puppet 2.7 doesn't support
# Ruby versions above 1.8.7. Due to all the testing requirements
# we need to run Ruby 1.9.3. The only bug I've hit so far with Puppet 2.7
# and Ruby 1.9.3 is the lack of a "collect" method for a String
# which just needs to return an array of itself
# Turns out this is an undocumented feature in Ruby 1.8
#
# Add this to your spec_helper.rb file for use with rspec-puppet
class String
def collect
[self]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment