The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
The transition to Win32API

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
The transition to Win32API Posted: May 2, 2006 6:20 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: The transition to Win32API
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
So far, so good. We've now got pure Ruby versions of win32-file-stat, win32-file, win32-sound, and win32-clipboard. The win32-process package is pretty much finished. I'm merely debating about how to handle the exit status from methods like Process.wait, since updating $? manually within Ruby is not really meant to be a valid operation. I make take Sam Tesla's suggestion (from a suggested win32-open3 patch) and add Process.exit_status and Process.last_status methods.

I'm glad I decided to use Win32API. It did require taking a step back and creating a separate package, windows-pr, so that I could keep the method and constant declarations separate and out of the main body of the code. Hopefully, the individual modules are useful to other people as well.

One of the other advantages of using Win32API over a C extension, I think, is that it creates a lower barrier to entry for folks who may want to contribute to the project, but who don't know C. True, you still have to have a clue about the Windows API function, but you only need to know what it does, not how to pass struct pointers, for example. Well, I'm hoping anyway.

In the process, I've gotten a lot better at understanding how to properly pack & unpack data structures, thanks in large part to Heesob.

Read: The transition to Win32API

Topic: Historias de la Guerra de Bases de Datos Previous Topic   Next Topic Topic: Can we trigger some .vimrc editing frenzy? Chapter (n): ruby-run-and-vsplit.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use