Sha256: 5056d94fb0ce6cc242d4c18b041aac79afcab006a175a91b292c95920e7b4cc8
Contents?: true
Size: 823 Bytes
Versions: 25
Compression:
Stored size: 823 Bytes
Contents
RSpec::Matchers.define :have_version do |version| match do |file| version_dll = Fiddle.dlopen('version.dll') s='' vsize = Fiddle::Function.new(version_dll['GetFileVersionInfoSize'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP], Fiddle::TYPE_LONG).call(file.name, s) raise 'Unable to determine the version number' unless vsize > 0 result = ' '*vsize Fiddle::Function.new(version_dll['GetFileVersionInfo'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_LONG, Fiddle::TYPE_LONG, Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP).call(file.name, 0, vsize, result) rstring = result.unpack('v*').map{|s| s.chr if s<256}*'' r = /FileVersion..(.*?)\000/.match(rstring) r[1] == version end end
Version data entries
25 entries across 25 versions & 1 rubygems