summaryrefslogtreecommitdiff
path: root/lib/chef/util
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-09-29 14:57:51 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2014-09-29 15:01:47 -0700
commited3f76c6f0c2a9e925af32ffb8c28878f34eea9e (patch)
tree87ef4319f02a25f1b2d78148df4469bdffce17d6 /lib/chef/util
parent4098cf801f8d991ab163f5ce21b81c7807dde6ff (diff)
downloadchef-ed3f76c6f0c2a9e925af32ffb8c28878f34eea9e.tar.gz
Fixing cookbook loading for windows
Diffstat (limited to 'lib/chef/util')
-rw-r--r--lib/chef/util/path_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/util/path_helper.rb b/lib/chef/util/path_helper.rb
index 8ca8279593..26c9c76fe5 100644
--- a/lib/chef/util/path_helper.rb
+++ b/lib/chef/util/path_helper.rb
@@ -141,6 +141,10 @@ class Chef
path = cleanpath(join(*parts))
path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\"+x }
end
+
+ def self.relative_path_from(from, to)
+ pathname = Pathname.new(Chef::Util::PathHelper.cleanpath(to)).relative_path_from(Pathname.new(Chef::Util::PathHelper.cleanpath(from)))
+ end
end
end
end