Add feature check for backports under Ruby 1.8.7

This commit is contained in:
Charlie Sharpsteen 2014-05-30 09:59:55 -07:00
parent 9cd4fd14a9
commit d5d977eced
2 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,10 @@ Puppet::Face.define(:yardoc, '0.0.1') do
raise RuntimeError, "The 'rgen' gem must be installed in order to use this face." raise RuntimeError, "The 'rgen' gem must be installed in order to use this face."
end end
if RUBY_VERSION < '1.9' && !Puppet.features.require_relative?
raise RuntimeError, "The 'backports' gem must be installed in order to use this face under Ruby 1.8.7."
end
# The last element of the argument array should be the options hash. # The last element of the argument array should be the options hash.
# #
# NOTE: The Puppet Face will throw 'unrecognized option' errors if any # NOTE: The Puppet Face will throw 'unrecognized option' errors if any

View File

@ -0,0 +1,4 @@
require 'puppet/util/feature'
# Support require_relative under Ruby 1.8.7.
Puppet.features.add(:require_relative, :libs => ['backports/1.9.1/kernel/require_relative'])