Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Implement File::NULL #1994

merged 3 commits into from

2 participants


This change addresses rubyspec/rubyspec#160 and is based on

I wasn't sure if I should add the spec to this project, or rubyspec, or both? I submitted the PR to rubyspec, let me know if it needs to be submitted here.

Also, my first contributing to rbx, let me know where I got it wrong ;)


Please see the implementation of eg Rubinius.darwin? in the kernel. This needs to follow the same thing.

So, you'll need to add detection for those platforms, but only the ones that Rubinius actually compiles on. I'd be thrilled to see Rubinius running on Amiga, but I don't believe it does, unless you are running it there.

Look at how Rubinius.darwin? is used in FFI.

Finally, this constant should be added in kernel/common not kernel/delta

Thanks for working on this!


Perfect. That's exactly what I needed. I tried putting it in kernel/common but RUBY_PLATFORM wasn't defined yet, hence I put it in kernel/delta after it was defined. I knew I was missing something.

I put the new const back in kernel/common and removed those other platforms. I've honestly never used Amiga.


@jstorimer Thanks! One more style issue and we're done! Please set NULL for each value instead of that indented case. That indented multi-line expression is inconsistent with our coding style.


Done. I also swapped the case for an if since there was only one condition.

@brixen brixen merged commit a6389b5 into rubinius:master

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +8 −0 kernel/common/file19.rb
8 kernel/common/file19.rb
@@ -143,3 +143,11 @@ def world_writable?
+module File::Constants
+ if
+ NULL = 'NUL'
+ else
+ NULL = '/dev/null'
+ end
Something went wrong with that request. Please try again.