Permalink
Browse files
Merge pull request #12 from kachick/improve-remove_warnings
- Loading branch information...
|
@@ -229,7 +229,6 @@ def flush |
|
|
# delete a lot of stuff, and free up trailing blocks, the file size never shrinks. this can
|
|
|
# be fixed easily, add an io truncate
|
|
|
@bbat.truncate!
|
|
|
- before = @io.size
|
|
|
@io.truncate @bbat.block_size * (@bbat.length + 1)
|
|
|
while true
|
|
|
# get total bbat size. equivalent to @bbat.to_s.length, but for the factoring in of
|
|
|
|
@@ -76,8 +76,8 @@ def comp_obj |
|
|
# byte_order: 0xffe
|
|
|
# windows_version: 0x00000a03 (win31 apparently)
|
|
|
# marker: 0xffffffff
|
|
|
- compobj_version, byte_order, windows_version, marker, clsid =
|
|
|
- data.unpack("vvVVa#{Types::Clsid::SIZE}")
|
|
|
+ # compobj_version, byte_order, windows_version, marker, clsid =
|
|
|
+ # data.unpack("vvVVa#{Types::Clsid::SIZE}")
|
|
|
strings = []
|
|
|
i = 28
|
|
|
while i < data.length
|
|
@@ -137,7 +137,7 @@ def to_h |
|
|
|
|
|
def method_missing name, *args, &block
|
|
|
return super unless args.empty?
|
|
|
- pair = Types::PropertySet::PROPERTY_MAP[name.to_s] or return super
|
|
|
+ return super unless Types::PropertySet::PROPERTY_MAP[name.to_s]
|
|
|
self[name]
|
|
|
end
|
|
|
end
|
|
|
|
@@ -68,7 +68,7 @@ class PropertySet |
|
|
end
|
|
|
|
|
|
module Constants
|
|
|
- DATA.each { |guid, (name, map)| const_set name, guid }
|
|
|
+ DATA.each { |guid, (name, _)| const_set name, guid }
|
|
|
end
|
|
|
|
|
|
include Constants
|
|
|
|
@@ -594,20 +594,24 @@ def test_open_write |
|
|
Ole::Storage.open(@io) {
|
|
|
|zf|
|
|
|
|
|
|
+ blockCalled = nil
|
|
|
zf.file.open("test_open_write_entry", "w") {
|
|
|
|f|
|
|
|
blockCalled = true
|
|
|
f.write "This is what I'm writing"
|
|
|
}
|
|
|
+ assert(blockCalled)
|
|
|
assert_equal("This is what I'm writing",
|
|
|
zf.file.read("test_open_write_entry"))
|
|
|
|
|
|
+ blockCalled = nil
|
|
|
# Test with existing entry
|
|
|
zf.file.open("file1", "w") {
|
|
|
|f|
|
|
|
blockCalled = true
|
|
|
f.write "This is what I'm writing too"
|
|
|
}
|
|
|
+ assert(blockCalled)
|
|
|
assert_equal("This is what I'm writing too",
|
|
|
zf.file.read("file1"))
|
|
|
}
|
|
|
0 comments on commit
913bb7f