Permalink
Browse files

Accept relative paths

  • Loading branch information...
mjackson committed Jan 25, 2011
1 parent 4358f24 commit e0fc135481711b75f309c7b6a60d52d53969f52b
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/citrus.rb
View
@@ -102,8 +102,10 @@ def self.require(file, options={})
file += '.citrus' unless /\.citrus$/ === file
found = nil
- (Pathname.new(file).absolute? ? [''] : $LOAD_PATH).each do |dir|
- found = Dir[::File.join(dir, file)].first
+ paths = ['']
+ paths += $LOAD_PATH unless Pathname.new(file).absolute?
+ paths.each do |path|
+ found = Dir[::File.join(path, file)].first
break if found
end

0 comments on commit e0fc135

Please sign in to comment.