summaryrefslogtreecommitdiff
path: root/lib/chef/win32/version.rb
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2014-06-18 17:00:23 -0700
committerClaire McQuin <claire@getchef.com>2014-06-19 15:29:24 -0700
commitf4fc9dfa580997369952e9d26da2bb63dc9d569d (patch)
tree76f9393a0a0139113e047cbb78ef8eb3d10f94d3 /lib/chef/win32/version.rb
parentd8592902ae09980552f8dd57abe9ed9c76851445 (diff)
downloadchef-f4fc9dfa580997369952e9d26da2bb63dc9d569d.tar.gz
Use FFI binders to attach :SendMessageTimeout instead of Win32API in order to disable annoying message of:
DL is deprecated, please use Fiddle
Diffstat (limited to 'lib/chef/win32/version.rb')
-rw-r--r--lib/chef/win32/version.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb
index 233e31fe76..d2138289f5 100644
--- a/lib/chef/win32/version.rb
+++ b/lib/chef/win32/version.rb
@@ -23,6 +23,10 @@ require 'wmi-lite/wmi'
class Chef
module ReservedNames::Win32
class Version
+ class << self
+ include Chef::ReservedNames::Win32::API::System
+ end
+
include Chef::ReservedNames::Win32::API::Macros
include Chef::ReservedNames::Win32::API::System
@@ -33,12 +37,12 @@ class Chef
private
def self.get_system_metrics(n_index)
- Win32API.new('user32', 'GetSystemMetrics', 'I', 'I').call(n_index)
+ GetSystemMetrics(n_index)
end
def self.method_name_from_marketing_name(marketing_name)
"#{marketing_name.gsub(/\s/, '_').gsub(/\./, '_').downcase}?"
- # "#{marketing_name.gsub(/\s/, '_').gsub(//, '_').downcase}?"
+ # "#{marketing_name.gsub(/\s/, '_').gsub(//, '_').downcase}?"
end
public