spreadsheet 0.6.1.6 → 0.6.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ === 0.6.1.7 / 2008-10-30
2
+
3
+ * 1 Bugfix
4
+
5
+ * Fixes a bug where all Formulas were ignored.
6
+ (Thanks to Bjørn Hjelle for the report)
7
+
8
+ * 1 minor enhancement
9
+
10
+ * Allow the substitution of an IO object with a StringIO.
11
+ (Thanks to luxor for the report)
12
+
1
13
  === 0.6.1.6 / 2008-10-28
2
14
 
3
15
  * 2 Bugfixes
data/lib/spreadsheet.rb CHANGED
@@ -42,7 +42,7 @@ module Spreadsheet
42
42
 
43
43
  ##
44
44
  # The version of Spreadsheet you are using.
45
- VERSION = '0.6.1.6'
45
+ VERSION = '0.6.1.7'
46
46
 
47
47
  ##
48
48
  # Default client Encoding. Change this value if your application uses a
@@ -58,7 +58,7 @@ module Spreadsheet
58
58
  # Parses a Spreadsheet Document and returns a Workbook object. At present,
59
59
  # only Excel-Documents can be read.
60
60
  def open io_or_path, mode="rb+", &block
61
- if io_or_path.is_a? IO
61
+ if io_or_path.respond_to? :seek
62
62
  Excel::Workbook.open(io_or_path)
63
63
  elsif block
64
64
  File.open(io_or_path, mode) do |fh|
@@ -300,7 +300,7 @@ class Reader
300
300
  value = read_string work[2..-1], 2
301
301
  @formats.store idx, client(value, @workbook.encoding)
302
302
  end
303
- def read_formula worksheet, work, pos, len
303
+ def read_formula worksheet, addr, work
304
304
  # Offset Size Contents
305
305
  # 0 2 Index to row
306
306
  # 2 2 Index to column
@@ -383,6 +383,7 @@ class Reader
383
383
  else
384
384
  # leave the Formula value blank
385
385
  end
386
+ set_cell worksheet, row, column, xf, formula
386
387
  end
387
388
  def read_hlink worksheet, work, pos, len
388
389
  # 6.53.1 Common Record Contents
@@ -661,6 +662,9 @@ class Reader
661
662
  when 0x0002 # INTEGER ➜ 6.56 (BIFF2 only)
662
663
  found = true
663
664
  # TODO: implement for BIFF2 support
665
+ when :formula # FORMULA ➜ 6.46
666
+ found = true
667
+ read_formula worksheet, addr, work
664
668
  when :label # LABEL ➜ 6.59 (BIFF2-BIFF7)
665
669
  found = true
666
670
  read_label worksheet, addr, work
@@ -7,7 +7,7 @@ module Spreadsheet
7
7
  @io_or_path = io_or_path
8
8
  end
9
9
  def write workbook
10
- if @io_or_path.is_a? IO
10
+ if @io_or_path.respond_to? :seek
11
11
  write_workbook workbook, @io_or_path
12
12
  else
13
13
  File.open(@io_or_path, "wb+") do |fh|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.6
4
+ version: 0.6.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannes Wyss
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-28 00:00:00 +01:00
12
+ date: 2008-10-30 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency