summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2013-01-18 21:17:44 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:22 -0700
commit3b16515eadd22e28ac879bf0582b341c9c4a690c (patch)
treef7f322360e5473e71e699a1131073c0fcee8c3d7 /lib
parent54a28ff3336b08e83ae7f2a6903c7a7f97bb4b78 (diff)
downloadchef-3b16515eadd22e28ac879bf0582b341c9c4a690c.tar.gz
Support backslash on Windows
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/chef_fs.rb6
-rw-r--r--lib/chef/chef_fs/file_system/chef_server_root_dir.rb1
-rw-r--r--lib/chef/chef_fs/path_utils.rb2
3 files changed, 4 insertions, 5 deletions
diff --git a/lib/chef/chef_fs.rb b/lib/chef/chef_fs.rb
index 14ab8c0a6e..bc445e53ad 100644
--- a/lib/chef/chef_fs.rb
+++ b/lib/chef/chef_fs.rb
@@ -1,11 +1,9 @@
-require 'chef/chef_fs/file_system/chef_server_root_dir'
-require 'chef/config'
-require 'chef/rest'
+require 'chef/platform'
class Chef
module ChefFS
def self.windows?
- false
+ Chef::Platform.windows?
end
end
end
diff --git a/lib/chef/chef_fs/file_system/chef_server_root_dir.rb b/lib/chef/chef_fs/file_system/chef_server_root_dir.rb
index 41b8a455dc..b359be9623 100644
--- a/lib/chef/chef_fs/file_system/chef_server_root_dir.rb
+++ b/lib/chef/chef_fs/file_system/chef_server_root_dir.rb
@@ -22,6 +22,7 @@ require 'chef/chef_fs/file_system/cookbooks_dir'
require 'chef/chef_fs/file_system/data_bags_dir'
require 'chef/chef_fs/file_system/nodes_dir'
require 'chef/chef_fs/file_system/environments_dir'
+require 'chef/rest'
class Chef
module ChefFS
diff --git a/lib/chef/chef_fs/path_utils.rb b/lib/chef/chef_fs/path_utils.rb
index e6483c3d0a..805b092b3a 100644
--- a/lib/chef/chef_fs/path_utils.rb
+++ b/lib/chef/chef_fs/path_utils.rb
@@ -57,7 +57,7 @@ class Chef
end
def self.regexp_path_separator
- Chef::ChefFS::windows? ? '[/\\]' : '/'
+ Chef::ChefFS::windows? ? '[\/\\\\]' : '/'
end
# Given a path which may only be partly real (i.e. /x/y/z when only /x exists,