cosmo0920 / windows-pr

A collection of Windows functions, constants and macros predefined for you for win32-api
23 stars 9 forks source link

process.rb : make windows_64?() a module_function and add a wrapper to system_info.rb #4

Closed DanRathbun closed 13 years ago

DanRathbun commented 13 years ago

process.rb : (line 150)

(1) make windows_64?() a module_function: module_function def windows_64?

method code as is

  end

(2) Add a wrapper method to system_info.rb to complement the other versioning methods. module_function def windows_64? require('windows/process') Process::windows_64? end The alternative to requireing 'windows/process' for the system_info.rb file, is to create API calls within the SystemInfo module for the IsWow64Process() and GetCurrentProcess() functions.

djberg96 commented 13 years ago

I can't make them module functions. If I do that they couldn't be mixed into classes. I'm not sure why you can't include them within another module. Perhaps there's a bug in windows-api?

Dan

DanRathbun commented 13 years ago

DJB said, "I can't make them module functions. If I do that they couldn't be mixed into classes." -- wrong see the the other thread.

DJB said," I'm not sure why you can't include them within another module." -- Because.. include() and extend() work differently depending upon if the receiver is a class or another module or an instance object. Generally.. the "mixin" instance methods get "mixed-into" classes but not modules; and the reverse for module methods.

djberg96 commented 13 years ago

As per the other thread, yes, I understand that they can be mixed in, but they become private, making them useless. Rejected.