ruby-ole 1.2.11.1 → 1.2.11.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,15 @@
1
+ == 1.2.11.2 / 2011-09-07
2
+
3
+ - Remove empty dirents after constructing tree (fixes non-contiguous
4
+ allocation table usage).
5
+ - Fix fallback Symbol#to_proc to match activesupport definition in case
6
+ we get loaded first (github #2, lazylester).
7
+ - Use method_defined? for fallback guards to support newer versions of
8
+ ruby (jocker).
9
+ - Add guard on FileTime#initialize to skip for newer versions of ruby.
10
+ Missing required methods, but optimization no longer relevant
11
+ anyway (github #4, sagmor).
12
+
1
13
  == 1.2.11.1 / 2010-10-24
2
14
 
3
15
  - Add gemspec and docs to packages so tests can pass again.
@@ -124,7 +124,7 @@ module Ole # :nodoc:
124
124
  # get block chain for directories, read it, then split it into chunks and load the
125
125
  # directory entries. semantics changed - used to cut at first dir where dir.type == 0
126
126
  @dirents = @bbat.read(@header.dirent_start).to_enum(:each_chunk, Dirent::SIZE).
127
- map { |str| Dirent.new self, str }.reject { |d| d.type_id == 0 }
127
+ map { |str| Dirent.new self, str }
128
128
 
129
129
  # now reorder from flat into a tree
130
130
  # links are stored in some kind of balanced binary tree
@@ -143,6 +143,7 @@ module Ole # :nodoc:
143
143
  end
144
144
 
145
145
  @root = @dirents.to_tree.first
146
+ @dirents.reject! { |d| d.type_id == 0 }
146
147
  # silence this warning by default, its not really important (issue #5).
147
148
  # fairly common one appears to be "R" (from office OS X?) which smells
148
149
  # like some kind of UTF16 snafu, but scottwillson also has had some kanji...
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Ole # :nodoc:
4
4
  class Storage
5
- VERSION = '1.2.11.1'
5
+ VERSION = '1.2.11.2'
6
6
  end
7
7
  end
8
8
 
data/lib/ole/support.rb CHANGED
@@ -27,7 +27,7 @@ end
27
27
  class File # :nodoc:
28
28
  # for interface consistency with StringIO etc (rather than adding #stat
29
29
  # to them). used by RangesIO.
30
- unless File.instance_methods.include?(:size)
30
+ unless File.method_defined?(:size)
31
31
  def size
32
32
  stat.size
33
33
  end
@@ -35,9 +35,9 @@ class File # :nodoc:
35
35
  end
36
36
 
37
37
  class Symbol # :nodoc:
38
- unless Symbol.instance_methods.include?(:to_proc)
38
+ unless Symbol.method_defined?(:to_proc)
39
39
  def to_proc
40
- proc { |a| a.send self }
40
+ Proc.new { |*args| args.shift.__send__(self, *args) }
41
41
  end
42
42
  end
43
43
  end
@@ -76,7 +76,7 @@ module Ole # :nodoc:
76
76
  # see issue #4.
77
77
  msg = respond_to?(:new!) ? :new! : :new0
78
78
  send msg, jd + fr - 0.5, 0, ITALY
79
- end
79
+ end if respond_to?(:new!) || respond_to?(:new0)
80
80
 
81
81
  def self.from_time time
82
82
  new(*(time.to_a[0, 6].reverse + [time.usec]))
data/test/test_support.rb CHANGED
@@ -44,6 +44,11 @@ class TestSupport < Test::Unit::TestCase
44
44
  # note not [6, 7] - no overlaps
45
45
  assert_equal [6], str.indexes('||')
46
46
  end
47
+
48
+ def test_symbol
49
+ array = (1..10).to_a
50
+ assert_equal 55, array.inject(&:+)
51
+ end
47
52
  end
48
53
 
49
54
  class TestIOMode < Test::Unit::TestCase
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-ole
3
3
  version: !ruby/object:Gem::Version
4
- hash: 97
4
+ hash: 103
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
9
  - 11
10
- - 1
11
- version: 1.2.11.1
10
+ - 2
11
+ version: 1.2.11.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Charles Lowe
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-24 00:00:00 -04:00
19
+ date: 2011-09-08 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies: []
22
22