ruby-ole 1.2.8 → 1.2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +6 -2
- data/README +5 -0
- data/lib/ole/storage/base.rb +2 -2
- data/lib/ole/support.rb +4 -0
- data/lib/ole/types/property_set.rb +2 -2
- data/test/test_storage.rb +1 -1
- metadata +2 -2
data/ChangeLog
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
== 1.2.8.1 / 2008-10-22
|
2
|
+
|
3
|
+
- Fix a couple of breakages when using $KCODE = 'UTF8'
|
4
|
+
|
1
5
|
== 1.2.8 / 2008-10-08
|
2
6
|
|
3
|
-
-
|
4
|
-
-
|
7
|
+
- Check in the new fixes to the mbat support.
|
8
|
+
- Update README to be a bit more useful.
|
5
9
|
|
6
10
|
== 1.2.7 / 2008-08-12
|
7
11
|
|
data/README
CHANGED
@@ -91,6 +91,10 @@ See the documentation for each class for more details.
|
|
91
91
|
'a+' modes etc. done?
|
92
92
|
* make ranges io obey readable vs writeable modes.
|
93
93
|
* more RangesIO completion. ie, doesn't support #<< at the moment.
|
94
|
+
* maybe some oletool doc.
|
95
|
+
* make sure `rake test' runs tests both with $KCODE='UTF8', and without,
|
96
|
+
and maybe ensure i don't regress on 1.9 and jruby either now that they're
|
97
|
+
fixed.
|
94
98
|
|
95
99
|
== 1.3.1
|
96
100
|
|
@@ -99,6 +103,7 @@ See the documentation for each class for more details.
|
|
99
103
|
* case insensitive mode for ole/file_system?
|
100
104
|
* better tests for mbat support.
|
101
105
|
* further doc cleanup
|
106
|
+
* add in place testing for jruby and ruby1.9
|
102
107
|
|
103
108
|
== Longer term
|
104
109
|
|
data/lib/ole/storage/base.rb
CHANGED
@@ -21,7 +21,7 @@ module Ole # :nodoc:
|
|
21
21
|
class FormatError < StandardError # :nodoc:
|
22
22
|
end
|
23
23
|
|
24
|
-
VERSION = '1.2.8'
|
24
|
+
VERSION = '1.2.8.1'
|
25
25
|
|
26
26
|
# options used at creation time
|
27
27
|
attr_reader :params
|
@@ -118,7 +118,7 @@ module Ole # :nodoc:
|
|
118
118
|
|
119
119
|
# get block chain for directories, read it, then split it into chunks and load the
|
120
120
|
# directory entries. semantics changed - used to cut at first dir where dir.type == 0
|
121
|
-
@dirents = @bbat.read(@header.dirent_start).
|
121
|
+
@dirents = @bbat.read(@header.dirent_start).to_enum(:each_chunk, Dirent::SIZE).
|
122
122
|
map { |str| Dirent.new self, str }.reject { |d| d.type_id == 0 }
|
123
123
|
|
124
124
|
# now reorder from flat into a tree
|
data/lib/ole/support.rb
CHANGED
@@ -16,6 +16,10 @@ class String # :nodoc:
|
|
16
16
|
# in some ways i'm surprised that $~ works properly in this case...
|
17
17
|
to_enum(:scan, /#{Regexp.quote string}/m).map { $~.begin 0 }
|
18
18
|
end
|
19
|
+
|
20
|
+
def each_chunk size
|
21
|
+
(length / size.to_f).ceil.times { |i| yield self[i * size, size] }
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
class File # :nodoc:
|
@@ -85,7 +85,7 @@ module Ole
|
|
85
85
|
|
86
86
|
def each_raw
|
87
87
|
io.seek offset + 8
|
88
|
-
io.read(length * 8).
|
88
|
+
io.read(length * 8).each_chunk(8) { |str| yield(*str.unpack('V2')) }
|
89
89
|
end
|
90
90
|
|
91
91
|
def read_property property_offset
|
@@ -119,7 +119,7 @@ module Ole
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def load_section_list str
|
122
|
-
@sections = str.
|
122
|
+
@sections = str.to_enum(:each_chunk, Section::SIZE).map { |s| Section.new s, self }
|
123
123
|
end
|
124
124
|
|
125
125
|
def [] key
|
data/test/test_storage.rb
CHANGED
@@ -166,7 +166,7 @@ class TestStorageRead < Test::Unit::TestCase
|
|
166
166
|
|
167
167
|
# test the ole storage type
|
168
168
|
type = 'Microsoft Word 6.0-Dokument'
|
169
|
-
assert_equal type, (@ole.root/"\001CompObj").read[
|
169
|
+
assert_equal type, (@ole.root/"\001CompObj").read[32..-1][/([^\x00]+)/m, 1]
|
170
170
|
# i was actually not loading data correctly before, so carefully check everything here
|
171
171
|
assert_equal expect, @ole.root.children.map { |child| child.read }
|
172
172
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-ole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.8
|
4
|
+
version: 1.2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Lowe
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-22 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|