Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #12 from kachick/improve-remove_warnings

Remove some warnings
  • Loading branch information...
commit 913bb7fc4cf9cf533b5813e781c02976fa0f1d5a 2 parents 2ec711e + ed194b7
@aquasync authored
View
1  lib/ole/storage/base.rb
@@ -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
View
6 lib/ole/storage/meta_data.rb
@@ -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
View
2  lib/ole/types/property_set.rb
@@ -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
View
4 test/test_filesystem.rb
@@ -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"))
}
Please sign in to comment.
Something went wrong with that request. Please try again.