osheet 0.10.0 → 1.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/Gemfile +0 -1
  2. data/Gemfile.lock +9 -6
  3. data/Rakefile +35 -19
  4. data/bench/bench_runner.rb +91 -0
  5. data/bench/profiler_runner.rb +1 -0
  6. data/examples/basic.rb +1 -1
  7. data/examples/basic.xls +2 -1
  8. data/examples/basic_with_templates.rb +2 -2
  9. data/examples/basic_with_templates.xls +3 -3
  10. data/examples/formats.rb +2 -2
  11. data/examples/formats.xls +46 -46
  12. data/examples/formula.rb +2 -2
  13. data/examples/styles.rb +2 -2
  14. data/examples/styles.xls +5 -5
  15. data/examples/trivial.rb +2 -2
  16. data/lib/osheet/cell.rb +48 -46
  17. data/lib/osheet/column.rb +23 -29
  18. data/lib/osheet/format.rb +3 -3
  19. data/lib/osheet/meta_element.rb +2 -1
  20. data/lib/osheet/mixin.rb +21 -9
  21. data/lib/osheet/partial.rb +5 -9
  22. data/lib/osheet/row.rb +28 -32
  23. data/lib/osheet/style.rb +11 -25
  24. data/lib/osheet/styled_element.rb +9 -1
  25. data/lib/osheet/template.rb +3 -8
  26. data/lib/osheet/version.rb +1 -1
  27. data/lib/osheet/workbook.rb +135 -43
  28. data/lib/osheet/workbook_api.rb +208 -0
  29. data/lib/osheet/workbook_element.rb +225 -8
  30. data/lib/osheet/worksheet.rb +22 -28
  31. data/lib/osheet/xmlss_writer/style_cache.rb +64 -0
  32. data/lib/osheet/xmlss_writer/style_settings.rb +148 -0
  33. data/lib/osheet/xmlss_writer.rb +143 -1
  34. data/lib/osheet.rb +3 -29
  35. data/osheet.gemspec +4 -1
  36. data/test/cell_test.rb +33 -98
  37. data/test/column_test.rb +20 -88
  38. data/test/{mixins.rb → fixtures/mixins.rb} +6 -4
  39. data/test/fixtures/test_writer.rb +68 -0
  40. data/test/format_test.rb +2 -2
  41. data/test/helper.rb +34 -68
  42. data/test/mixin_test.rb +37 -43
  43. data/test/partial_test.rb +3 -26
  44. data/test/row_test.rb +32 -85
  45. data/test/style_test.rb +9 -26
  46. data/test/template_test.rb +5 -6
  47. data/test/workbook_element_test.rb +231 -0
  48. data/test/workbook_test.rb +225 -116
  49. data/test/worksheet_test.rb +51 -98
  50. data/test/xmlss_writer/api_test.rb +139 -0
  51. data/test/xmlss_writer/style_cache_test.rb +65 -0
  52. data/test/xmlss_writer/style_settings_test.rb +263 -0
  53. data/test/xmlss_writer/styles_test.rb +121 -153
  54. data/test/xmlss_writer_test.rb +91 -0
  55. metadata +75 -50
  56. data/lib/osheet/associations.rb +0 -58
  57. data/lib/osheet/instance.rb +0 -30
  58. data/lib/osheet/markup_element.rb +0 -22
  59. data/lib/osheet/partial_set.rb +0 -57
  60. data/lib/osheet/railtie.rb +0 -9
  61. data/lib/osheet/style_set.rb +0 -39
  62. data/lib/osheet/template_set.rb +0 -51
  63. data/lib/osheet/view_handler/rails.rb +0 -44
  64. data/lib/osheet/view_handler/tilt.rb +0 -42
  65. data/lib/osheet/view_handler.rb +0 -2
  66. data/lib/osheet/worksheet_element.rb +0 -17
  67. data/lib/osheet/xmlss_writer/base.rb +0 -49
  68. data/lib/osheet/xmlss_writer/elements.rb +0 -56
  69. data/lib/osheet/xmlss_writer/styles.rb +0 -216
  70. data/test/osheet_test.rb +0 -13
  71. data/test/partial_set_test.rb +0 -64
  72. data/test/style_set_test.rb +0 -47
  73. data/test/template_set_test.rb +0 -74
  74. data/test/xmlss_writer/base_test.rb +0 -103
  75. data/test/xmlss_writer/elements_test.rb +0 -172
data/Gemfile CHANGED
@@ -4,4 +4,3 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem 'rake', '~>0.9.2'
7
- gem 'ruby-prof'
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osheet (0.10.0)
4
+ osheet (1.0.0.rc.1)
5
5
  enumeration (~> 1.3)
6
- xmlss (~> 0.4)
6
+ xmlss (~> 1.0.0.rc)
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- ansi (1.4.1)
11
+ ansi (1.4.2)
12
12
  assert (0.7.3)
13
13
  assert-view (~> 0.5)
14
14
  assert-view (0.5.0)
@@ -17,10 +17,12 @@ GEM
17
17
  enumeration (1.3.1)
18
18
  rake (0.9.2.2)
19
19
  ruby-prof (0.10.8)
20
- undies (2.1.0)
21
- xmlss (0.4.0)
20
+ undies (2.2.1)
21
+ whysoslow (0.0.2)
22
+ ansi (~> 1.4)
23
+ xmlss (1.0.0.rc.1)
22
24
  enumeration (~> 1.3)
23
- undies (~> 2.1)
25
+ undies (~> 2.2.1)
24
26
 
25
27
  PLATFORMS
26
28
  ruby
@@ -31,3 +33,4 @@ DEPENDENCIES
31
33
  osheet!
32
34
  rake (~> 0.9.2)
33
35
  ruby-prof
36
+ whysoslow (~> 0.0)
data/Rakefile CHANGED
@@ -6,27 +6,43 @@ Bundler::GemHelper.install_tasks
6
6
 
7
7
  task :default => :build
8
8
 
9
- desc "Run the example workbook builds."
10
- task :run_examples do
11
- require 'examples/trivial'
12
- require 'examples/basic'
13
- require 'examples/basic_with_templates'
14
- require 'examples/formats'
15
- require 'examples/formula'
16
- require 'examples/styles'
17
- end
9
+ namespace :bench do
10
+
11
+ desc "Run the bench script."
12
+ task :run do
13
+ require 'bench/bench_runner'
14
+ OsheetBenchRunner.new
15
+ end
16
+
17
+ desc "Run the profiler on 1000 rows."
18
+ task :profiler do
19
+ require 'bench/profiler_runner'
20
+ runner = OsheetProfilerRunner.new(1000)
21
+ runner.print_flat(STDOUT, :min_percent => 3)
22
+ end
23
+
24
+ desc "Run the example workbook builds."
25
+ task :examples do
26
+ require 'examples/trivial'
27
+ require 'examples/basic'
28
+ require 'examples/basic_with_templates'
29
+ require 'examples/formats'
30
+ require 'examples/formula'
31
+ require 'examples/styles'
32
+ end
33
+
34
+ desc "Run all the tests, then the example builds, then the profiler."
35
+ task :all do
36
+ Rake::Task['test'].invoke
37
+ Rake::Task['bench:run'].invoke
38
+ Rake::Task['bench:profiler'].invoke
39
+ Rake::Task['bench:examples'].invoke
40
+ end
18
41
 
19
- desc "Run the profiler on 1000 rows."
20
- task :run_profiler do
21
- require 'bench/profiler_runner'
22
42
 
23
- runner = OsheetProfilerRunner.new(1000)
24
- runner.print_flat(STDOUT, :min_percent => 3)
25
43
  end
26
44
 
27
- desc "Run all the tests, then the example builds, then the profiler."
28
- task :run_all do
29
- Rake::Task['test'].invoke
30
- Rake::Task['run_examples'].invoke
31
- Rake::Task['run_profiler'].invoke
45
+ task :bench do
46
+ Rake::Task['bench:run'].invoke
32
47
  end
48
+
@@ -0,0 +1,91 @@
1
+ require 'whysoslow'
2
+ require 'stringio'
3
+
4
+ require 'osheet'
5
+
6
+ class OsheetBenchResults
7
+
8
+ def initialize(row_count)
9
+ @row_count = row_count
10
+ @printer = Whysoslow::DefaultPrinter.new({
11
+ :title => "#{@row_count} rows",
12
+ :verbose => true
13
+ })
14
+ @runner = Whysoslow::Runner.new(@printer)
15
+ end
16
+
17
+ def run
18
+ @runner.run do
19
+ data_values = {
20
+ :number => 1,
21
+ :text => 'text',
22
+ :currency => 123.45,
23
+ :text => "<>&'\"/",
24
+ :currency => 45.23
25
+ }
26
+
27
+ outstream = StringIO.new(out = "")
28
+ outstream << Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2), {
29
+ :bench_row_count => @row_count,
30
+ :runner => @runner
31
+ }) {
32
+ title "bench"
33
+
34
+ template(:row, :header) {
35
+ columns.each do |column|
36
+ cell {
37
+ data column.meta[:label]
38
+ }
39
+ end
40
+ }
41
+
42
+ template(:row, :data) { |values|
43
+ columns.each do |col|
44
+ cell {
45
+ data values[col.meta[:label]]
46
+ format col.meta[:label]
47
+ }
48
+ end
49
+ }
50
+
51
+ worksheet {
52
+ name "bench results"
53
+
54
+ data_values.keys.each do |label|
55
+ column {
56
+ width 200
57
+ meta(:label => label)
58
+ }
59
+ end
60
+
61
+ row :header
62
+
63
+ 10.times do |i|
64
+ (bench_row_count / 10).times do
65
+ row :data, data_values
66
+ end
67
+ runner.snapshot("#{((i+1)*10).to_s.rjust(3)}%")
68
+ end
69
+ }
70
+ }.to_data
71
+ end
72
+ end
73
+
74
+ end
75
+
76
+ class OsheetBenchRunner
77
+
78
+ ROWS = [10, 100, 1000, 10000]#, 30000]
79
+
80
+ def initialize
81
+ puts "Benchmark Results:"
82
+ puts
83
+ ROWS.each do |size|
84
+ OsheetBenchResults.new(size).run
85
+ puts
86
+ end
87
+ puts
88
+ end
89
+
90
+ end
91
+
@@ -7,6 +7,7 @@ class OsheetProfilerRunner
7
7
 
8
8
  def initialize(n)
9
9
 
10
+ RubyProf.measure_mode = RubyProf::MEMORY
10
11
  @result = RubyProf.profile do
11
12
  Osheet::Workbook.new {
12
13
  title "basic"
data/examples/basic.rb CHANGED
@@ -17,7 +17,7 @@ data = {
17
17
 
18
18
  puts "building examples/basic.rb ..."
19
19
 
20
- Osheet::Workbook.new {
20
+ Osheet::Workbook.new(Osheet::XmlssWriter.new) {
21
21
  title "basic"
22
22
  worksheet {
23
23
  name "Stats: #{fields.join(', ')}"
data/examples/basic.xls CHANGED
@@ -1 +1,2 @@
1
- <?xml version="1.0" encoding="UTF-8"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><Styles></Styles><Worksheet ss:Name="Stats Sex, Age, Height, Weight"><Table><Column ss:Width="200" /><Column ss:Width="80" /><Column ss:Width="80" /><Column ss:Width="80" /><Column ss:Width="80" /><Row><Cell ss:MergeAcross="4"><Data ss:Type="String">Stats: Sex, Age, Height, Weight</Data></Cell></Row><Row><Cell ss:MergeAcross="4"><Data ss:Type="String"></Data></Cell></Row><Row><Cell><Data ss:Type="String">Name</Data></Cell><Cell><Data ss:Type="String">Sex</Data></Cell><Cell><Data ss:Type="String">Age</Data></Cell><Cell><Data ss:Type="String">Height</Data></Cell><Cell><Data ss:Type="String">Weight</Data></Cell></Row><Row><Cell><Data ss:Type="String">Sally</Data></Cell><Cell><Data ss:Type="String">F</Data></Cell><Cell><Data ss:Type="Number">29</Data></Cell><Cell><Data ss:Type="String">5'3"</Data></Cell><Cell><Data ss:Type="String">132 lbs.</Data></Cell></Row><Row><Cell><Data ss:Type="String">Dick</Data></Cell><Cell><Data ss:Type="String">M</Data></Cell><Cell><Data ss:Type="Number">33</Data></Cell><Cell><Data ss:Type="String">6'5"</Data></Cell><Cell><Data ss:Type="String">243 lbs.</Data></Cell></Row><Row><Cell><Data ss:Type="String">Tom</Data></Cell><Cell><Data ss:Type="String">M</Data></Cell><Cell><Data ss:Type="Number">52</Data></Cell><Cell><Data ss:Type="String">6'2"</Data></Cell><Cell><Data ss:Type="String">220 lbs.</Data></Cell></Row></Table></Worksheet></Workbook>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><Styles></Styles><Worksheet ss:Name="Stats Sex, Age, Height, Weight"><Table><Column ss:Width="200" /><Column ss:Width="80" /><Column ss:Width="80" /><Column ss:Width="80" /><Column ss:Width="80" /><Row><Cell ss:MergeAcross="4"><Data ss:Type="String">Stats: Sex, Age, Height, Weight</Data></Cell></Row><Row><Cell ss:MergeAcross="4"><Data ss:Type="String"></Data></Cell></Row><Row><Cell><Data ss:Type="String">Name</Data></Cell><Cell><Data ss:Type="String">Sex</Data></Cell><Cell><Data ss:Type="String">Age</Data></Cell><Cell><Data ss:Type="String">Height</Data></Cell><Cell><Data ss:Type="String">Weight</Data></Cell></Row><Row><Cell><Data ss:Type="String">Sally</Data></Cell><Cell><Data ss:Type="String">F</Data></Cell><Cell><Data ss:Type="Number">29</Data></Cell><Cell><Data ss:Type="String">5&#x27;3&quot;</Data></Cell><Cell><Data ss:Type="String">132 lbs.</Data></Cell></Row><Row><Cell><Data ss:Type="String">Dick</Data></Cell><Cell><Data ss:Type="String">M</Data></Cell><Cell><Data ss:Type="Number">33</Data></Cell><Cell><Data ss:Type="String">6&#x27;5&quot;</Data></Cell><Cell><Data ss:Type="String">243 lbs.</Data></Cell></Row><Row><Cell><Data ss:Type="String">Tom</Data></Cell><Cell><Data ss:Type="String">M</Data></Cell><Cell><Data ss:Type="Number">52</Data></Cell><Cell><Data ss:Type="String">6&#x27;2&quot;</Data></Cell><Cell><Data ss:Type="String">220 lbs.</Data></Cell></Row></Table></Worksheet></Workbook>
@@ -17,7 +17,7 @@ data = {
17
17
 
18
18
  puts "building examples/basic_with_templats.rb ..."
19
19
 
20
- Osheet::Workbook.new {
20
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2)) {
21
21
  title "basic"
22
22
 
23
23
  template(:column, :data) { |field, index|
@@ -82,6 +82,6 @@ Osheet::Workbook.new {
82
82
  row :data, name, stats
83
83
  end
84
84
  }
85
- }.to_file('examples/basic_with_templates.xls', :pp => 2)
85
+ }.to_file('examples/basic_with_templates.xls')
86
86
 
87
87
  puts "open examples/basic_with_templates.xls"
@@ -48,7 +48,7 @@
48
48
  <Data ss:Type="Number">29</Data>
49
49
  </Cell>
50
50
  <Cell>
51
- <Data ss:Type="String">5'3"</Data>
51
+ <Data ss:Type="String">5&#x27;3&quot;</Data>
52
52
  </Cell>
53
53
  <Cell>
54
54
  <Data ss:Type="String">132 lbs.</Data>
@@ -65,7 +65,7 @@
65
65
  <Data ss:Type="Number">33</Data>
66
66
  </Cell>
67
67
  <Cell>
68
- <Data ss:Type="String">6'5"</Data>
68
+ <Data ss:Type="String">6&#x27;5&quot;</Data>
69
69
  </Cell>
70
70
  <Cell>
71
71
  <Data ss:Type="String">243 lbs.</Data>
@@ -82,7 +82,7 @@
82
82
  <Data ss:Type="Number">52</Data>
83
83
  </Cell>
84
84
  <Cell>
85
- <Data ss:Type="String">6'2"</Data>
85
+ <Data ss:Type="String">6&#x27;2&quot;</Data>
86
86
  </Cell>
87
87
  <Cell>
88
88
  <Data ss:Type="String">220 lbs.</Data>
data/examples/formats.rb CHANGED
@@ -8,7 +8,7 @@ require 'osheet'
8
8
 
9
9
  puts "building examples/formats.rb ..."
10
10
 
11
- Osheet::Workbook.new {
11
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2)) {
12
12
  title "formats"
13
13
 
14
14
 
@@ -365,6 +365,6 @@ Osheet::Workbook.new {
365
365
 
366
366
 
367
367
 
368
- }.to_file('examples/formats.xls', :pp => 2)
368
+ }.to_file('examples/formats.xls')
369
369
 
370
370
  puts "open examples/formats.xls"
data/examples/formats.xls CHANGED
@@ -61,6 +61,12 @@
61
61
  <Style ss:ID="..scientific_none_8_comma_redparenth">
62
62
  <NumberFormat ss:Format="#,##0.00000000E+00_);[Red](#,##0.00000000E+00)" />
63
63
  </Style>
64
+ <Style ss:ID="..fraction_threedigits">
65
+ <NumberFormat ss:Format="# ???/???" />
66
+ </Style>
67
+ <Style ss:ID="..fraction_hundredths">
68
+ <NumberFormat ss:Format="# ??/100" />
69
+ </Style>
64
70
  <Style ss:ID="..fraction_halves">
65
71
  <NumberFormat ss:Format="# ?/2" />
66
72
  </Style>
@@ -82,12 +88,6 @@
82
88
  <Style ss:ID="..fraction_tenths">
83
89
  <NumberFormat ss:Format="# ?/10" />
84
90
  </Style>
85
- <Style ss:ID="..fraction_threedigits">
86
- <NumberFormat ss:Format="# ???/???" />
87
- </Style>
88
- <Style ss:ID="..fraction_hundredths">
89
- <NumberFormat ss:Format="# ??/100" />
90
- </Style>
91
91
  <Style ss:ID="..text">
92
92
  <NumberFormat ss:Format="@" />
93
93
  </Style>
@@ -447,6 +447,22 @@
447
447
  <Data ss:Type="String">Fraction Example</Data>
448
448
  </Cell>
449
449
  </Row>
450
+ <Row>
451
+ <Cell>
452
+ <Data ss:Type="String">fraction_threedigits</Data>
453
+ </Cell>
454
+ <Cell ss:StyleID="..fraction_threedigits">
455
+ <Data ss:Type="Number">0.01</Data>
456
+ </Cell>
457
+ </Row>
458
+ <Row>
459
+ <Cell>
460
+ <Data ss:Type="String">fraction_hundredths</Data>
461
+ </Cell>
462
+ <Cell ss:StyleID="..fraction_hundredths">
463
+ <Data ss:Type="Number">0.01</Data>
464
+ </Cell>
465
+ </Row>
450
466
  <Row>
451
467
  <Cell>
452
468
  <Data ss:Type="String">fraction_halves</Data>
@@ -503,22 +519,6 @@
503
519
  <Data ss:Type="Number">0.1</Data>
504
520
  </Cell>
505
521
  </Row>
506
- <Row>
507
- <Cell>
508
- <Data ss:Type="String">fraction_threedigits</Data>
509
- </Cell>
510
- <Cell ss:StyleID="..fraction_threedigits">
511
- <Data ss:Type="Number">0.01</Data>
512
- </Cell>
513
- </Row>
514
- <Row>
515
- <Cell>
516
- <Data ss:Type="String">fraction_hundredths</Data>
517
- </Cell>
518
- <Cell ss:StyleID="..fraction_hundredths">
519
- <Data ss:Type="Number">0.01</Data>
520
- </Cell>
521
- </Row>
522
522
  </Table>
523
523
  </Worksheet>
524
524
  <Worksheet ss:Name="text, special, custom">
@@ -600,7 +600,7 @@
600
600
  <Data ss:Type="String">datetime_m</Data>
601
601
  </Cell>
602
602
  <Cell ss:StyleID="..datetime_m">
603
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
603
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
604
604
  </Cell>
605
605
  </Row>
606
606
  <Row>
@@ -608,7 +608,7 @@
608
608
  <Data ss:Type="String">datetime_d</Data>
609
609
  </Cell>
610
610
  <Cell ss:StyleID="..datetime_d">
611
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
611
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
612
612
  </Cell>
613
613
  </Row>
614
614
  <Row>
@@ -616,7 +616,7 @@
616
616
  <Data ss:Type="String">datetime_y</Data>
617
617
  </Cell>
618
618
  <Cell ss:StyleID="..datetime_y">
619
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
619
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
620
620
  </Cell>
621
621
  </Row>
622
622
  <Row>
@@ -624,7 +624,7 @@
624
624
  <Data ss:Type="String">datetime_mm</Data>
625
625
  </Cell>
626
626
  <Cell ss:StyleID="..datetime_mm">
627
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
627
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
628
628
  </Cell>
629
629
  </Row>
630
630
  <Row>
@@ -632,7 +632,7 @@
632
632
  <Data ss:Type="String">datetime_dd</Data>
633
633
  </Cell>
634
634
  <Cell ss:StyleID="..datetime_dd">
635
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
635
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
636
636
  </Cell>
637
637
  </Row>
638
638
  <Row>
@@ -640,7 +640,7 @@
640
640
  <Data ss:Type="String">datetime_yy</Data>
641
641
  </Cell>
642
642
  <Cell ss:StyleID="..datetime_yy">
643
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
643
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
644
644
  </Cell>
645
645
  </Row>
646
646
  <Row>
@@ -648,23 +648,23 @@
648
648
  <Data ss:Type="String">datetime_yyyy</Data>
649
649
  </Cell>
650
650
  <Cell ss:StyleID="..datetime_yyyy">
651
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
651
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
652
652
  </Cell>
653
653
  </Row>
654
654
  <Row>
655
655
  <Cell>
656
- <Data ss:Type="String">datetime_mm/dd/yy</Data>
656
+ <Data ss:Type="String">datetime_mm&#x2F;dd&#x2F;yy</Data>
657
657
  </Cell>
658
658
  <Cell ss:StyleID="..datetime_mm/dd/yy">
659
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
659
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
660
660
  </Cell>
661
661
  </Row>
662
662
  <Row>
663
663
  <Cell>
664
- <Data ss:Type="String">datetime_mm/dd/yyyy</Data>
664
+ <Data ss:Type="String">datetime_mm&#x2F;dd&#x2F;yyyy</Data>
665
665
  </Cell>
666
666
  <Cell ss:StyleID="..datetime_mm/dd/yyyy">
667
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
667
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
668
668
  </Cell>
669
669
  </Row>
670
670
  <Row>
@@ -672,7 +672,7 @@
672
672
  <Data ss:Type="String">datetime_mmmm</Data>
673
673
  </Cell>
674
674
  <Cell ss:StyleID="..datetime_mmmm">
675
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
675
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
676
676
  </Cell>
677
677
  </Row>
678
678
  <Row>
@@ -680,7 +680,7 @@
680
680
  <Data ss:Type="String">datetime_mmmmm</Data>
681
681
  </Cell>
682
682
  <Cell ss:StyleID="..datetime_mmmmm">
683
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
683
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
684
684
  </Cell>
685
685
  </Row>
686
686
  <Row>
@@ -688,7 +688,7 @@
688
688
  <Data ss:Type="String">datetime_mmmmm</Data>
689
689
  </Cell>
690
690
  <Cell ss:StyleID="..datetime_mmmmm">
691
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
691
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
692
692
  </Cell>
693
693
  </Row>
694
694
  <Row>
@@ -696,7 +696,7 @@
696
696
  <Data ss:Type="String">datetime_h</Data>
697
697
  </Cell>
698
698
  <Cell ss:StyleID="..datetime_h">
699
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
699
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
700
700
  </Cell>
701
701
  </Row>
702
702
  <Row>
@@ -704,7 +704,7 @@
704
704
  <Data ss:Type="String">datetime_m</Data>
705
705
  </Cell>
706
706
  <Cell ss:StyleID="..datetime_m">
707
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
707
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
708
708
  </Cell>
709
709
  </Row>
710
710
  <Row>
@@ -712,7 +712,7 @@
712
712
  <Data ss:Type="String">datetime_s</Data>
713
713
  </Cell>
714
714
  <Cell ss:StyleID="..datetime_s">
715
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
715
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
716
716
  </Cell>
717
717
  </Row>
718
718
  <Row>
@@ -720,7 +720,7 @@
720
720
  <Data ss:Type="String">datetime_hh</Data>
721
721
  </Cell>
722
722
  <Cell ss:StyleID="..datetime_hh">
723
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
723
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
724
724
  </Cell>
725
725
  </Row>
726
726
  <Row>
@@ -728,7 +728,7 @@
728
728
  <Data ss:Type="String">datetime_mm</Data>
729
729
  </Cell>
730
730
  <Cell ss:StyleID="..datetime_mm">
731
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
731
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
732
732
  </Cell>
733
733
  </Row>
734
734
  <Row>
@@ -736,7 +736,7 @@
736
736
  <Data ss:Type="String">datetime_ss</Data>
737
737
  </Cell>
738
738
  <Cell ss:StyleID="..datetime_ss">
739
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
739
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
740
740
  </Cell>
741
741
  </Row>
742
742
  <Row>
@@ -744,7 +744,7 @@
744
744
  <Data ss:Type="String">datetime_h:mm:ss</Data>
745
745
  </Cell>
746
746
  <Cell ss:StyleID="..datetime_h:mm:ss">
747
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
747
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
748
748
  </Cell>
749
749
  </Row>
750
750
  <Row>
@@ -752,15 +752,15 @@
752
752
  <Data ss:Type="String">datetime_h:mm:ss.0</Data>
753
753
  </Cell>
754
754
  <Cell ss:StyleID="..datetime_h:mm:ss.0">
755
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
755
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
756
756
  </Cell>
757
757
  </Row>
758
758
  <Row>
759
759
  <Cell>
760
- <Data ss:Type="String">datetime_hh:mm:ss AM/PM</Data>
760
+ <Data ss:Type="String">datetime_hh:mm:ss AM&#x2F;PM</Data>
761
761
  </Cell>
762
762
  <Cell ss:StyleID="..datetime_hh:mm:ss AM/PM">
763
- <Data ss:Type="DateTime">2012-01-09T00:00:00</Data>
763
+ <Data ss:Type="DateTime">2012-03-14T00:00:00</Data>
764
764
  </Cell>
765
765
  </Row>
766
766
  </Table>
data/examples/formula.rb CHANGED
@@ -11,7 +11,7 @@ require 'osheet'
11
11
 
12
12
  puts "building examples/formula.rb ..."
13
13
 
14
- Osheet::Workbook.new {
14
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2)) {
15
15
  title "formula example"
16
16
  worksheet {
17
17
  name "Formula"
@@ -38,6 +38,6 @@ Osheet::Workbook.new {
38
38
  }
39
39
  }
40
40
  }
41
- }.to_file('examples/formula.xls', :pp => 2)
41
+ }.to_file('examples/formula.xls')
42
42
 
43
43
  puts "open examples/formula.xls"
data/examples/styles.rb CHANGED
@@ -8,7 +8,7 @@ require 'osheet'
8
8
 
9
9
  puts "building examples/styles.rb ..."
10
10
 
11
- Osheet::Workbook.new {
11
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2)) {
12
12
  title "styles"
13
13
  template(:cell, :styled) { |style, attribute|
14
14
  data attribute == :wrap ? (attribute.to_s+' ')*20 : attribute.to_s
@@ -250,6 +250,6 @@ Osheet::Workbook.new {
250
250
 
251
251
 
252
252
 
253
- }.to_file('examples/styles.xls', :pp => 2)
253
+ }.to_file('examples/styles.xls')
254
254
 
255
255
  puts "open examples/styles.xls"
data/examples/styles.xls CHANGED
@@ -293,7 +293,7 @@
293
293
  <Table>
294
294
  <Column ss:Width="20" />
295
295
  <Column ss:Width="200" />
296
- <Row></Row>
296
+ <Row />
297
297
  <Row ss:Height="50">
298
298
  <Cell>
299
299
  <Data ss:Type="String"></Data>
@@ -302,7 +302,7 @@
302
302
  <Data ss:Type="String">top red hairline continuous</Data>
303
303
  </Cell>
304
304
  </Row>
305
- <Row></Row>
305
+ <Row />
306
306
  <Row ss:Height="50">
307
307
  <Cell>
308
308
  <Data ss:Type="String"></Data>
@@ -311,7 +311,7 @@
311
311
  <Data ss:Type="String">right green thin dash</Data>
312
312
  </Cell>
313
313
  </Row>
314
- <Row></Row>
314
+ <Row />
315
315
  <Row ss:Height="50">
316
316
  <Cell>
317
317
  <Data ss:Type="String"></Data>
@@ -320,7 +320,7 @@
320
320
  <Data ss:Type="String">bottom blue medium dat</Data>
321
321
  </Cell>
322
322
  </Row>
323
- <Row></Row>
323
+ <Row />
324
324
  <Row ss:Height="50">
325
325
  <Cell>
326
326
  <Data ss:Type="String"></Data>
@@ -329,7 +329,7 @@
329
329
  <Data ss:Type="String">left yellow thick dast_dot</Data>
330
330
  </Cell>
331
331
  </Row>
332
- <Row></Row>
332
+ <Row />
333
333
  <Row ss:Height="50">
334
334
  <Cell>
335
335
  <Data ss:Type="String"></Data>
data/examples/trivial.rb CHANGED
@@ -8,7 +8,7 @@ require 'osheet'
8
8
 
9
9
  puts "building examples/trivial.rb ..."
10
10
 
11
- Osheet::Workbook.new {
11
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2)) {
12
12
  title "basic"
13
13
  worksheet {
14
14
  name "one dollar"
@@ -20,6 +20,6 @@ Osheet::Workbook.new {
20
20
  }
21
21
  }
22
22
  }
23
- }.to_file('examples/trivial.xls', :pp => 2)
23
+ }.to_file('examples/trivial.xls')
24
24
 
25
25
  puts "open examples/trivial.xls"