roo 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.2.7 2007-06-20
2
+ * 1 bugfix:
3
+ * Excel: float-numbers were truncated to integer
4
+
1
5
  == 0.2.6 2007-06-19
2
6
  * 1 bugfix:
3
7
  * Openoffice: two or more consecutive cells with string content failed
@@ -49,7 +49,7 @@ class Excel < Openoffice
49
49
  # p cell.type
50
50
  return nil unless cell
51
51
  case cell.type
52
- when :numeric then return cell.to_i
52
+ when :numeric then return cell.to_f
53
53
  when :text then return cell.to_s('latin1')
54
54
  when :date then return cell.date
55
55
  else
@@ -2,7 +2,7 @@ module Roo #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 6
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -678,4 +678,30 @@ end
678
678
 
679
679
  end
680
680
 
681
+ def test_latlondata
682
+ #-- this testfile contains confident data and will not be released in the public
683
+ if File.exist?(File.join("test","latlondata.xls"))
684
+ oo = Excel.new(File.join("test","latlondata.xls"))
685
+ #oo = Excel.new("numbers1.xls")
686
+ oo.default_sheet = 2
687
+ 5.upto(oo.last_row) do |line|
688
+ waypoint = oo.cell(line,'V')
689
+ desc = oo.cell(line,'W')
690
+ color = oo.cell(line,'X')
691
+ symbol = oo.cell(line,'Y')
692
+ longitude = oo.cell(line,'Z')
693
+ latitude = oo.cell(line,'AA')
694
+ alt = oo.cell(line,'AB')
695
+ if waypoint
696
+ puts "#{waypoint}\t#{desc}\t#{color}\t#{symbol}\t#{longitude.to_f}\t#{latitude.to_f}\t#{alt.to_f}"
697
+ end
698
+ end
699
+ #--
700
+ assert_equal "[1] KLAR (takeoff)", oo.cell('V',5)
701
+ assert_equal "takeoff LAR (VFR)", oo.cell('w',5)
702
+ assert_equal -105.675, oo.cell('Z',5)
703
+ assert_equal 41.31205555, oo.cell('AA',5)
704
+ assert_equal 2218.3344, oo.cell('AB',5)
705
+ end
706
+ end
681
707
  end # class
@@ -33,7 +33,7 @@
33
33
  <h1>roo</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/roo"; return false'>
35
35
  Get Version
36
- <a href="http://rubyforge.org/projects/roo" class="numbers">0.2.6</a>
36
+ <a href="http://rubyforge.org/projects/roo" class="numbers">0.2.7</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: roo
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.6
7
- date: 2007-06-19 00:00:00 +02:00
6
+ version: 0.2.7
7
+ date: 2007-06-20 00:00:00 +02:00
8
8
  summary: roo can access the contents of OpenOffice-Spreadsheets
9
9
  require_paths:
10
10
  - lib