summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-04-21 13:34:55 +0900
committergit <svn-admin@ruby-lang.org>2023-04-21 04:46:10 +0000
commitb9b43a10202573431ae211984b02c28792f58ef8 (patch)
tree7be2f830b8db79286e507babf2f1045c5f872708 /ext
parent9702a8142b8a4e97cde983300849590bfe73b8b1 (diff)
downloadruby-b9b43a10202573431ae211984b02c28792f58ef8.tar.gz
[ruby/win32ole] Reuse WIN32OLE_VERSION for gem version
https://github.com/ruby/win32ole/commit/bff3ea8b0b
Diffstat (limited to 'ext')
-rw-r--r--ext/win32ole/win32ole.c2
-rw-r--r--ext/win32ole/win32ole.gemspec12
2 files changed, 12 insertions, 2 deletions
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"]