diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-09-29 14:57:51 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-09-29 15:01:47 -0700 |
commit | ed3f76c6f0c2a9e925af32ffb8c28878f34eea9e (patch) | |
tree | 87ef4319f02a25f1b2d78148df4469bdffce17d6 /lib/chef/util | |
parent | 4098cf801f8d991ab163f5ce21b81c7807dde6ff (diff) | |
download | chef-ed3f76c6f0c2a9e925af32ffb8c28878f34eea9e.tar.gz |
Fixing cookbook loading for windows
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/path_helper.rb | 4 |
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 |