rdp / os

The OS gem allows for some easy telling if you’re on windows or not. OS.windows? as well as some other helper utilities
MIT License
145 stars 33 forks source link

Support for Windows Subsystem Linux #30

Open jaxn opened 7 years ago

jaxn commented 7 years ago

When Ruby is running inside of WSL, it can be difficult to tell the difference between truly running on Linux and running within WSL.

The best way I have found to identify if it is WSL is...

def self.wsl?
  `cat /proc/version` =~ /Microsoft/ if linux?
end

I am happy to submit a patch and test if wanted.

rdp commented 7 years ago

sure

On Mon, Aug 21, 2017 at 11:19 AM, Jackson Miller notifications@github.com wrote:

When Ruby is running inside of WSL, it can be difficult to tell the difference between truly running on Linux and running within WSL.

The best way I have found to identify if it is WSL is...

def self.wsl? cat /proc/version =~ /Microsoft/ if linux? end

I am happy to submit a patch and test if wanted.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdp/os/issues/30, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAw0AZBMhETCl5qXwAnrU09xxuXLtoCks5sabwJgaJpZM4O9ngT .