Module: Berkshelf::Mixin::PathHelpers
- Included in:
- Chef::Config
- Defined in:
- lib/berkshelf/mixin/path_helpers.rb
Overview
Instance Method Summary collapse
-
#platform_specific_path(path) ⇒ String
Converts a path to a path usable for your current platform.
-
#win_slashify(path) ⇒ String
Convert a unixy filepath to a windowsy filepath.
Instance Method Details
#platform_specific_path(path) ⇒ String
Converts a path to a path usable for your current platform
9 10 11 12 13 14 15 16 |
# File 'lib/berkshelf/mixin/path_helpers.rb', line 9 def platform_specific_path(path) if RUBY_PLATFORM =~ /mswin|mingw|windows/ system_drive = ENV['SYSTEMDRIVE'] ? ENV['SYSTEMDRIVE'] : "" path = win_slashify File.join(system_drive, path.split('/')[2..-1]) end path end |