workbook 0.4.6.0 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +14 -15
  4. data/lib/workbook.rb +22 -11
  5. data/lib/workbook/book.rb +47 -25
  6. data/lib/workbook/cell.rb +20 -26
  7. data/lib/workbook/generatetypes.rb +14 -0
  8. data/lib/workbook/modules/cache.rb +52 -0
  9. data/lib/workbook/modules/{table_diff_sort.rb → diff_sort.rb} +64 -16
  10. data/lib/workbook/modules/raw_objects_storage.rb +7 -2
  11. data/lib/workbook/readers/ods_reader.rb +1 -1
  12. data/lib/workbook/readers/xls_reader.rb +55 -55
  13. data/lib/workbook/readers/xls_shared.rb +47 -0
  14. data/lib/workbook/readers/xlsx_reader.rb +34 -153
  15. data/lib/workbook/row.rb +47 -4
  16. data/lib/workbook/sheet.rb +4 -0
  17. data/lib/workbook/table.rb +36 -16
  18. data/lib/workbook/types/Date.rb +9 -0
  19. data/lib/workbook/types/False.rb +0 -0
  20. data/lib/workbook/types/FalseClass.rb +9 -0
  21. data/lib/workbook/types/Nil.rb +0 -0
  22. data/lib/workbook/types/NilClass.rb +9 -0
  23. data/lib/workbook/types/Numeric.rb +9 -0
  24. data/lib/workbook/types/String.rb +9 -0
  25. data/lib/workbook/types/Time.rb +9 -0
  26. data/lib/workbook/types/True.rb +0 -0
  27. data/lib/workbook/types/TrueClass.rb +9 -0
  28. data/lib/workbook/version.rb +1 -1
  29. data/lib/workbook/writers/html_writer.rb +40 -18
  30. data/lib/workbook/writers/xls_writer.rb +47 -5
  31. data/lib/workbook/writers/xlsx_writer.rb +123 -0
  32. data/test/artifacts/bigtable.xls +0 -0
  33. data/test/artifacts/bigtable.xlsx +0 -0
  34. data/test/artifacts/simple_sheet.xlsx +0 -0
  35. data/test/artifacts/simple_sheet_many_sheets.xls +0 -0
  36. data/test/test_book.rb +50 -2
  37. data/test/test_cell.rb +1 -1
  38. data/test/test_format.rb +8 -0
  39. data/test/test_modules_cache.rb +68 -0
  40. data/test/test_modules_table_diff_sort.rb +12 -1
  41. data/test/test_readers_xls_reader.rb +6 -0
  42. data/test/test_readers_xlsx_reader.rb +10 -9
  43. data/test/test_row.rb +65 -8
  44. data/test/test_sheet.rb +8 -0
  45. data/test/test_table.rb +48 -0
  46. data/test/test_writers_html_writer.rb +18 -8
  47. data/test/test_writers_xls_writer.rb +90 -0
  48. data/test/test_writers_xlsx_writer.rb +153 -0
  49. data/workbook.gemspec +9 -7
  50. metadata +71 -31
@@ -5,34 +5,44 @@ module Writers
5
5
  class TestHtmlWriter < Test::Unit::TestCase
6
6
  def test_to_html
7
7
  #jruby and ruby's output differ a bit... both produce valid results though
8
- match = Workbook::Book.new.to_html.match(/<table \/>/) ? true : false #jruby
9
- match = (Workbook::Book.new.to_html.match(/<table><\/table>/) ? true : false) if match == false #ruby
10
- assert_equal(true, match)
8
+ # match = Workbook::Book.new.to_html.match(/<table \/>/) ? true : false #jruby
9
+ # puts Workbook::Book.new.to_html
10
+ # match = (Workbook::Book.new.to_html.match(/<table><thead><\/thead><tbody><\/tbody><\/table>/) ? true : false) if match == false #ruby
11
+ # assert_equal(true, match)
11
12
  html = Workbook::Book.new([['a','b'],[1,2],[3,4]]).to_html
12
13
  match = html.match(/<table><\/table>/) ? true : false
13
14
  assert_equal(false, match)
14
15
  match = html.match(/<td>1<\/td>/) ? true : false
15
16
  assert_equal(true, match)
16
- match = html.match(/<td>a<\/td>/) ? true : false
17
+ match = html.match(/<th>a<\/th>/) ? true : false
17
18
  assert_equal(true, match)
18
19
  end
19
20
  def test_to_html_format_names
20
21
  b = Workbook::Book.new([['a','b'],[1,2],[3,4]])
21
22
  c = b[0][0][0][0]
22
23
  c.format.name="testname"
24
+ c = b[0][0][1][0]
25
+ c.format.name="testname"
23
26
  html = b.to_html
24
- match = html.match(/<td class=\"testname\">a<\/td>/) ? true : false
27
+ match = html.match(/<th class=\"testname\">a<\/th>/) ? true : false
28
+ assert_equal(true, match)
29
+ match = html.match(/<td class=\"testname\">1<\/td>/) ? true : false
25
30
  assert_equal(true, match)
26
31
  end
27
32
  def test_to_html_css
28
33
  b = Workbook::Book.new([['a','b'],[1,2],[3,4]])
29
34
  c = b[0][0][0][0]
30
35
  c.format[:background]="#f00"
36
+ c = b[0][0][1][0]
37
+ c.format[:background]="#ff0"
31
38
  html = b.to_html
32
- match = html.match(/<td>a<\/td>/) ? true : false
39
+ match = html.match(/<th>a<\/th>/) ? true : false
40
+ match = html.match(/<td>1<\/td>/) ? true : false
33
41
  assert_equal(true, match)
34
42
  html = b.to_html({:style_with_inline_css=>true})
35
- match = html.match(/<td style="background: #f00">a<\/td>/) ? true : false
43
+ match = html.match(/<th style="background: #f00">a<\/th>/) ? true : false
44
+ match = html.match(/<td style="background: #ff0">1<\/td>/) ? true : false
45
+
36
46
  assert_equal(true, match)
37
47
  end
38
48
  def test_sheet_and_table_names
@@ -49,7 +59,7 @@ module Writers
49
59
  html = w.to_html
50
60
  assert_equal(true, (html.match(/rowspan="2">15 nov 11 15 nov 11/) ? true : false) )
51
61
  if RUBY_VERSION >= "1.9"
52
- assert_equal(true, (html.match(/colspan="2" rowspan="2">13 mrt 12 15 mrt 12 13 mrt 12 15 mrt 12/) ? true : false) )
62
+ assert_equal(true, (html.match(/colspan="2" rowspan="2">13 mrt 12 15 mrt 12 13 mrt 12 15 mrt 12/) ? true : false) )
53
63
  assert_equal(true, (html.match(/colspan="2">14 90589/) ? true : false) )
54
64
  end
55
65
  end
@@ -20,6 +20,66 @@ module Writers
20
20
  filename = b.write_to_xls
21
21
  b = Workbook::Book.open filename
22
22
  assert_equal(3.85546875,b.sheet.table.first[:a].format[:width])
23
+ end
24
+ def test_delete_row
25
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xls')
26
+ # a b c d e
27
+ # 14 90589 a 19 apr 12 23 apr 12
28
+ # 15 90588 b 15 nov 11 16 jul 12
29
+ # 25 90463 c 15 nov 11 17 nov 11
30
+ # 33 90490 d 13 mrt 12 15 mrt 12
31
+ t = b.sheet.table
32
+ assert_equal(33, t.last.first.value)
33
+ t.delete_at(4) #delete last row
34
+ filename = b.write_to_xls
35
+ b = Workbook::Book.open filename
36
+ t = b.sheet.table
37
+ # puts t.to_csv
38
+ #TODO: NOT true delete... need to work on this...
39
+ assert_equal(25, t[3].first.value)
40
+ assert_equal(nil, t[4].first.value)
41
+ assert_equal(nil, t[4].last.value)
42
+ end
43
+ def test_pop_row
44
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xls')
45
+ # a b c d e
46
+ # 14 90589 a 19 apr 12 23 apr 12
47
+ # 15 90588 b 15 nov 11 16 jul 12
48
+ # 25 90463 c 15 nov 11 17 nov 11
49
+ # 33 90490 d 13 mrt 12 15 mrt 12
50
+ t = b.sheet.table
51
+ assert_equal(33, t.last.first.value)
52
+ t.pop(2) #delete last two row
53
+ # puts t.to_csv
54
+ filename = b.write_to_xls
55
+ b = Workbook::Book.open filename
56
+ t = b.sheet.table
57
+ # puts t.to_csv
58
+ #TODO: NOT true delete... need to work on this...
59
+ assert_equal(nil, t[3].first.value)
60
+ assert_equal(nil, t[4].first.value)
61
+ assert_equal(nil, t[4].last.value)
62
+ assert_equal(15, t[2].first.value)
63
+ assert_equal(nil, t.last.first.value)
64
+
65
+ end
66
+ def test_pop_bigtable
67
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/bigtable.xls')
68
+ # a b c d e
69
+ # 14 90589 a 19 apr 12 23 apr 12
70
+ # 15 90588 b 15 nov 11 16 jul 12
71
+ # 25 90463 c 15 nov 11 17 nov 11
72
+ # 33 90490 d 13 mrt 12 15 mrt 12
73
+ t = b.sheet.table
74
+ assert_equal(574, t.count)
75
+ t.pop(300) #delete last two row
76
+ assert_equal(274, t.trim.count)
77
+ filename = b.write_to_xls
78
+ b = Workbook::Book.open filename
79
+ t = b.sheet.table
80
+ assert_equal(274, t.trim.count)
81
+
82
+
23
83
  end
24
84
  def test_cloning_roundtrip
25
85
  b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/book_with_tabs_and_colours.xls')
@@ -31,6 +91,14 @@ module Writers
31
91
  assert_equal(90588,b.sheet.table[5][:b].value)
32
92
  assert_equal("#FFFF00",b.sheet.table[5][:c].format[:background_color])
33
93
  end
94
+ def test_parse_font_family
95
+ b = Workbook::Book.new
96
+ assert_equal(:none,b.parse_font_family({:font_family=>"asdfsdf"}))
97
+ assert_equal(:swiss,b.parse_font_family({:font_family=>"ArIAL"}))
98
+ assert_equal(:swiss,b.parse_font_family({:font_family=>:swiss}))
99
+ assert_equal(:roman,b.parse_font_family({:font_family=>"Times"}))
100
+ assert_equal(:roman,b.parse_font_family({:font_family=>"roman"}))
101
+ end
34
102
 
35
103
  def test_init_spreadsheet_template
36
104
  b = Workbook::Book.new
@@ -46,5 +114,27 @@ module Writers
46
114
  def test_strftime_to_ms_format_nil
47
115
  assert_equal(nil, Workbook::Book.new.strftime_to_ms_format(nil))
48
116
  end
117
+ def test_xls_sheet_writer
118
+ b = Workbook::Book.new
119
+ b << Workbook::Sheet.new
120
+ b << Workbook::Sheet.new
121
+ b[0].name = "A"
122
+ b[1].name = "B"
123
+ b[2].name = "C"
124
+ assert_equal(["A","B","C"], b.collect{|a| a.name})
125
+ filename = b.write_to_xls
126
+ b = Workbook::Book.open filename
127
+ assert_equal(["A","B","C"], b.collect{|a| a.name})
128
+ end
129
+ def test_removal_of_sheets_in_excel_when_using_template
130
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet_many_sheets.xls')
131
+ assert_equal(10, b.count)
132
+ b.pop(4)
133
+ assert_equal(6, b.count)
134
+ filename = b.write_to_xls
135
+ b = Workbook::Book.open filename
136
+ assert_equal(6, b.count)
137
+
138
+ end
49
139
  end
50
140
  end
@@ -0,0 +1,153 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require File.join(File.dirname(__FILE__), 'helper')
3
+
4
+ module Writers
5
+ class TestXlsxWriter < Test::Unit::TestCase
6
+ def test_empty_to_xlsx
7
+ b = Workbook::Book.new [['a','b','c'],[1,2,3],[3,2,3]]
8
+ b.to_xlsx.is_a? RubyXL::Workbook
9
+ assert_equal('untitled document.xlsx', b.write_to_xlsx)
10
+
11
+ end
12
+
13
+ # def test_to_xlsx
14
+ # b = Workbook::Book.new [['a','b','c'],[1,2,3],[3,2,3]]
15
+ # raw = RubyXL::Parser.parse File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xlsx')
16
+ # t = Workbook::Template.new
17
+ # t.add_raw raw
18
+ # b.template = t
19
+ # assert_equal(true, b.to_xlsx.is_a?(RubyXL::Workbook))
20
+ #
21
+ # assert_equal('untitled document.xlsx', b.write_to_xlsx)
22
+ # end
23
+
24
+ def test_roundtrip
25
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xlsx')
26
+ assert_equal(14,b[0][0]["A2"])
27
+ assert_equal(DateTime.new(2011,11,15),b[0][0]["D3"].value)
28
+ # puts b.sheet.table.to_csv
29
+ filename = b.write_to_xlsx
30
+ b = Workbook::Book.open filename
31
+ assert_equal(14,b[0][0]["A2"])
32
+ # assert_equal(DateTime.new(2011,11,15),b[0][0]["D3"].value) TODO: Dates don't work with RubyXL
33
+ end
34
+ def test_roundtrip_with_modification
35
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xlsx')
36
+ b[0][0]["A2"]= 12
37
+ assert_equal(DateTime.new(2011,11,15),b[0][0]["D3"].value)
38
+ # puts b.sheet.table.to_csv
39
+ filename = b.write_to_xlsx
40
+ b = Workbook::Book.open filename
41
+ assert_equal(12,b[0][0]["A2"].value)
42
+ # assert_equal(DateTime.new(2011,11,15),b[0][0]["D3"].value) TODO: Dates don't work with RubyXL
43
+ end
44
+ def test_delete_row
45
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xlsx')
46
+ # a b c d e
47
+ # 14 90589 a 19 apr 12 23 apr 12
48
+ # 15 90588 b 15 nov 11 16 jul 12
49
+ # 25 90463 c 15 nov 11 17 nov 11
50
+ # 33 90490 d 13 mrt 12 15 mrt 12
51
+ t = b.sheet.table
52
+ assert_equal(33, t.last.first.value)
53
+ t.delete_at(4) #delete last row
54
+ filename = b.write_to_xlsx
55
+ b = Workbook::Book.open filename
56
+ t = b.sheet.table
57
+ #TODO: NOT true delete... need to work on this...
58
+ assert_equal(25, t[3].first.value)
59
+ assert_equal(nil, t[4])
60
+ end
61
+ def test_pop_row
62
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet.xlsx')
63
+ # a b c d e
64
+ # 14 90589 a 19 apr 12 23 apr 12
65
+ # 15 90588 b 15 nov 11 16 jul 12
66
+ # 25 90463 c 15 nov 11 17 nov 11
67
+ # 33 90490 d 13 mrt 12 15 mrt 12
68
+ t = b.sheet.table
69
+ assert_equal(33, t.last.first.value)
70
+ t.pop(2)
71
+ filename = b.write_to_xlsx
72
+ b = Workbook::Book.open filename
73
+ t = b.sheet.table
74
+ assert_equal(33, t[3].first.value)
75
+ assert_equal(nil, t[4])
76
+ assert_equal(15, t[2].first.value)
77
+
78
+ end
79
+ # def test_pop_bigtable
80
+ # b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/bigtable.xlsx')
81
+ # # a b c d e
82
+ # # 14 90589 a 19 apr 12 23 apr 12
83
+ # # 15 90588 b 15 nov 11 16 jul 12
84
+ # # 25 90463 c 15 nov 11 17 nov 11
85
+ # # 33 90490 d 13 mrt 12 15 mrt 12
86
+ # t = b.sheet.table
87
+ # assert_equal(554, t.count)
88
+ # t.pop(300) #delete last two row
89
+ # assert_equal(254, t.trim.count)
90
+ # filename = b.write_to_xlsx
91
+ # b = Workbook::Book.open filename
92
+ # t = b.sheet.table
93
+ # assert_equal(254, t.trim.count)
94
+ #
95
+ #
96
+ # end
97
+ def test_cloning_roundtrip
98
+ b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/book_with_tabs_and_colours.xlsx')
99
+ b.sheet.table << b.sheet.table[2]
100
+ assert_equal(90588,b.sheet.table[5][:b].value)
101
+ assert_equal("#FFFF00",b.sheet.table[5][:c].format[:background_color])
102
+ filename = b.write_to_xls
103
+ b = Workbook::Book.open filename
104
+ assert_equal(90588,b.sheet.table[5][:b].value)
105
+ assert_equal("#FF00FF",b.sheet.table[5][:c].format[:background_color])
106
+ end
107
+ # def test_parse_font_family
108
+ # b = Workbook::Book.new
109
+ # assert_equal(:none,b.parse_font_family({:font_family=>"asdfsdf"}))
110
+ # assert_equal(:swiss,b.parse_font_family({:font_family=>"ArIAL"}))
111
+ # assert_equal(:swiss,b.parse_font_family({:font_family=>:swiss}))
112
+ # assert_equal(:roman,b.parse_font_family({:font_family=>"Times"}))
113
+ # assert_equal(:roman,b.parse_font_family({:font_family=>"roman"}))
114
+ # end
115
+ #
116
+ # def test_init_spreadsheet_template
117
+ # b = Workbook::Book.new
118
+ # b.init_spreadsheet_template
119
+ # assert_equal(Spreadsheet::Workbook,b.xls_template.class)
120
+ # end
121
+ #
122
+ # def test_xls_sheet
123
+ # b = Workbook::Book.new
124
+ # b.init_spreadsheet_template
125
+ # assert_equal(Spreadsheet::Worksheet,b.xls_sheet(100).class)
126
+ # end
127
+ # def test_strftime_to_ms_format_nil
128
+ # assert_equal(nil, Workbook::Book.new.strftime_to_ms_format(nil))
129
+ # end
130
+ # def test_xls_sheet_writer
131
+ # b = Workbook::Book.new
132
+ # b << Workbook::Sheet.new
133
+ # b << Workbook::Sheet.new
134
+ # b[0].name = "A"
135
+ # b[1].name = "B"
136
+ # b[2].name = "C"
137
+ # assert_equal(["A","B","C"], b.collect{|a| a.name})
138
+ # filename = b.write_to_xls
139
+ # b = Workbook::Book.open filename
140
+ # assert_equal(["A","B","C"], b.collect{|a| a.name})
141
+ # end
142
+ # def test_removal_of_sheets_in_excel_when_using_template
143
+ # b = Workbook::Book.open File.join(File.dirname(__FILE__), 'artifacts/simple_sheet_many_sheets.xls')
144
+ # assert_equal(10, b.count)
145
+ # b.pop(4)
146
+ # assert_equal(6, b.count)
147
+ # filename = b.write_to_xls
148
+ # b = Workbook::Book.open filename
149
+ # assert_equal(6, b.count)
150
+ #
151
+ # end
152
+ end
153
+ end
data/workbook.gemspec CHANGED
@@ -7,23 +7,25 @@ require "workbook/version"
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'workbook'
9
9
  s.rubyforge_project = 'workbook'
10
+ s.license = "MIT"
10
11
  s.version = Workbook::VERSION
11
12
  s.date = '2013-04-05'
12
13
  s.summary = "Workbook is a datastructure to contain books of tables (an anlogy used in e.g. Excel)"
13
14
  s.description = "Workbook contains workbooks, as in a table, contains rows, contains cells, reads/writes excel, ods and csv and tab separated files, and offers basic diffing and sorting capabilities."
14
15
  s.authors = ["Maarten Brouwers"]
15
- s.add_development_dependency 'ruby-prof'
16
- s.add_dependency('rubyzip', '0.9.9')
17
- s.add_dependency('spreadsheet', '>= 0.7.5')
16
+ s.add_development_dependency 'ruby-prof', '~> 0.14'
17
+ s.add_dependency('rubyzip', '~>1')
18
+ s.add_dependency('spreadsheet', '~> 0.7')
18
19
  s.add_dependency('fastercsv') if RUBY_VERSION < "1.9"
19
20
  s.add_dependency("rchardet", "~> 1.3")
20
- s.add_dependency("rake")
21
- s.add_dependency("json")
22
- s.add_dependency('rubyXL')
21
+ s.add_dependency("rake", '~> 10.0')
22
+ s.add_dependency("json", '~> 1.8')
23
+ s.add_dependency("zip-zip", '~> 0.2') #actually a hack...
24
+ s.add_dependency('rubyXL', '~> 2.5')
23
25
  if RUBY_VERSION < "1.9"
24
26
  s.add_dependency('nokogiri', "~> 1.5.10")
25
27
  else
26
- s.add_dependency('nokogiri')
28
+ s.add_dependency('nokogiri', '~> 1.6')
27
29
  end
28
30
  s.platform = Gem::Platform::RUBY
29
31
  s.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6.0
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Brouwers
@@ -14,44 +14,44 @@ dependencies:
14
14
  name: ruby-prof
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.14'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '0.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.9
33
+ version: '1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.9.9
40
+ version: '1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: spreadsheet
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.7.5
47
+ version: '0.7'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.7.5
54
+ version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rchardet
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,58 +70,72 @@ dependencies:
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '10.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '1.8'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '1.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: zip-zip
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.2'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.2'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rubyXL
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - ">="
115
+ - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '0'
117
+ version: '2.5'
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - ">="
122
+ - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: '0'
124
+ version: '2.5'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: nokogiri
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ">="
129
+ - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '0'
131
+ version: '1.6'
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ">="
136
+ - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '0'
138
+ version: '1.6'
125
139
  description: Workbook contains workbooks, as in a table, contains rows, contains cells,
126
140
  reads/writes excel, ods and csv and tab separated files, and offers basic diffing
127
141
  and sorting capabilities.
@@ -189,8 +203,10 @@ files:
189
203
  - lib/workbook/cell.rb
190
204
  - lib/workbook/column.rb
191
205
  - lib/workbook/format.rb
206
+ - lib/workbook/generatetypes.rb
207
+ - lib/workbook/modules/cache.rb
208
+ - lib/workbook/modules/diff_sort.rb
192
209
  - lib/workbook/modules/raw_objects_storage.rb
193
- - lib/workbook/modules/table_diff_sort.rb
194
210
  - lib/workbook/modules/type_parser.rb
195
211
  - lib/workbook/nil_value.rb
196
212
  - lib/workbook/readers/csv_reader.rb
@@ -203,12 +219,25 @@ files:
203
219
  - lib/workbook/sheet.rb
204
220
  - lib/workbook/table.rb
205
221
  - lib/workbook/template.rb
222
+ - lib/workbook/types/Date.rb
223
+ - lib/workbook/types/False.rb
224
+ - lib/workbook/types/FalseClass.rb
225
+ - lib/workbook/types/Nil.rb
226
+ - lib/workbook/types/NilClass.rb
227
+ - lib/workbook/types/Numeric.rb
228
+ - lib/workbook/types/String.rb
229
+ - lib/workbook/types/Time.rb
230
+ - lib/workbook/types/True.rb
231
+ - lib/workbook/types/TrueClass.rb
206
232
  - lib/workbook/version.rb
207
233
  - lib/workbook/writers/csv_table_writer.rb
208
234
  - lib/workbook/writers/html_writer.rb
209
235
  - lib/workbook/writers/json_table_writer.rb
210
236
  - lib/workbook/writers/xls_writer.rb
237
+ - lib/workbook/writers/xlsx_writer.rb
211
238
  - rbeautify.rb
239
+ - test/artifacts/bigtable.xls
240
+ - test/artifacts/bigtable.xlsx
212
241
  - test/artifacts/book_with_colspans.ods
213
242
  - test/artifacts/book_with_tabs_and_colours.ods
214
243
  - test/artifacts/book_with_tabs_and_colours.xls
@@ -228,6 +257,8 @@ files:
228
257
  - test/artifacts/simple_excel_csv.csv
229
258
  - test/artifacts/simple_sheet.ods
230
259
  - test/artifacts/simple_sheet.xls
260
+ - test/artifacts/simple_sheet.xlsx
261
+ - test/artifacts/simple_sheet_many_sheets.xls
231
262
  - test/artifacts/txt_in_xls.xls
232
263
  - test/artifacts/xls_with_txt_extension.txt
233
264
  - test/artifacts/zip_in_xls.xls
@@ -237,6 +268,7 @@ files:
237
268
  - test/test_column.rb
238
269
  - test/test_format.rb
239
270
  - test/test_functional.rb
271
+ - test/test_modules_cache.rb
240
272
  - test/test_modules_table_diff_sort.rb
241
273
  - test/test_modules_type_parser.rb
242
274
  - test/test_readers_csv_reader.rb
@@ -251,9 +283,11 @@ files:
251
283
  - test/test_writers_html_writer.rb
252
284
  - test/test_writers_json_writer.rb
253
285
  - test/test_writers_xls_writer.rb
286
+ - test/test_writers_xlsx_writer.rb
254
287
  - workbook.gemspec
255
288
  homepage: http://murb.nl/blog?tags=workbook
256
- licenses: []
289
+ licenses:
290
+ - MIT
257
291
  metadata: {}
258
292
  post_install_message:
259
293
  rdoc_options: []
@@ -277,6 +311,8 @@ specification_version: 4
277
311
  summary: Workbook is a datastructure to contain books of tables (an anlogy used in
278
312
  e.g. Excel)
279
313
  test_files:
314
+ - test/artifacts/bigtable.xls
315
+ - test/artifacts/bigtable.xlsx
280
316
  - test/artifacts/book_with_colspans.ods
281
317
  - test/artifacts/book_with_tabs_and_colours.ods
282
318
  - test/artifacts/book_with_tabs_and_colours.xls
@@ -296,6 +332,8 @@ test_files:
296
332
  - test/artifacts/simple_excel_csv.csv
297
333
  - test/artifacts/simple_sheet.ods
298
334
  - test/artifacts/simple_sheet.xls
335
+ - test/artifacts/simple_sheet.xlsx
336
+ - test/artifacts/simple_sheet_many_sheets.xls
299
337
  - test/artifacts/txt_in_xls.xls
300
338
  - test/artifacts/xls_with_txt_extension.txt
301
339
  - test/artifacts/zip_in_xls.xls
@@ -305,6 +343,7 @@ test_files:
305
343
  - test/test_column.rb
306
344
  - test/test_format.rb
307
345
  - test/test_functional.rb
346
+ - test/test_modules_cache.rb
308
347
  - test/test_modules_table_diff_sort.rb
309
348
  - test/test_modules_type_parser.rb
310
349
  - test/test_readers_csv_reader.rb
@@ -319,4 +358,5 @@ test_files:
319
358
  - test/test_writers_html_writer.rb
320
359
  - test/test_writers_json_writer.rb
321
360
  - test/test_writers_xls_writer.rb
361
+ - test/test_writers_xlsx_writer.rb
322
362
  has_rdoc: