From b9b43a10202573431ae211984b02c28792f58ef8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 21 Apr 2023 13:34:55 +0900 Subject: [ruby/win32ole] Reuse WIN32OLE_VERSION for gem version https://github.com/ruby/win32ole/commit/bff3ea8b0b --- ext/win32ole/win32ole.c | 2 +- ext/win32ole/win32ole.gemspec | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 3f083bb12d..f630e657cd 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -27,7 +27,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}}; #endif -#define WIN32OLE_VERSION "1.8.8" +#define WIN32OLE_VERSION "1.8.9" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); diff --git a/ext/win32ole/win32ole.gemspec b/ext/win32ole/win32ole.gemspec index b6ea8e8a55..9c137a5d70 100644 --- a/ext/win32ole/win32ole.gemspec +++ b/ext/win32ole/win32ole.gemspec @@ -1,6 +1,16 @@ +source_version = ["", "ext/win32ole/"].find do |dir| + begin + break File.open(File.join(__dir__, "#{dir}win32ole.c")) {|f| + f.gets("\n#define WIN32OLE_VERSION ") + f.gets[/\s*"(.+)"/, 1] + } + rescue Errno::ENOENT + end +end + Gem::Specification.new do |spec| spec.name = "win32ole" - spec.version = "1.8.9" + spec.version = source_version spec.authors = ["Masaki Suketa"] spec.email = ["suke@ruby-lang.org"] -- cgit v1.2.1