On 17/04/12 16:47 +0200, Vít Ondruch wrote:
Dne 17.4.2012 16:20, Jason Guiditta napsal(a):
On 17/04/12 15:53 +0200, Michal Fojtik wrote:
On 04/17/12, Mo Morsi wrote:
Hi,
diff --git a/Rakefile b/Rakefile index e43f22b..59cb58b 100644 --- a/Rakefile +++ b/Rakefile @@ -19,7 +19,7 @@ require 'rubygems/package_task' require 'rdoc/task' require 'rake/testtask' require 'rspec/core/rake_task' -require 'rake/rpmtask' +require './rake/rpmtask'
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
?
Vit
Yes, there are a number of those, that is precisely what I was getting at.
-j