CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/ntpath.rb
Views: 1904
1
# frozen_string_literal: true
2
3
module Rex
4
module Ntpath
5
6
# @param [String] path The path to convert into a valid ntpath format
7
def self.as_ntpath(path)
8
Pathname.new(path)
9
.cleanpath
10
.each_filename
11
.drop_while { |file| file == '.' }
12
.join('\\')
13
end
14
end
15
end
16
17