Permalink
Browse files

fixed some expand_paths to handle symlinks right

  • Loading branch information...
1 parent a58a3ae commit 9e21b58b2c7f566c1362f25c2dbdc683afeb000e Philip (flip) Kromer committed Feb 18, 2012
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require File.expand_path('spec_helper', File.dirname(__FILE__))
require SILVERWARE_DIR("libraries/silverware")
require SILVERWARE_DIR("libraries/aspects")
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require File.expand_path('spec_helper', File.dirname(__FILE__))
require SILVERWARE_DIR("libraries/silverware")
require SILVERWARE_DIR("libraries/aspects")
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require File.expand_path('spec_helper', File.dirname(__FILE__))
require SILVERWARE_DIR("libraries/silverware.rb")
describe Ironfan::AttrStruct do
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require File.expand_path('spec_helper', File.dirname(__FILE__))
require SILVERWARE_DIR("libraries/silverware.rb")
require SILVERWARE_DIR("libraries/aspects")
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require File.expand_path('spec_helper', File.dirname(__FILE__))
require SILVERWARE_DIR("libraries/silverware")
require SILVERWARE_DIR("libraries/aspects")
@@ -1,6 +1,6 @@
require 'rspec'
-SILVERWARE_DIR = File.expand_path(File.dirname(__FILE__)+'/..') unless defined?(SILVERWARE_DIR)
+SILVERWARE_DIR = File.expand_path("..", File.realdirpath(File.dirname(__FILE__))) unless defined?(SILVERWARE_DIR)
def SILVERWARE_DIR(*paths) File.join(SILVERWARE_DIR, *paths); end
require 'chef/node'
View
@@ -32,7 +32,7 @@ NEW_COOKBOOK_LICENSE = :apachev2
###
# The top of the repository checkout
-TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+TOPDIR = File.expand_path("..", File.realdirpath(File.dirname(__FILE__)))
# Where to store certificates generated with ssl_cert
CADIR = File.expand_path(File.join(TOPDIR, "certificates"))

0 comments on commit 9e21b58

Please sign in to comment.