Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix File::NULL for ruby built with MinGW #60

Closed
wants to merge 1 commit into from

2 participants

@eregon

Otherwise it produces a "File not found error" dumped to stderr when doing, for example:

`git rev-parse --git-dir 2>#{File::NULL}`

This patch, however, will not work on JRuby, because RUBY_PLATFORM is always "java".
I don't know why they chose that, but I guess the only right way is then RbConfig::CONFIG['host_os'] (excluding parsing RUBY_DESCRIPTION). What do you think?

@eregon

Also, in MRI this is defined on File::Constants (so it's also available as IO::NULL).

@marcandre
Owner

Cool, thanks.
2.6.2 released.

@marcandre marcandre closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 19, 2012
  1. @eregon
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/backports/1.9.3/file.rb
View
2  lib/backports/1.9.3/file.rb
@@ -1,6 +1,6 @@
class File
NULL = case RUBY_PLATFORM
- when /mswin/i
+ when /mswin|mingw/i
'NUL'
when /amiga/i
'NIL:'
Something went wrong with that request. Please try again.