Skip to content

Commit

Permalink
more efficient code to find the REFINERY_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Oct 8, 2009
1 parent d9db60b commit 03ce7be
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/refinery_initializer.rb
@@ -1,7 +1,4 @@
# Get library path without '..' directories.
dir_parts = (File.join File.dirname(__FILE__), '..').split(File::SEPARATOR)
dir_parts = dir_parts[0..(dir_parts.length-3)] until dir_parts[dir_parts.length-1] != ".."
REFINERY_ROOT = File.join dir_parts
REFINERY_ROOT = File.expand_path(File.dirname(__FILE__) << "/..")

unless REFINERY_ROOT == RAILS_ROOT # e.g. only if we're in a gem.
$LOAD_PATH.unshift "#{REFINERY_ROOT}/vendor/plugins"
Expand Down

0 comments on commit 03ce7be

Please sign in to comment.