diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-26 15:25:33 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-26 15:46:37 -0800 |
commit | 17ce9fd39a669116c7a017afed9c4c64dc49a452 (patch) | |
tree | d701cb0803d74fd4a42ab9f5c4e79af6857472d0 | |
parent | a15a010c351c12271d090a35c855c5fe8135297c (diff) | |
download | ohai-17ce9fd39a669116c7a017afed9c4c64dc49a452.tar.gz |
Use escape_glob_dir instead of escape_glob
For ruby >= 2.2, Dir.glob behaves differently than ruby 2.0
and breaks in more places when backslashes are used when globbing.
This means that Windows is sad and will not load any plugins with
Ruby >= 2.2 in a lot of cases. This is the safest thing to do
because it will use forward slashes.
-rw-r--r-- | lib/ohai/loader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb index 6680be90..0328b59e 100644 --- a/lib/ohai/loader.rb +++ b/lib/ohai/loader.rb @@ -39,7 +39,7 @@ module Ohai # Finds all the *.rb files under the configured paths in :plugin_path def self.find_all_in(plugin_dir) - Dir[File.join(ChefConfig::PathHelper.escape_glob(plugin_dir), "**", "*.rb")].map do |file| + Dir[File.join(ChefConfig::PathHelper.escape_glob_dir(plugin_dir), "**", "*.rb")].map do |file| new(file, plugin_dir) end end |