From 0eb6ec1158dd0cb311bade593ca7f19763e63c78 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Sat, 24 May 2014 16:49:54 -0700 Subject: [PATCH] Support Ruby 1.8.7 using backports The YARD plugin is currently architected using `require_relative` so that it can be loaded outside of Puppet. Unfortunately, `require_relative` first appeared in Ruby 1.9.1. Achieve compatibility using the Backports gem. --- lib/puppetx/yardoc/yard/plugin.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/puppetx/yardoc/yard/plugin.rb b/lib/puppetx/yardoc/yard/plugin.rb index adcde12..4cc4e7d 100644 --- a/lib/puppetx/yardoc/yard/plugin.rb +++ b/lib/puppetx/yardoc/yard/plugin.rb @@ -1,3 +1,8 @@ +# TODO: Decide if supporting 1.8.7 is really worth it. +if RUBY_VERSION < '1.9' + require 'backports/1.9.1/kernel/require_relative' +end + require_relative 'parser' require_relative 'handlers'