[ANN] os gem: initial release: easier platform management

R

Roger Pack

Initial release of the OS gem.
The OS gem allows for some easy telling if you're on windows or not.
=> true
=> 32
=> true
=> "c:\ruby18\bin\ruby.exe" # or "/usr/local/bin/ruby" or what not
=> false

If there are any other features you'd like, let me know.

github.com/rdp/os

Related:
Gem.ruby
Platform gem

-rp
 
P

Phillip Gawlowski

=> "c:\ruby18\bin\ruby.exe" # or "/usr/local/bin/ruby" or what not

I'd alias this to #ruby_bin since that is more natural on non-Windows
platforms.
=> false

If there are any other features you'd like, let me know.

I'd make #posix? more robust, too, since !OS.windows just tests if an OS
isn't Windows, not if it is POSIX compliant. ;)

Especially since Windows *can* have a POSIX subsystem:
http://en.wikipedia.org/wiki/Interix

And there's even a Ruby port for Interix:
http://debian-interix.net/
 
R

Roger Pack

Phillip said:
I'd alias this to #ruby_bin since that is more natural on non-Windows
platforms.

Good idea. I released a new version that only has ruby_bin :)
I'd make #posix? more robust, too, since !OS.windows just tests if an OS
isn't Windows, not if it is POSIX compliant. ;)

Good idea. Implemented a first hack at it, though I haven't download
interix' ruby to test it :)
-r
 
M

Marnen Laibow-Koser

Roger said:
Initial release of the OS gem.
The OS gem allows for some easy telling if you're on windows or not.

=> true

=> 32

=> true

=> "c:\ruby18\bin\ruby.exe" # or "/usr/local/bin/ruby" or what not

=> false

If there are any other features you'd like, let me know.

Does it do OS.mac? yet? If not, that would be nice, particularly for
JRuby/Swing apps where certain UI stuff is done differently for Mac OS.
github.com/rdp/os

Related:
Gem.ruby
Platform gem

-rp

Best,
 
R

Roger Pack

Does it do OS.mac? yet? If not, that would be nice, particularly for
JRuby/Swing apps where certain UI stuff is done differently for Mac OS.

Great idea.
-r
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,423
Latest member
henerygril

Latest Threads

Top