osheet-xmlss 1.0.0.rc.1 → 1.0.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,24 +6,52 @@ class OsheetXmlssProfilerRunner
6
6
  attr_reader :result
7
7
 
8
8
  def initialize(n)
9
-
10
- RubyProf.measure_mode = RubyProf::MEMORY
9
+ # RubyProf.measure_mode = RubyProf::MEMORY
11
10
  @result = RubyProf.profile do
12
- Osheet::Workbook.new {
13
- title "basic"
11
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2), {
12
+ :profiler_row_count => n,
13
+ :data_values => {
14
+ 'number' => 1,
15
+ 'currency' => 123.45,
16
+ 'text' => "<>&'\"/"
17
+ }
18
+ }) {
19
+ title "bench"
20
+
21
+ template(:row, :header) {
22
+ columns.each do |column|
23
+ cell {
24
+ data column.meta[:label]
25
+ }
26
+ end
27
+ }
28
+
29
+ template(:row, :data) { |values|
30
+ columns.each do |col|
31
+ cell {
32
+ data values[col.meta[:label]]
33
+ format col.meta[:label]
34
+ }
35
+ end
36
+ }
37
+
14
38
  worksheet {
15
- name "one dollar"
16
- 5.times { column }
17
-
18
- 1000.times do
19
- row {
20
- [1, "text", 123.45, "0001267", "$45.23"].each do |data_value|
21
- cell { data data_value }
22
- end
39
+ name "profiler results"
40
+
41
+ data_values.keys.each do |label|
42
+ column {
43
+ width 200
44
+ meta(:label => label)
23
45
  }
24
46
  end
47
+
48
+ row :header
49
+
50
+ profiler_row_count.times do
51
+ row :data, data_values
52
+ end
25
53
  }
26
- }.to_file('./bench/profiler_1000.xls', :pp => 2)
54
+ }.to_file("./bench/profiler_runner_#{n}.xls")
27
55
  end
28
56
 
29
57
  end
@@ -23,16 +23,16 @@ module Osheet::Xmlss
23
23
  def get(style_class, format)
24
24
  # generate the style key and get the get the cached style or
25
25
  # build and cache and return a style for the key
26
- return nil if (key = self.key(style_class, format.key)).empty?
26
+ key = self.key(style_class, format.key)
27
+ return nil if key == '..'
28
+
27
29
  @styles[key] ||
28
30
  build_and_cache(key, @osheet_workbook.styles.for(style_class), format)
29
31
  end
30
32
 
31
33
  # build a unique key for styling based off the style and format keys
32
34
  def key(class_value, format_key)
33
- (class_value || '').strip.split(/\s+/).collect do |c|
34
- ".#{c}"
35
- end.join('') + (format_key.nil? || format_key.empty? ? '' : "..#{format_key}")
35
+ "#{(class_value || '').strip.gsub(/\s+/, '.')}..#{format_key}"
36
36
  end
37
37
 
38
38
  protected
@@ -1,4 +1,4 @@
1
1
  module Osheet;end
2
2
  module Osheet::Xmlss
3
- VERSION = "1.0.0.rc.1"
3
+ VERSION = "1.0.0.rc.2"
4
4
  end
@@ -91,12 +91,12 @@ module Osheet
91
91
  # 2) set the current element's style_id attribute
92
92
 
93
93
  def style(style_class, format=nil)
94
- @style_cache.get(
94
+ xs = @style_cache.get(
95
95
  style_class,
96
96
  format || Osheet::Format.new(:general)
97
- ).tap do |xmlss_style|
98
- @xmlss_workbook.style_id(xmlss_style.id) if xmlss_style
99
- end
97
+ )
98
+ @xmlss_workbook.style_id(xs.id) if xs
99
+ xs
100
100
  end
101
101
 
102
102
  def colspan(count)
data/osheet-xmlss.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.add_development_dependency("assert")
20
20
 
21
- gem.add_dependency("osheet", ["~> 1.0.0.rc.2"])
22
- gem.add_dependency("xmlss", ["~> 1.0.0.rc"])
21
+ gem.add_dependency("osheet", ["~> 1.0.0.rc.3"])
22
+ gem.add_dependency("xmlss", ["~> 1.0.0.rc.3"])
23
23
 
24
24
  end
@@ -38,13 +38,13 @@ module Osheet::Xmlss
38
38
  end
39
39
 
40
40
  should "style the cell" do
41
- assert_equal ".awesome.thing..number_none_0_nocomma_black", @xmlss_cell.style_id
41
+ assert_equal "awesome.thing..number_none_0_nocomma_black", @xmlss_cell.style_id
42
42
  assert_equal 1, subject.style_cache.size
43
43
  end
44
44
 
45
45
  should "write cell element markup" do
46
46
  assert_equal(
47
- "<Cell ss:Formula=\"=R1C1\" ss:HRef=\"http://example.com\" ss:Index=\"3\" ss:MergeAcross=\"4\" ss:MergeDown=\"1\" ss:StyleID=\".awesome.thing..number_none_0_nocomma_black\"><Data ss:Type=\"Number\">100</Data></Cell>",
47
+ "<Cell ss:Formula=\"=R1C1\" ss:HRef=\"http://example.com\" ss:Index=\"3\" ss:MergeAcross=\"4\" ss:MergeDown=\"1\" ss:StyleID=\"awesome.thing..number_none_0_nocomma_black\"><Data ss:Type=\"Number\">100</Data></Cell>",
48
48
  xmlss_element_markup(subject)
49
49
  )
50
50
  end
@@ -70,13 +70,13 @@ module Osheet::Xmlss
70
70
  end
71
71
 
72
72
  should "style the row" do
73
- assert_equal ".awesome.thing", @xmlss_row.style_id
73
+ assert_equal "awesome.thing..", @xmlss_row.style_id
74
74
  assert_equal 1, subject.style_cache.size
75
75
  end
76
76
 
77
77
  should "write row element markup" do
78
78
  assert_equal(
79
- "<Row ss:AutoFitHeight=\"1\" ss:Height=\"100\" ss:Hidden=\"1\" ss:StyleID=\".awesome.thing\" />",
79
+ "<Row ss:AutoFitHeight=\"1\" ss:Height=\"100\" ss:Hidden=\"1\" ss:StyleID=\"awesome.thing..\"></Row>",
80
80
  xmlss_element_markup(subject)
81
81
  )
82
82
  end
@@ -102,13 +102,13 @@ module Osheet::Xmlss
102
102
  end
103
103
 
104
104
  should "style an Xmlss column" do
105
- assert_equal ".awesome", @xmlss_column.style_id
105
+ assert_equal "awesome..", @xmlss_column.style_id
106
106
  assert_equal 1, subject.style_cache.size
107
107
  end
108
108
 
109
109
  should "write column element markup" do
110
110
  assert_equal(
111
- "<Column ss:AutoFitWidth=\"1\" ss:Hidden=\"1\" ss:StyleID=\".awesome\" ss:Width=\"100\" />",
111
+ "<Column ss:AutoFitWidth=\"1\" ss:Hidden=\"1\" ss:StyleID=\"awesome..\" ss:Width=\"100\" />",
112
112
  xmlss_element_markup(subject)
113
113
  )
114
114
  end
@@ -129,7 +129,7 @@ module Osheet::Xmlss
129
129
 
130
130
  should "write worksheet element markup" do
131
131
  assert_equal(
132
- "<Worksheet ss:Name=\"testsheet2\"><Table /></Worksheet>",
132
+ "<Worksheet ss:Name=\"testsheet2\"><Table></Table></Worksheet>",
133
133
  xmlss_element_markup(subject)
134
134
  )
135
135
  end
@@ -28,11 +28,11 @@ module Osheet::Xmlss
28
28
  end
29
29
 
30
30
  should "key based off class value and format key" do
31
- assert_equal '', subject.send(:key, '', nil)
32
- assert_equal '.awesome', subject.send(:key, 'awesome', nil)
33
- assert_equal '.awesome.thing', subject.send(:key, 'awesome thing', nil)
34
- assert_equal '.awesome..something', subject.send(:key, 'awesome', 'something')
35
- assert_equal '..something', subject.send(:key, '', 'something')
31
+ assert_equal '..', subject.send(:key, '', nil)
32
+ assert_equal 'awesome..', subject.send(:key, 'awesome', nil)
33
+ assert_equal 'awesome.thing..', subject.send(:key, 'awesome thing', nil)
34
+ assert_equal 'awesome..something', subject.send(:key, 'awesome', 'something')
35
+ assert_equal '..something', subject.send(:key, '', 'something')
36
36
  end
37
37
 
38
38
  should "return nil if trying to get the style for an empty class and general format" do
@@ -38,14 +38,14 @@ module Osheet::Xmlss
38
38
  should "build a style obj and add it to the writers styles" do
39
39
  xmlss_style = subject.style('awesome')
40
40
  assert_kind_of ::Xmlss::Style::Base, xmlss_style
41
- assert_equal '.awesome', xmlss_style.id
41
+ assert_equal 'awesome..', xmlss_style.id
42
42
  assert_equal 1, subject.style_cache.size
43
43
  assert_equal xmlss_style, subject.style_cache[xmlss_style.id]
44
44
  end
45
45
 
46
46
  should "write style markup from many matching osheet styles" do
47
47
  xmlss_style = subject.style('font size weight style align center')
48
- assert_equal '.font.size.weight.style.align.center', xmlss_style.id
48
+ assert_equal 'font.size.weight.style.align.center..', xmlss_style.id
49
49
  end
50
50
 
51
51
  end
@@ -65,7 +65,7 @@ module Osheet::Xmlss
65
65
  should "write style markup with no alignment settings if no alignment style match" do
66
66
  subject.style('align')
67
67
  assert_equal(
68
- "<Style ss:ID=\".align\"><NumberFormat /></Style>",
68
+ "<Style ss:ID=\"align..\"><NumberFormat /></Style>",
69
69
  xmlss_style_markup(subject)
70
70
  )
71
71
  end
@@ -75,7 +75,7 @@ module Osheet::Xmlss
75
75
  subject.style('align center')
76
76
  subject.style('align right')
77
77
  assert_equal(
78
- "<Style ss:ID=\".align.left\"><Alignment ss:Horizontal=\"Left\" /><NumberFormat /></Style><Style ss:ID=\".align.center\"><Alignment ss:Horizontal=\"Center\" /><NumberFormat /></Style><Style ss:ID=\".align.right\"><Alignment ss:Horizontal=\"Right\" /><NumberFormat /></Style>",
78
+ "<Style ss:ID=\"align.left..\"><Alignment ss:Horizontal=\"Left\" /><NumberFormat /></Style><Style ss:ID=\"align.center..\"><Alignment ss:Horizontal=\"Center\" /><NumberFormat /></Style><Style ss:ID=\"align.right..\"><Alignment ss:Horizontal=\"Right\" /><NumberFormat /></Style>",
79
79
  xmlss_style_markup(subject)
80
80
  )
81
81
  end
@@ -85,7 +85,7 @@ module Osheet::Xmlss
85
85
  subject.style('align middle')
86
86
  subject.style('align bottom')
87
87
  assert_equal(
88
- "<Style ss:ID=\".align.top\"><Alignment ss:Vertical=\"Top\" /><NumberFormat /></Style><Style ss:ID=\".align.middle\"><Alignment ss:Vertical=\"Center\" /><NumberFormat /></Style><Style ss:ID=\".align.bottom\"><Alignment ss:Vertical=\"Bottom\" /><NumberFormat /></Style>",
88
+ "<Style ss:ID=\"align.top..\"><Alignment ss:Vertical=\"Top\" /><NumberFormat /></Style><Style ss:ID=\"align.middle..\"><Alignment ss:Vertical=\"Center\" /><NumberFormat /></Style><Style ss:ID=\"align.bottom..\"><Alignment ss:Vertical=\"Bottom\" /><NumberFormat /></Style>",
89
89
  xmlss_style_markup(subject)
90
90
  )
91
91
  end
@@ -93,7 +93,7 @@ module Osheet::Xmlss
93
93
  should "write style markup for text wrap settings" do
94
94
  subject.style('align wrap')
95
95
  assert_equal(
96
- "<Style ss:ID=\".align.wrap\"><Alignment ss:WrapText=\"1\" /><NumberFormat /></Style>",
96
+ "<Style ss:ID=\"align.wrap..\"><Alignment ss:WrapText=\"1\" /><NumberFormat /></Style>",
97
97
  xmlss_style_markup(subject)
98
98
  )
99
99
  end
@@ -101,7 +101,7 @@ module Osheet::Xmlss
101
101
  should "write style markup for text rotation settings" do
102
102
  subject.style('align rotate')
103
103
  assert_equal(
104
- "<Style ss:ID=\".align.rotate\"><Alignment ss:Rotate=\"90\" /><NumberFormat /></Style>",
104
+ "<Style ss:ID=\"align.rotate..\"><Alignment ss:Rotate=\"90\" /><NumberFormat /></Style>",
105
105
  xmlss_style_markup(subject)
106
106
  )
107
107
  end
@@ -125,7 +125,7 @@ module Osheet::Xmlss
125
125
  should "write style markup with empty font settings if no match" do
126
126
  subject.style('font')
127
127
  assert_equal(
128
- "<Style ss:ID=\".font\"><NumberFormat /></Style>",
128
+ "<Style ss:ID=\"font..\"><NumberFormat /></Style>",
129
129
  xmlss_style_markup(subject)
130
130
  )
131
131
  end
@@ -136,7 +136,7 @@ module Osheet::Xmlss
136
136
  subject.style('font accounting_underline')
137
137
  subject.style('font double_accounting_underline')
138
138
  assert_equal(
139
- "<Style ss:ID=\".font.underline\"><Font ss:Underline=\"Single\" /><NumberFormat /></Style><Style ss:ID=\".font.double_underline\"><Font ss:Underline=\"Double\" /><NumberFormat /></Style><Style ss:ID=\".font.accounting_underline\"><Font ss:Underline=\"SingleAccounting\" /><NumberFormat /></Style><Style ss:ID=\".font.double_accounting_underline\"><Font ss:Underline=\"DoubleAccounting\" /><NumberFormat /></Style>",
139
+ "<Style ss:ID=\"font.underline..\"><Font ss:Underline=\"Single\" /><NumberFormat /></Style><Style ss:ID=\"font.double_underline..\"><Font ss:Underline=\"Double\" /><NumberFormat /></Style><Style ss:ID=\"font.accounting_underline..\"><Font ss:Underline=\"SingleAccounting\" /><NumberFormat /></Style><Style ss:ID=\"font.double_accounting_underline..\"><Font ss:Underline=\"DoubleAccounting\" /><NumberFormat /></Style>",
140
140
  xmlss_style_markup(subject)
141
141
  )
142
142
 
@@ -146,7 +146,7 @@ module Osheet::Xmlss
146
146
  subject.style('font subscript')
147
147
  subject.style('font superscript')
148
148
  assert_equal(
149
- "<Style ss:ID=\".font.subscript\"><Font ss:VerticalAlign=\"Subscript\" /><NumberFormat /></Style><Style ss:ID=\".font.superscript\"><Font ss:VerticalAlign=\"Superscript\" /><NumberFormat /></Style>",
149
+ "<Style ss:ID=\"font.subscript..\"><Font ss:VerticalAlign=\"Subscript\" /><NumberFormat /></Style><Style ss:ID=\"font.superscript..\"><Font ss:VerticalAlign=\"Superscript\" /><NumberFormat /></Style>",
150
150
  xmlss_style_markup(subject)
151
151
  )
152
152
  end
@@ -157,7 +157,7 @@ module Osheet::Xmlss
157
157
  subject.style('font strikethrough')
158
158
  subject.style('font shadow')
159
159
  assert_equal(
160
- "<Style ss:ID=\".font.bold\"><Font ss:Bold=\"1\" /><NumberFormat /></Style><Style ss:ID=\".font.italic\"><Font ss:Italic=\"1\" /><NumberFormat /></Style><Style ss:ID=\".font.strikethrough\"><Font ss:StrikeThrough=\"1\" /><NumberFormat /></Style><Style ss:ID=\".font.shadow\"><Font ss:Shadow=\"1\" /><NumberFormat /></Style>",
160
+ "<Style ss:ID=\"font.bold..\"><Font ss:Bold=\"1\" /><NumberFormat /></Style><Style ss:ID=\"font.italic..\"><Font ss:Italic=\"1\" /><NumberFormat /></Style><Style ss:ID=\"font.strikethrough..\"><Font ss:StrikeThrough=\"1\" /><NumberFormat /></Style><Style ss:ID=\"font.shadow..\"><Font ss:Shadow=\"1\" /><NumberFormat /></Style>",
161
161
  xmlss_style_markup(subject)
162
162
  )
163
163
  end
@@ -165,7 +165,7 @@ module Osheet::Xmlss
165
165
  should "write style markup for font size" do
166
166
  subject.style('font size')
167
167
  assert_equal(
168
- "<Style ss:ID=\".font.size\"><Font ss:Size=\"14\" /><NumberFormat /></Style>",
168
+ "<Style ss:ID=\"font.size..\"><Font ss:Size=\"14\" /><NumberFormat /></Style>",
169
169
  xmlss_style_markup(subject)
170
170
  )
171
171
  end
@@ -173,7 +173,7 @@ module Osheet::Xmlss
173
173
  should "write style markup for font color" do
174
174
  subject.style('font color')
175
175
  assert_equal(
176
- "<Style ss:ID=\".font.color\"><Font ss:Color=\"#FF0000\" /><NumberFormat /></Style>",
176
+ "<Style ss:ID=\"font.color..\"><Font ss:Color=\"#FF0000\" /><NumberFormat /></Style>",
177
177
  xmlss_style_markup(subject)
178
178
  )
179
179
  end
@@ -181,7 +181,7 @@ module Osheet::Xmlss
181
181
  should "write style markup for font name" do
182
182
  subject.style('font name')
183
183
  assert_equal(
184
- "<Style ss:ID=\".font.name\"><Font ss:FontName=\"Verdana\" /><NumberFormat /></Style>",
184
+ "<Style ss:ID=\"font.name..\"><Font ss:FontName=\"Verdana\" /><NumberFormat /></Style>",
185
185
  xmlss_style_markup(subject)
186
186
  )
187
187
  end
@@ -201,7 +201,7 @@ module Osheet::Xmlss
201
201
  should "write style markup with empty bg settings when no match" do
202
202
  subject.style('bg')
203
203
  assert_equal(
204
- "<Style ss:ID=\".bg\"><NumberFormat /></Style>",
204
+ "<Style ss:ID=\"bg..\"><NumberFormat /></Style>",
205
205
  xmlss_style_markup(subject)
206
206
  )
207
207
  end
@@ -209,7 +209,7 @@ module Osheet::Xmlss
209
209
  should "write style markup for bg color and auto set the pattern to solid" do
210
210
  subject.style('bg color')
211
211
  assert_equal(
212
- "<Style ss:ID=\".bg.color\"><Interior ss:Color=\"#FF0000\" ss:Pattern=\"Solid\" /><NumberFormat /></Style>",
212
+ "<Style ss:ID=\"bg.color..\"><Interior ss:Color=\"#FF0000\" ss:Pattern=\"Solid\" /><NumberFormat /></Style>",
213
213
  xmlss_style_markup(subject)
214
214
  )
215
215
  end
@@ -220,7 +220,7 @@ module Osheet::Xmlss
220
220
  subject.style('bg pattern-color')
221
221
  subject.style('bg pattern-color')
222
222
  assert_equal(
223
- "<Style ss:ID=\".bg.pattern-only\"><Interior ss:Pattern=\"Solid\" /><NumberFormat /></Style><Style ss:ID=\".bg.pattern-color\"><Interior ss:Color=\"#FF0000\" ss:Pattern=\"HorzStripe\" ss:PatternColor=\"#0000FF\" /><NumberFormat /></Style>",
223
+ "<Style ss:ID=\"bg.pattern-only..\"><Interior ss:Pattern=\"Solid\" /><NumberFormat /></Style><Style ss:ID=\"bg.pattern-color..\"><Interior ss:Color=\"#FF0000\" ss:Pattern=\"HorzStripe\" ss:PatternColor=\"#0000FF\" /><NumberFormat /></Style>",
224
224
  xmlss_style_markup(subject)
225
225
  )
226
226
  end
@@ -228,7 +228,7 @@ module Osheet::Xmlss
228
228
  should "write style markup setting pattern to solid when setting bg color" do
229
229
  subject.style('bg color')
230
230
  assert_equal(
231
- "<Style ss:ID=\".bg.color\"><Interior ss:Color=\"#FF0000\" ss:Pattern=\"Solid\" /><NumberFormat /></Style>",
231
+ "<Style ss:ID=\"bg.color..\"><Interior ss:Color=\"#FF0000\" ss:Pattern=\"Solid\" /><NumberFormat /></Style>",
232
232
  xmlss_style_markup(subject)
233
233
  )
234
234
  end
@@ -236,7 +236,7 @@ module Osheet::Xmlss
236
236
  should "write style markup setting pattern to pattern setting when first setting bg color then pattern" do
237
237
  subject.style('bg color-first')
238
238
  assert_equal(
239
- "<Style ss:ID=\".bg.color-first\"><Interior ss:Color=\"#00FF00\" ss:Pattern=\"HorzStripe\" ss:PatternColor=\"#0000FF\" /><NumberFormat /></Style>",
239
+ "<Style ss:ID=\"bg.color-first..\"><Interior ss:Color=\"#00FF00\" ss:Pattern=\"HorzStripe\" ss:PatternColor=\"#0000FF\" /><NumberFormat /></Style>",
240
240
  xmlss_style_markup(subject)
241
241
  )
242
242
  end
@@ -244,7 +244,7 @@ module Osheet::Xmlss
244
244
  should "write style markup setting pattern to pattern setting when first setting bg pattern then color" do
245
245
  subject.style('bg pattern-first')
246
246
  assert_equal(
247
- "<Style ss:ID=\".bg.pattern-first\"><Interior ss:Color=\"#00FF00\" ss:Pattern=\"HorzStripe\" ss:PatternColor=\"#0000FF\" /><NumberFormat /></Style>",
247
+ "<Style ss:ID=\"bg.pattern-first..\"><Interior ss:Color=\"#00FF00\" ss:Pattern=\"HorzStripe\" ss:PatternColor=\"#0000FF\" /><NumberFormat /></Style>",
248
248
  xmlss_style_markup(subject)
249
249
  )
250
250
  end
@@ -270,7 +270,7 @@ module Osheet::Xmlss
270
270
  should "write style markup with empty border settings when no match" do
271
271
  subject.style('border')
272
272
  assert_equal(
273
- "<Style ss:ID=\".border\"><NumberFormat /></Style>",
273
+ "<Style ss:ID=\"border..\"><NumberFormat /></Style>",
274
274
  xmlss_style_markup(subject)
275
275
  )
276
276
  end
@@ -278,7 +278,7 @@ module Osheet::Xmlss
278
278
  should "write style markup with identical settings for all positions when using 'border'" do
279
279
  subject.style('border all')
280
280
  assert_equal(
281
- "<Style ss:ID=\".border.all\"><Borders><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Top\" ss:Weight=\"3\" /><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Right\" ss:Weight=\"3\" /><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Bottom\" ss:Weight=\"3\" /><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Left\" ss:Weight=\"3\" /></Borders><NumberFormat /></Style>",
281
+ "<Style ss:ID=\"border.all..\"><Borders><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Top\" ss:Weight=\"3\" /><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Right\" ss:Weight=\"3\" /><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Bottom\" ss:Weight=\"3\" /><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Dash\" ss:Position=\"Left\" ss:Weight=\"3\" /></Borders><NumberFormat /></Style>",
282
282
  xmlss_style_markup(subject)
283
283
  )
284
284
  end
@@ -288,7 +288,7 @@ module Osheet::Xmlss
288
288
  subject.style("border #{p}")
289
289
  end
290
290
  assert_equal(
291
- "<Style ss:ID=\".border.top\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.right\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Right\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.bottom\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Bottom\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.left\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Left\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style>",
291
+ "<Style ss:ID=\"border.top..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.right..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Right\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.bottom..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Bottom\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.left..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Left\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style>",
292
292
  xmlss_style_markup(subject)
293
293
  )
294
294
  end
@@ -298,7 +298,7 @@ module Osheet::Xmlss
298
298
  subject.style("border #{w}")
299
299
  end
300
300
  assert_equal(
301
- "<Style ss:ID=\".border.hairline\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"0\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.thin\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.medium\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"2\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.thick\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"3\" /></Borders><NumberFormat /></Style>",
301
+ "<Style ss:ID=\"border.hairline..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"0\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.thin..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.medium..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"2\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.thick..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"3\" /></Borders><NumberFormat /></Style>",
302
302
  xmlss_style_markup(subject)
303
303
  )
304
304
  end
@@ -308,7 +308,7 @@ module Osheet::Xmlss
308
308
  subject.style("border #{s}")
309
309
  end
310
310
  assert_equal(
311
- "<Style ss:ID=\".border.none\"><Borders><Border ss:LineStyle=\"None\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.continuous\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.dash\"><Borders><Border ss:LineStyle=\"Dash\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.dot\"><Borders><Border ss:LineStyle=\"Dot\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.dash_dot\"><Borders><Border ss:LineStyle=\"DashDot\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\".border.dash_dot_dot\"><Borders><Border ss:LineStyle=\"DashDotDot\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style>",
311
+ "<Style ss:ID=\"border.none..\"><Borders><Border ss:LineStyle=\"None\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.continuous..\"><Borders><Border ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.dash..\"><Borders><Border ss:LineStyle=\"Dash\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.dot..\"><Borders><Border ss:LineStyle=\"Dot\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.dash_dot..\"><Borders><Border ss:LineStyle=\"DashDot\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style><Style ss:ID=\"border.dash_dot_dot..\"><Borders><Border ss:LineStyle=\"DashDotDot\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style>",
312
312
  xmlss_style_markup(subject)
313
313
  )
314
314
  end
@@ -316,7 +316,7 @@ module Osheet::Xmlss
316
316
  should "write style markup for border color" do
317
317
  subject.style('border color')
318
318
  assert_equal(
319
- "<Style ss:ID=\".border.color\"><Borders><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style>",
319
+ "<Style ss:ID=\"border.color..\"><Borders><Border ss:Color=\"#FF0000\" ss:LineStyle=\"Continuous\" ss:Position=\"Top\" ss:Weight=\"1\" /></Borders><NumberFormat /></Style>",
320
320
  xmlss_style_markup(subject)
321
321
  )
322
322
  end
@@ -66,7 +66,7 @@ module Osheet::Xmlss
66
66
  end
67
67
 
68
68
  should "write workbook markup" do
69
- assert_equal "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"><Styles><Style ss:ID=\"..number_none_0_nocomma_black\"><NumberFormat ss:Format=\"0\" /></Style></Styles><Worksheet ss:Name=\"Test!\"><Table><Column /><Row><Cell ss:StyleID=\"..number_none_0_nocomma_black\"><Data ss:Type=\"Number\">1</Data></Cell></Row></Table></Worksheet></Workbook>", @writer.to_s
69
+ assert_equal "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"><Styles><Style ss:ID=\"..number_none_0_nocomma_black\"><NumberFormat ss:Format=\"0\" /></Style></Styles><Worksheet ss:Name=\"Test!\"><Table><Column /><Row><Cell ss:StyleID=\"..number_none_0_nocomma_black\"><Data ss:Type=\"Number\">1</Data></Cell></Row></Table></Worksheet></Workbook>", @writer.to_s
70
70
  end
71
71
 
72
72
  should "return string xml data" do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osheet-xmlss
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424055
4
+ hash: 15424049
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - rc
11
- - 1
12
- version: 1.0.0.rc.1
11
+ - 2
12
+ version: 1.0.0.rc.2
13
13
  platform: ruby
14
14
  authors:
15
15
  - Kelly Redding
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-03-20 00:00:00 Z
20
+ date: 2012-04-19 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  type: :development
@@ -40,14 +40,14 @@ dependencies:
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- hash: 15424049
43
+ hash: 15424051
44
44
  segments:
45
45
  - 1
46
46
  - 0
47
47
  - 0
48
48
  - rc
49
- - 2
50
- version: 1.0.0.rc.2
49
+ - 3
50
+ version: 1.0.0.rc.3
51
51
  name: osheet
52
52
  version_requirements: *id002
53
53
  prerelease: false
@@ -58,13 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- hash: 7712010
61
+ hash: 15424051
62
62
  segments:
63
63
  - 1
64
64
  - 0
65
65
  - 0
66
66
  - rc
67
- version: 1.0.0.rc
67
+ - 3
68
+ version: 1.0.0.rc.3
68
69
  name: xmlss
69
70
  version_requirements: *id003
70
71
  prerelease: false
@@ -84,8 +85,10 @@ files:
84
85
  - README.md
85
86
  - Rakefile
86
87
  - bench/bench_runner.rb
88
+ - bench/bench_runner_10.xls
89
+ - bench/bench_runner_100.xls
90
+ - bench/bench_runner_1000.xls
87
91
  - bench/profiler.rb
88
- - bench/profiler_1000.xls
89
92
  - bench/profiler_runner.rb
90
93
  - examples/basic.rb
91
94
  - examples/basic.xls