roo 1.10.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ == 1.10.1 2011-11-14
2
+
3
+ * 2 bugfixes
4
+ * forgot dependency 'rubyzip'
5
+ * at least one external application does create xlsx-files with different internal file names which differ from the original file names of Excel. Solution: ignore lower-/upper case in file names.
6
+
1
7
  == 1.10.0 2011-10-10
2
8
 
3
9
  * 4 enhancements
data/README.txt CHANGED
@@ -39,6 +39,7 @@ If you want to support the further development of the Roo gem, send Bitcoins to
39
39
  s = Excel.new("myspreadsheet.xls") # creates an Excel Spreadsheet instance
40
40
  s = Google.new("myspreadsheetkey_at_google") # creates an Google Spreadsheet instance
41
41
  s = Excelx.new("myspreadsheet.xlsx") # creates an Excel Spreadsheet instance for Excel .xlsx files
42
+ s = Csv.new("myspreadsheet.csv") # creates an Csv Spreadsheet instance for CSV files
42
43
 
43
44
  s.default_sheet = s.sheets.first # first sheet in the spreadsheet file will be used
44
45
 
data/Rakefile CHANGED
@@ -25,6 +25,7 @@ Bones {
25
25
  #TODO: brauchen wir das noch? depend_on 'gimite-google-spreadsheet-ruby','>= 0.0.5'
26
26
  #depend_on 'febeling-rubyzip','>= 0.9.2' # meine aktuelle Version
27
27
  #TODO: warum brauchen wir das? es lief doch auch vorher ohne dieses spezielle gem
28
+ depend_on 'rubyzip' # rubyzip wird benoetigt
28
29
  depend_on 'google-spreadsheet-ruby'
29
30
  depend_on 'choice'
30
31
  depend_on 'todonotes'
data/lib/roo.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Roo
4
4
 
5
5
  # :stopdoc:
6
- VERSION = '1.10.0'
6
+ VERSION = '1.10.1'
7
7
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
8
8
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
9
9
  # :startdoc:
@@ -667,24 +667,29 @@ Datei xl/comments1.xml
667
667
  f << zip.read(entry)
668
668
  }
669
669
  end
670
- if entry.to_s.end_with?('sharedStrings.xml')
670
+ # if entry.to_s.end_with?('sharedStrings.xml')
671
+ # at least one application creates this file with another (incorrect?)
672
+ # casing. It doesn't hurt, if we ignore here the correct casing - there
673
+ # won't be both names in the archive.
674
+ # Changed the casing of all the following filenames.
675
+ if entry.to_s.downcase.end_with?('sharedstrings.xml')
671
676
  open(@tmpdir+'/'+@file_nr.to_s+'_roo_sharedStrings.xml','wb') {|f|
672
677
  f << zip.read(entry)
673
678
  }
674
679
  end
675
- if entry.to_s.end_with?('styles.xml')
680
+ if entry.to_s.downcase.end_with?('styles.xml')
676
681
  open(@tmpdir+'/'+@file_nr.to_s+'_roo_styles.xml','wb') {|f|
677
682
  f << zip.read(entry)
678
683
  }
679
684
  end
680
- if entry.to_s =~ /sheet([0-9]+).xml$/
685
+ if entry.to_s.downcase =~ /sheet([0-9]+).xml$/
681
686
  nr = $1
682
687
  open(@tmpdir+'/'+@file_nr.to_s+"_roo_sheet#{nr}",'wb') {|f|
683
688
  f << zip.read(entry)
684
689
  }
685
690
  @sheet_files[nr.to_i-1] = @tmpdir+'/'+@file_nr.to_s+"_roo_sheet#{nr}"
686
691
  end
687
- if entry.to_s =~ /comments([0-9]+).xml$/
692
+ if entry.to_s.downcase =~ /comments([0-9]+).xml$/
688
693
  nr = $1
689
694
  open(@tmpdir+'/'+@file_nr.to_s+"_roo_comments#{nr}",'wb') {|f|
690
695
  f << zip.read(entry)
@@ -0,0 +1,13 @@
1
+ require 'roo'
2
+ Dir.glob("test/**/*").each do |fn|
3
+ if fn.end_with? '.ods'
4
+ begin
5
+ oo = Openoffice.new fn
6
+ print File.basename(fn) + " "
7
+ puts oo.officeversion
8
+ rescue #Zip::ZipError
9
+ # file is not a real .ods spreadsheet file
10
+ #puts "not an Openoffice-spreadsheet"
11
+ end
12
+ end
13
+ end
@@ -781,7 +781,7 @@ class TestRoo < Test::Unit::TestCase
781
781
  end
782
782
 
783
783
  def test_excel_zipped
784
- after Date.new(2011,10,30) do
784
+ after Date.new(2011,12,7) do
785
785
  to do
786
786
  'hier wieder das Problem, dass ausgepacktes xls File
787
787
  unter Windows nicht geloescht werden kann, weil
@@ -1474,7 +1474,7 @@ Sheet 3:
1474
1474
  end
1475
1475
 
1476
1476
  def test_no_remaining_tmp_files_openoffice
1477
- after Date.new(2011,10,30) do
1477
+ after Date.new(2011,12,7) do
1478
1478
  # alles noch mal ueberarbeiten
1479
1479
  # temp. Directories sollten in diesem Fall ueberhaupt nicht
1480
1480
  # angelegt werden
@@ -1497,7 +1497,7 @@ Sheet 3:
1497
1497
  end
1498
1498
 
1499
1499
  def test_no_remaining_tmp_files_excel
1500
- after Date.new(2011,9,30) do
1500
+ after Date.new(2011,12,7) do
1501
1501
  # alles noch mal ueberarbeiten
1502
1502
  # temp. Directories sollten in diesem Fall ueberhaupt nicht
1503
1503
  # angelegt werden
@@ -1515,20 +1515,18 @@ Sheet 3:
1515
1515
  end
1516
1516
 
1517
1517
  def test_no_remaining_tmp_files_excelx
1518
- after Date.new(2011,11,1) do
1518
+ after Date.new(2011,12,7) do
1519
1519
  # alles noch mal ueberarbeiten
1520
1520
  # temp. Directories sollten in diesem Fall ueberhaupt nicht
1521
1521
  # angelegt werden
1522
1522
  if EXCELX
1523
1523
  prev = Dir.glob(TMP_PREFIX)
1524
1524
  assert_raise(Zip::ZipError) { #TODO: besseres Fehlerkriterium bei
1525
-
1526
1525
  # oo = Excelx.new(File.join(TESTDIR,"no_spreadsheet_file.txt"))
1527
1526
  # es soll absichtlich ein Abbruch provoziert werden, deshalb :ignore
1528
1527
  oo = Excelx.new(File.join(TESTDIR,"no_spreadsheet_file.txt"),
1529
1528
  false,
1530
1529
  :ignore)
1531
-
1532
1530
  }
1533
1531
  now = Dir.glob(TMP_PREFIX)
1534
1532
  assert (now-prev).empty?
@@ -1675,7 +1673,7 @@ Sheet 3:
1675
1673
  end
1676
1674
 
1677
1675
  def test_file_warning_warning
1678
- after Date.new(2011,10,14) do
1676
+ after Date.new(2011,12,7) do
1679
1677
  if OPENOFFICE
1680
1678
  assert_nothing_raised(TypeError) {
1681
1679
  assert_raises(Zip::ZipError) {
@@ -1717,7 +1715,7 @@ Sheet 3:
1717
1715
  now = Dir.glob(TMP_PREFIX)
1718
1716
  assert (now-prev).empty?
1719
1717
  end
1720
- end
1718
+ end
1721
1719
  end
1722
1720
 
1723
1721
  def test_file_warning_ignore
@@ -2270,7 +2268,7 @@ Sheet 3:
2270
2268
  end end
2271
2269
 
2272
2270
  def test_bug_date_mileszs
2273
- after Date.new(2011,11,1) do
2271
+ after Date.new(2011,12,7) do
2274
2272
  # to do
2275
2273
  # "An richtige Stelle kopieren. Ist das Dokument vertraulich?"
2276
2274
  # 'ist auf dem Netbook nicht vorhanden'
@@ -2333,7 +2331,7 @@ where the expected result is
2333
2331
  end
2334
2332
 
2335
2333
  def test_bug_guest_list_2011_05_05
2336
- after Date.new(2011,11,1) do
2334
+ after Date.new(2011,12,7) do
2337
2335
  oo = Excel.new(File.join("..","confidential","guest_list_addresses.xls"))
2338
2336
  oo.default_sheet = oo.sheets.first
2339
2337
  assert_equal "lalala", oo.cell('a',1) # anderer Inhalt im Spreadsheet
@@ -2387,7 +2385,7 @@ where the expected result is
2387
2385
  end
2388
2386
 
2389
2387
  def test_bug_string_as_a_date_2011_05_21
2390
- after Date.new(2011,11,1) do
2388
+ after Date.new(2011,12,7) do
2391
2389
  #oo = Excel.new(File.join(TESTDIR,'2011-05-21_sample_type_problem.xls'))
2392
2390
  oo = Excel.new(File.join('..','confidential','2011-05-21_sample_type_problem.xls'))
2393
2391
  oo.default_sheet = oo.sheets.first
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-10 00:00:00.000000000Z
12
+ date: 2011-11-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spreadsheet
16
- requirement: &27024132 !ruby/object:Gem::Requirement
16
+ requirement: &28860984 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>'
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.6.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *27024132
24
+ version_requirements: *28860984
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &27023772 !ruby/object:Gem::Requirement
27
+ requirement: &28860480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,21 @@ dependencies:
32
32
  version: 1.5.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *27023772
35
+ version_requirements: *28860480
36
+ - !ruby/object:Gem::Dependency
37
+ name: rubyzip
38
+ requirement: &28859964 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 0.9.4
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *28859964
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: google-spreadsheet-ruby
38
- requirement: &27023328 !ruby/object:Gem::Requirement
49
+ requirement: &28859412 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,10 +54,10 @@ dependencies:
43
54
  version: 0.1.5
44
55
  type: :runtime
45
56
  prerelease: false
46
- version_requirements: *27023328
57
+ version_requirements: *28859412
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: choice
49
- requirement: &27022944 !ruby/object:Gem::Requirement
60
+ requirement: &28858860 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ! '>='
@@ -54,10 +65,10 @@ dependencies:
54
65
  version: 0.1.4
55
66
  type: :runtime
56
67
  prerelease: false
57
- version_requirements: *27022944
68
+ version_requirements: *28858860
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: todonotes
60
- requirement: &27022392 !ruby/object:Gem::Requirement
71
+ requirement: &28858464 !ruby/object:Gem::Requirement
61
72
  none: false
62
73
  requirements:
63
74
  - - ! '>='
@@ -65,10 +76,10 @@ dependencies:
65
76
  version: 0.1.0
66
77
  type: :runtime
67
78
  prerelease: false
68
- version_requirements: *27022392
79
+ version_requirements: *28858464
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: bones
71
- requirement: &27021996 !ruby/object:Gem::Requirement
82
+ requirement: &28857900 !ruby/object:Gem::Requirement
72
83
  none: false
73
84
  requirements:
74
85
  - - ! '>='
@@ -76,7 +87,7 @@ dependencies:
76
87
  version: 3.7.1
77
88
  type: :development
78
89
  prerelease: false
79
- version_requirements: *27021996
90
+ version_requirements: *28857900
80
91
  description: ! 'Roo can access the contents of various spreadsheet files. It can handle
81
92
 
82
93
  * Openoffice
@@ -96,19 +107,16 @@ executables:
96
107
  extensions: []
97
108
  extra_rdoc_files:
98
109
  - History.txt
99
- - Manifest.txt
100
110
  - README.txt
101
111
  - bin/roo
102
112
  - lib/roo/.csv.rb.swp
103
113
  - test/no_spreadsheet_file.txt
104
114
  files:
105
115
  - History.txt
106
- - Manifest.txt
107
116
  - README.txt
108
117
  - Rakefile
109
118
  - TODO
110
119
  - bin/roo
111
- - datetime.csv
112
120
  - lib/roo.rb
113
121
  - lib/roo/.csv.rb.swp
114
122
  - lib/roo/csv.rb
@@ -128,6 +136,7 @@ files:
128
136
  - test/Bibelbund.xlsx
129
137
  - test/Bibelbund1.ods
130
138
  - test/Pfand_from_windows_phone.xlsx
139
+ - test/all_ss.rb
131
140
  - test/bbu.ods
132
141
  - test/bbu.xls
133
142
  - test/bbu.xlsx
@@ -1,53 +0,0 @@
1
- History.txt
2
- License.txt
3
- Manifest.txt
4
- README.txt
5
- Rakefile
6
- base64include.rb
7
- examples/roo_soap_server.rb
8
- examples/roo_soap_client.rb
9
- examples/write_me.rb
10
- lib/roo.rb
11
- lib/roo/version.rb
12
- lib/roo/generic_spreadsheet.rb
13
- lib/roo/openoffice.rb
14
- lib/roo/excel.rb
15
- lib/roo/google.rb
16
- lib/roo/roo_rails_helper.rb
17
- scripts/txt2html
18
- setup.rb
19
- test/false_encoding.xls
20
- test/Bibelbund1.ods
21
- test/Bibelbund.ods
22
- test/Bibelbund.xls
23
- test/Bibelbund.csv
24
- test/bbu.xls
25
- test/bbu.ods
26
- test/no_spreadsheet_file.txt
27
- test/simple_spreadsheet.ods
28
- test/simple_spreadsheet.xls
29
- test/simple_spreadsheet_from_italo.ods
30
- test/simple_spreadsheet_from_italo.xls
31
- test/test_helper.rb
32
- test/test_roo.rb
33
- test/time-test.ods
34
- test/time-test.xls
35
- test/time-test.csv
36
- test/numbers1.csv
37
- test/numbers1_excel.csv
38
- test/numbers1.ods
39
- test/numbers1.xls
40
- test/borders.ods
41
- test/borders.xls
42
- test/formula.ods
43
- test/formula.xls
44
- test/only_one_sheet.ods
45
- test/only_one_sheet.xls
46
- test/bode-v1.xls.zip
47
- test/bode-v1.ods.zip
48
- test/ric.ods
49
- website/index.html
50
- website/index.txt
51
- website/javascripts/rounded_corners_lite.inc.js
52
- website/stylesheets/screen.css
53
- website/template.rhtml
@@ -1,7 +0,0 @@
1
- 1961-11-21,,
2
- ,,
3
- 1961-11-21T12:17:18+00:00,1961-11-21T12:17:18+00:00,1961-11-21T12:17:18+00:00
4
- 1961-11-21T12:17:18+00:00,1961-11-21T12:17:18+00:00,1961-11-21T12:17:18+00:00
5
- 1961-11-21T12:17:18+00:00,1961-11-21T12:17:18+00:00,1961-11-21T12:17:18+00:00
6
- 1961-11-21,1961-11-21,1961-11-21
7
- 1961-11-21,1961-11-21,1961-11-21