Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (35 sloc) 1.161 kB
# Caution! This file is auto-generated
require 'pathname'
unless defined? $CONFIG_INCLUDED and $CONFIG_INCLUDED
$CONFIG_INCLUDED = true
module AppConfig
Package = "<%= PKG_NAME %>"
Version = "<%= PKG_VERSION %>"
RootDir = Pathname.new(File.join(File.dirname(__FILE__), "..")).realpath.to_s
LibDir = File.dirname(__FILE__)
end
# We need this function because finding our dirs relative to the test folder
# will sometimes cause us to end up with duplicates (i.e. 'test/../lib' and
# 'lib'), and this confuses 'require' and gives us weird errors
def path_add(path)
real_path = Pathname.new(path).realpath.to_s
$:.unshift real_path unless $:.include? real_path
path_filter
end
def path_remove(path)
real_path = Pathname.new(path).realpath.to_s
$:.delete_if {|x| Pathname.new(x).realpath.to_s == real_path}
end
def path_filter
tmp = $:.collect do |x|
begin Pathname.new(x).realpath.to_s rescue '' end
end
$:.clear
tmp.sort.uniq.each {|x| $:.unshift(x) unless x == ''}
end
# This is a stub so that our tests don't blow up, it gets redefined in main.rb
def logger
Logger.new("/dev/null")
end
path_add('.')
end
Jump to Line
Something went wrong with that request. Please try again.