[PATCH] update aeolus-image to support both ruby 1.8 and 1.9

Michal Fojtik mfojtik at redhat.com
Tue Apr 17 14:53:57 UTC 2012


On 04/17/12, Vít Ondruch wrote:

> >>I found personally this change to use relate path very frustrating in
> >>Ruby
> >>1.9. Fortunately there is a 'helper' in Ruby 1.9 that you can use to
> >>stop
> >>playing with $. variables:
> >>
> >>require_relative 'rake/rpmtask'
> >>
> >>In MRI1.8 there is no such method, but in Ruby you can just add it :-)
> >>
> >>unless Kernel.respond_to?(:require_relative)
> >> module Kernel
> >>   def require_relative(path)
> >>     require File.join(File.dirname(caller[0]), path.to_str)
> >>   end
> >> end
> >>end
> >>
> >> -- Michal
> >>
> >I like this approach, and woudl suggest we do the same - we may want
> >to consider a -compat package to hold this kind of stuff for ruby 1.8,
> >otherwise we end up with lots of projects duplicating this same block
> >of code.  Just a thought.
> >
> 
> 
> https://rubygems.org/gems/backports

Thanks Vit for this. Is there any chance to have this packaged? :-)

> 
> ?
> 
> Vit
> 
> 
> >-j
> >>-- 
> >>Michal Fojtik
> >>Sr. Software Engineer, Deltacloud API (http://deltacloud.org)
> 

-- 
Michal Fojtik
Sr. Software Engineer, Deltacloud API (http://deltacloud.org)



More information about the aeolus-devel mailing list