module

Noir::WindowsPaths

noir handles every path as a /-separated string: the walk, the analyzers' scope and convention checks, the import graph and the reported code_path all match on /. On Windows the stdlib builds paths with \ instead, so a path from File.join and the same path from the walk compared unequal and whole projects reported nothing.

Rather than route ~800 File.join / File.expand_path call sites through a helper, the path-producing stdlib methods return / on Windows. Every Windows file API accepts /, and \ can't appear in a Windows file name, so the swap is lossless. Compiled out everywhere else.

Class methods

to_slash(path : String) : String

\ to /, except for an extended-length path (\\?\C:\...): Windows passes those to the filesystem verbatim, so / there is not a separator.

Source