Add feature check for backports under Ruby 1.8.7
This commit is contained in:
		
							parent
							
								
									9cd4fd14a9
								
							
						
					
					
						commit
						d5d977eced
					
				| 
						 | 
					@ -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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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'])
 | 
				
			||||||
		Loading…
	
		Reference in New Issue