surpass 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. data/lib/surpass/worksheet.rb +1 -1
  2. data/lib/surpass.rb +1 -1
  3. data/out.bin +0 -0
  4. metadata +3 -263
  5. data/examples/big-16mb.rb +0 -25
  6. data/examples/big-random-strings.rb +0 -28
  7. data/examples/blanks.rb +0 -34
  8. data/examples/blanks.xls +0 -0
  9. data/examples/col_width.rb +0 -16
  10. data/examples/col_width.xls +0 -0
  11. data/examples/dates.rb +0 -31
  12. data/examples/dates.xls +0 -0
  13. data/examples/format.rb +0 -23
  14. data/examples/format.xls +0 -0
  15. data/examples/hello-world.rb +0 -9
  16. data/examples/hello-world.xls +0 -0
  17. data/examples/image.rb +0 -10
  18. data/examples/image.xls +0 -0
  19. data/examples/merged.rb +0 -36
  20. data/examples/merged.xls +0 -0
  21. data/examples/merged0.rb +0 -27
  22. data/examples/merged0.xls +0 -0
  23. data/examples/merged1.rb +0 -99
  24. data/examples/merged1.xls +0 -0
  25. data/examples/num_formats.rb +0 -55
  26. data/examples/num_formats.xls +0 -0
  27. data/examples/numbers.rb +0 -24
  28. data/examples/numbers.xls +0 -0
  29. data/examples/outline.rb +0 -110
  30. data/examples/outline.xls +0 -0
  31. data/examples/panes.rb +0 -48
  32. data/examples/panes.xls +0 -0
  33. data/examples/protection.rb +0 -132
  34. data/examples/protection.xls +0 -0
  35. data/examples/python.bmp +0 -0
  36. data/examples/row_styles.rb +0 -16
  37. data/examples/row_styles.xls +0 -0
  38. data/examples/row_styles_empty.rb +0 -15
  39. data/examples/row_styles_empty.xls +0 -0
  40. data/examples/set_cell_and_range_style.rb +0 -12
  41. data/examples/set_cell_and_range_style.xls +0 -0
  42. data/examples/wrapped-text.rb +0 -13
  43. data/examples/wrapped-text.xls +0 -0
  44. data/examples/write_arrays.rb +0 -22
  45. data/examples/write_arrays.xls +0 -0
  46. data/examples/ws_props.rb +0 -80
  47. data/spec/biff_record_spec.rb +0 -268
  48. data/spec/cell_spec.rb +0 -56
  49. data/spec/data/random-strings.txt +0 -10000
  50. data/spec/document_spec.rb +0 -168
  51. data/spec/excel_formula_spec.rb +0 -27
  52. data/spec/formatting_spec.rb +0 -53
  53. data/spec/output/cells-rk.xls +0 -0
  54. data/spec/output/cells.xls +0 -0
  55. data/spec/output/mini.xls +0 -0
  56. data/spec/reference/P-0508-0000507647-3280-5298.xls +0 -0
  57. data/spec/reference/all-cell-styles.bin +0 -0
  58. data/spec/reference/all-number-formats.bin +0 -0
  59. data/spec/reference/all-styles.bin +0 -0
  60. data/spec/reference/mini.xls +0 -0
  61. data/spec/row_spec.rb +0 -19
  62. data/spec/spec_helper.rb +0 -10
  63. data/spec/style_spec.rb +0 -89
  64. data/spec/surpass_spec.rb +0 -7
  65. data/spec/utilities_spec.rb +0 -57
  66. data/spec/workbook_spec.rb +0 -48
  67. data/spec/worksheet_spec.rb +0 -0
  68. data/stats/cloc.txt +0 -8
  69. data/stats/rcov.txt +0 -0
  70. data/stats/specdoc.txt +0 -158
  71. data/webby/README.txt +0 -6
  72. data/webby/Sitefile +0 -43
  73. data/webby/content/css/pygments.txt +0 -6
  74. data/webby/content/css/style.css +0 -279
  75. data/webby/content/examples/autoformat.png +0 -0
  76. data/webby/content/examples/autoformat.rb +0 -32
  77. data/webby/content/examples/autoformat.xls +0 -0
  78. data/webby/content/examples/borders.png +0 -0
  79. data/webby/content/examples/borders.rb +0 -15
  80. data/webby/content/examples/borders.xls +0 -0
  81. data/webby/content/examples/colours.png +0 -0
  82. data/webby/content/examples/colours.rb +0 -23
  83. data/webby/content/examples/colours.xls +0 -0
  84. data/webby/content/examples/data.png +0 -0
  85. data/webby/content/examples/data.rb +0 -11
  86. data/webby/content/examples/data.xls +0 -0
  87. data/webby/content/examples/formatting.png +0 -0
  88. data/webby/content/examples/formatting.rb +0 -78
  89. data/webby/content/examples/formatting.xls +0 -0
  90. data/webby/content/examples/hello-world.png +0 -0
  91. data/webby/content/examples/hello-world.py +0 -8
  92. data/webby/content/examples/hello-world.rb +0 -9
  93. data/webby/content/examples/hello-world.xls +0 -0
  94. data/webby/content/examples/number-format-string.png +0 -0
  95. data/webby/content/examples/number-format-string.rb +0 -14
  96. data/webby/content/examples/number-format-string.xls +0 -0
  97. data/webby/content/examples/patterns.png +0 -0
  98. data/webby/content/examples/patterns.rb +0 -26
  99. data/webby/content/examples/patterns.xls +0 -0
  100. data/webby/content/examples/show-greens.sh +0 -1
  101. data/webby/content/examples/surpass-info.sh +0 -1
  102. data/webby/content/img/Thumbs.db +0 -0
  103. data/webby/content/img/bg_menu.gif +0 -0
  104. data/webby/content/img/bg_t.gif +0 -0
  105. data/webby/content/img/bullet.gif +0 -0
  106. data/webby/content/img/logo.png +0 -0
  107. data/webby/content/img/logo_.jpg +0 -0
  108. data/webby/content/img/top_bg.gif +0 -0
  109. data/webby/content/img/top_bg_.gif +0 -0
  110. data/webby/content/index.txt +0 -16
  111. data/webby/content/installation/index.txt +0 -24
  112. data/webby/content/source/ExcelFormulaLexer.txt +0 -7
  113. data/webby/content/source/ExcelFormulaParser.txt +0 -7
  114. data/webby/content/source/biff_record.txt +0 -7
  115. data/webby/content/source/bitmap.txt +0 -7
  116. data/webby/content/source/cell.txt +0 -7
  117. data/webby/content/source/chart.txt +0 -7
  118. data/webby/content/source/column.txt +0 -7
  119. data/webby/content/source/document.txt +0 -7
  120. data/webby/content/source/excel_formula.txt +0 -7
  121. data/webby/content/source/excel_magic.txt +0 -7
  122. data/webby/content/source/formatting.txt +0 -7
  123. data/webby/content/source/row.txt +0 -7
  124. data/webby/content/source/style.txt +0 -7
  125. data/webby/content/source/utilities.txt +0 -7
  126. data/webby/content/source/workbook.txt +0 -7
  127. data/webby/content/source/worksheet.txt +0 -7
  128. data/webby/content/surpass-manual.erb +0 -198
  129. data/webby/layouts/book.txt +0 -29
  130. data/webby/layouts/default.txt +0 -27
  131. data/webby/layouts/two_column.txt +0 -25
  132. data/webby/layouts/web.txt +0 -66
  133. data/webby/output/.cairn +0 -0
  134. data/webby/output/css/blueprint/ie.css +0 -26
  135. data/webby/output/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  136. data/webby/output/css/blueprint/plugins/buttons/icons/key.png +0 -0
  137. data/webby/output/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  138. data/webby/output/css/blueprint/plugins/buttons/readme.txt +0 -32
  139. data/webby/output/css/blueprint/plugins/buttons/screen.css +0 -97
  140. data/webby/output/css/blueprint/plugins/fancy-type/readme.txt +0 -14
  141. data/webby/output/css/blueprint/plugins/fancy-type/screen.css +0 -71
  142. data/webby/output/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  143. data/webby/output/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  144. data/webby/output/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  145. data/webby/output/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  146. data/webby/output/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  147. data/webby/output/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  148. data/webby/output/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  149. data/webby/output/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  150. data/webby/output/css/blueprint/plugins/link-icons/readme.txt +0 -18
  151. data/webby/output/css/blueprint/plugins/link-icons/screen.css +0 -40
  152. data/webby/output/css/blueprint/plugins/rtl/readme.txt +0 -10
  153. data/webby/output/css/blueprint/plugins/rtl/screen.css +0 -109
  154. data/webby/output/css/blueprint/print.css +0 -30
  155. data/webby/output/css/blueprint/screen.css +0 -251
  156. data/webby/output/css/blueprint/src/forms.css +0 -49
  157. data/webby/output/css/blueprint/src/grid.css +0 -212
  158. data/webby/output/css/blueprint/src/grid.png +0 -0
  159. data/webby/output/css/blueprint/src/ie.css +0 -59
  160. data/webby/output/css/blueprint/src/print.css +0 -85
  161. data/webby/output/css/blueprint/src/reset.css +0 -38
  162. data/webby/output/css/blueprint/src/typography.css +0 -105
  163. data/webby/output/css/pygments.css +0 -59
  164. data/webby/output/css/site.css +0 -62
  165. data/webby/output/css/style.css +0 -279
  166. data/webby/output/examples/autoformat.png +0 -0
  167. data/webby/output/examples/autoformat.rb +0 -32
  168. data/webby/output/examples/autoformat.xls +0 -0
  169. data/webby/output/examples/borders.png +0 -0
  170. data/webby/output/examples/borders.rb +0 -15
  171. data/webby/output/examples/borders.xls +0 -0
  172. data/webby/output/examples/colours.png +0 -0
  173. data/webby/output/examples/colours.rb +0 -23
  174. data/webby/output/examples/colours.xls +0 -0
  175. data/webby/output/examples/data.png +0 -0
  176. data/webby/output/examples/data.rb +0 -11
  177. data/webby/output/examples/data.xls +0 -0
  178. data/webby/output/examples/formatting.png +0 -0
  179. data/webby/output/examples/formatting.rb +0 -78
  180. data/webby/output/examples/formatting.xls +0 -0
  181. data/webby/output/examples/hello-world.png +0 -0
  182. data/webby/output/examples/hello-world.py +0 -8
  183. data/webby/output/examples/hello-world.rb +0 -9
  184. data/webby/output/examples/hello-world.xls +0 -0
  185. data/webby/output/examples/number-format-string.png +0 -0
  186. data/webby/output/examples/number-format-string.rb +0 -14
  187. data/webby/output/examples/number-format-string.xls +0 -0
  188. data/webby/output/examples/patterns.png +0 -0
  189. data/webby/output/examples/patterns.rb +0 -26
  190. data/webby/output/examples/patterns.xls +0 -0
  191. data/webby/output/examples/show-greens.sh +0 -1
  192. data/webby/output/examples/surpass-info.sh +0 -1
  193. data/webby/output/img/Thumbs.db +0 -0
  194. data/webby/output/img/bg_menu.gif +0 -0
  195. data/webby/output/img/bg_t.gif +0 -0
  196. data/webby/output/img/bullet.gif +0 -0
  197. data/webby/output/img/logo.png +0 -0
  198. data/webby/output/img/logo_.jpg +0 -0
  199. data/webby/output/img/top_bg.gif +0 -0
  200. data/webby/output/img/top_bg_.gif +0 -0
  201. data/webby/output/index.html +0 -138
  202. data/webby/output/installation/index.html +0 -64
  203. data/webby/output/installation/installation.html +0 -1
  204. data/webby/output/installation.html +0 -1
  205. data/webby/output/source/ExcelFormulaLexer.html +0 -981
  206. data/webby/output/source/ExcelFormulaParser.html +0 -661
  207. data/webby/output/source/biff_record.html +0 -462
  208. data/webby/output/source/bitmap.html +0 -277
  209. data/webby/output/source/cell.html +0 -241
  210. data/webby/output/source/chart.html +0 -64
  211. data/webby/output/source/column.html +0 -99
  212. data/webby/output/source/document.html +0 -465
  213. data/webby/output/source/excel_formula.html +0 -82
  214. data/webby/output/source/excel_magic.html +0 -1072
  215. data/webby/output/source/formatting.html +0 -664
  216. data/webby/output/source/row.html +0 -169
  217. data/webby/output/source/style.html +0 -158
  218. data/webby/output/source/surpass.html +0 -110
  219. data/webby/output/source/utilities.html +0 -145
  220. data/webby/output/source/workbook.html +0 -265
  221. data/webby/output/source/worksheet.html +0 -331
  222. data/webby/output/surpass-manual-0-0-5.pdf +0 -0
  223. data/webby/output/surpass-manual.aux +0 -50
  224. data/webby/output/surpass-manual.log +0 -366
  225. data/webby/output/surpass-manual.out +0 -20
  226. data/webby/output/surpass-manual.tex +0 -582
  227. data/webby/output/surpass-manual.toc +0 -20
  228. data/webby/rsync-exclude +0 -7
  229. data/webby/tasks/latex.rake +0 -14
  230. data/webby/tasks/screenshots.rb +0 -58
  231. data/webby/templates/article.erb +0 -15
  232. data/webby/templates/book.erb +0 -16
  233. data/webby/templates/page.erb +0 -9
@@ -1,168 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe ExcelDocument do
4
- it "should save" do
5
- w = Workbook.new
6
- w.country_code = 0x01
7
- s = w.add_sheet("Hello World!")
8
- s.write(0, 0, 99)
9
- s.write(1, 1, "Hello!")
10
- w.save("spec/output/mini.xls")
11
- end
12
- end
13
-
14
- # describe Reader do
15
- # before(:each) do
16
- # @doc = Reader.new("spec/reference/mini.xls")
17
- # end
18
- #
19
- # it "should read in the entire file" do
20
- # @doc.header.length.should == 512
21
- # @doc.data.length.should == 5120
22
- # end
23
- #
24
- # it "should correctly parse doc_magic" do
25
- # @doc.doc_magic.should === [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1].to_bin
26
- # end
27
- #
28
- # it "should correctly parse file_uid" do
29
- # @doc.file_uid.should === [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].to_bin
30
- # end
31
- #
32
- # it "should correctly parse rev_num" do
33
- # @doc.rev_num.should === [0x3E, 0x00].to_bin
34
- # end
35
- #
36
- # it "should correctly parse ver_num" do
37
- # @doc.ver_num.should === [0x03, 0x00].to_bin
38
- # end
39
- #
40
- # it "should correctly parse byte_order" do
41
- # @doc.byte_order.should === [0xFE, 0xFF].to_bin
42
- # end
43
- #
44
- # it "should correctly parse sector size" do
45
- # @doc.sect_size.should === 512
46
- # end
47
- #
48
- # it "should correctly parse short sector size" do
49
- # @doc.short_sect_size.should == 64
50
- # end
51
- #
52
- # it "should correctly parse total sat sectors" do
53
- # @doc.total_sat_sectors.should == 1
54
- # end
55
- #
56
- # it "should correctly parse dir start sid" do
57
- # @doc.dir_start_sid.should == 8
58
- # end
59
- #
60
- # it "should correctly parse min stream size" do
61
- # @doc.min_stream_size.should == 4096
62
- # end
63
- #
64
- # it "should correctly parse ssat start sid" do
65
- # @doc.ssat_start_sid.should == -2
66
- # end
67
- #
68
- # it "should correctly parse total ssat sectors" do
69
- # @doc.total_ssat_sectors.should == 0
70
- # end
71
- #
72
- # it "should correctly parse msat start sid" do
73
- # @doc.msat_start_sid.should == -2
74
- # end
75
- #
76
- # it "should correctly parse total msat sectors" do
77
- # @doc.total_msat_sectors.should == 0
78
- # end
79
- #
80
- # it "should correctly parse the msat" do
81
- # @doc.msat.should == [9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
82
- # end
83
- #
84
- # it "should correctly parse the sat" do
85
- # @doc.sat.should == [1, 2, 3, 4, 5, 6, 7, -2, -2, -3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
86
- # end
87
- #
88
- # it "should correctly parse the directory list" do
89
- # @doc.dir_entry_list.length.should == 4
90
- # end
91
- # end
92
-
93
- # from pyExcelerator import *
94
- # doc = CompoundDoc.Reader("museum/mini.xls", True)
95
-
96
- # file magic:
97
- # 0xD0 0xCF 0x11 0xE0 0xA1 0xB1 0x1A 0xE1
98
- # file uid:
99
- # 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
100
- # revision number:
101
- # 0x3E 0x00
102
- # version number:
103
- # 0x03 0x00
104
- # byte order:
105
- # 0xFE 0xFF
106
- # sector size : 0x200 512
107
- # short sector size : 0x40 64
108
- # Total number of sectors used for the SAT : 0x1 1
109
- # SID of first sector of the directory stream: 0x8 8
110
- # Minimum size of a standard stream : 0x1000 4096
111
- # SID of first sector of the SSAT : -0x2 -2
112
- # Total number of sectors used for the SSAT : 0x0 0
113
- # SID of first additional sector of the MSAT : -0x2 -2
114
- # Total number of sectors used for the MSAT : 0x0 0
115
- # MSAT (header part):
116
- # [9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
117
- # additional MSAT sectors:
118
- # []
119
- # SAT sid count:
120
- # 128
121
- # SAT content:
122
- # (1, 2, 3, 4, 5, 6, 7, -2, -2, -3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)
123
- # total directory entries: 4
124
- # DID 0
125
- # Size of the used area of the character buffer of the name: 22
126
- # dir entry name: u'Root Entry'
127
- # type of entry: 5 Root storage
128
- # entry colour: 0 Red
129
- # left child DID : -1
130
- # right child DID: -1
131
- # root DID : 1
132
- # start SID : -2
133
- # stream size : 0
134
- # stream is empty
135
- # DID 1
136
- # Size of the used area of the character buffer of the name: 18
137
- # dir entry name: u'Workbook'
138
- # type of entry: 2 User stream
139
- # entry colour: 0 Red
140
- # left child DID : -1
141
- # right child DID: -1
142
- # root DID : -1
143
- # start SID : 0
144
- # stream size : 4096
145
- # stream stored as normal stream
146
- # DID 2
147
- # Size of the used area of the character buffer of the name: 0
148
- # dir entry name: u''
149
- # type of entry: 0 Empty
150
- # entry colour: 0 Red
151
- # left child DID : -1
152
- # right child DID: -1
153
- # root DID : -1
154
- # start SID : 0
155
- # stream size : 0
156
- # stream is empty
157
- # DID 3
158
- # Size of the used area of the character buffer of the name: 0
159
- # dir entry name: u''
160
- # type of entry: 0 Empty
161
- # entry colour: 0 Red
162
- # left child DID : -1
163
- # right child DID: -1
164
- # root DID : -1
165
- # start SID : 0
166
- # stream size : 0
167
- # stream is empty
168
- #
@@ -1,27 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
-
4
- describe ExcelFormula, "parsing primary objects" do
5
- it "should parse the TRUE constant" do
6
- ExcelFormula.new("TRUE").to_biff.should eql("\002\000\035\001")
7
- end
8
-
9
- it "should parse minus TRUE" do
10
- File.open("out.bin", "w") do |f|
11
- f.write ExcelFormula.new("-TRUE").to_biff
12
- end
13
- ExcelFormula.new("-TRUE").to_biff.should eql("\003\000\035\001\023")
14
- end
15
-
16
- it "should parse FALSE constant" do
17
- ExcelFormula.new("FALSE").to_biff.should eql("\002\000\035\000")
18
- end
19
-
20
- it "should parse a product" do
21
- ExcelFormula.new("TRUE*TRUE").to_biff
22
- end
23
-
24
- it "should raise an error if invalid formula is passed" do
25
- lambda { ExcelFormula.new("RUBBISHXYZ") }.should raise_error
26
- end
27
- end
@@ -1,53 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe Alignment do
4
- before(:each) do
5
- @a = Alignment.new
6
- end
7
-
8
- it "should not wrap text by default" do
9
- @a.wrap.should eql(Alignment::NOT_WRAP_AT_RIGHT)
10
- end
11
-
12
- it "should wrap text when wrap = true" do
13
- @a.wrap = true
14
- @a.wrap.should eql(Alignment::WRAP_AT_RIGHT)
15
- end
16
-
17
- it "should wrap text when wrap = WRAP_AT_RIGHT" do
18
- @a.wrap = Alignment::WRAP_AT_RIGHT
19
- @a.wrap.should eql(Alignment::WRAP_AT_RIGHT)
20
- end
21
-
22
- it "should not wrap text when wrap = false" do
23
- @a.wrap = true
24
- @a.wrap = false
25
- @a.wrap.should eql(Alignment::NOT_WRAP_AT_RIGHT)
26
- end
27
-
28
- it "should not wrap text when wrap = NOT_WRAP_AT_RIGHT" do
29
- @a.wrap = true
30
- @a.wrap = Alignment::NOT_WRAP_AT_RIGHT
31
- @a.wrap.should eql(Alignment::NOT_WRAP_AT_RIGHT)
32
- end
33
-
34
- it "should raise an error if anything else passed" do
35
- lambda {@a.wrap = :yes}.should raise_error("I don't know how to set wrap to :yes.")
36
- end
37
- end
38
-
39
- describe Font do
40
- it "should raise a helpful error if someone tries to pass a string to font family" do
41
- font = Font.new
42
- lambda { font.family = 'Arial' }.should raise_error "Oops, font_family doesn't take a string. Do you want font_name instead?"
43
- end
44
-
45
- it "should raise a helpful error if someone tries to initialize a font with a string for font family" do
46
- lambda{ StyleFormat.new(:font_family => "Arial") }.should raise_error "Oops, font_family doesn't take a string. Do you want font_name instead?"
47
- end
48
-
49
- it "should not raise an error if you properly initialize font family" do
50
- font = Font.new
51
- lambda { font.family = 1 }.should_not raise_error
52
- end
53
- end
Binary file
Binary file
data/spec/output/mini.xls DELETED
Binary file
Binary file
File without changes
Binary file
Binary file
data/spec/row_spec.rb DELETED
@@ -1,19 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe Row, "various classes of input" do
4
- it "should write" do
5
- @w = Workbook.new
6
- @s = @w.add_sheet
7
-
8
- data = []
9
- data << ["Empty String", ""]
10
- data << ["Nil", nil]
11
-
12
- data.each_with_index do |a, i|
13
- label, value = a
14
- @s.write(i, 0, label + ":")
15
- @s.write(i, 1, value)
16
- end
17
- @w.save("spec/output/cells.xls")
18
- end
19
- end
data/spec/spec_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- require "lib/surpass"
2
-
3
- include Utilities
4
-
5
- class Array
6
- def to_bin
7
- hex_array_to_binary_string(self)
8
- end
9
- end
10
-
data/spec/style_spec.rb DELETED
@@ -1,89 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe StyleCollection, "initialization" do
4
- before(:each) do
5
- @s = StyleCollection.new
6
- @font_index, @number_format_index, @alignment, @borders, @pattern, @protection = @s.default_format
7
- end
8
-
9
- it "should properly initialize the fonts hash" do
10
- # There is a font no. 6 here because of @default_style = StyleFormat.new
11
- @s.fonts.keys.sort.should eql([0,1,2,3,5,6])
12
- end
13
-
14
- it "should property initialize the number_formats hash" do
15
- keys = (0..23).to_a + (38..49).to_a
16
- @s.number_formats.keys.sort.should eql(keys)
17
- end
18
-
19
- it "should properly initialize the styles hash" do
20
- @s.styles.keys.sort.should eql([16])
21
- end
22
-
23
- it "should property initialize a default style" do
24
- @s.default_style.should be_kind_of(StyleFormat)
25
- end
26
-
27
- it "should have a valid font_index in the default_format" do
28
- @font_index.should eql(6)
29
- end
30
-
31
- it "should have a valid number_format_index in the default_format" do
32
- @number_format_index.should eql(0)
33
- end
34
-
35
- it "should have a valid alignment in the default_format" do
36
- @alignment.should be_kind_of(Alignment)
37
- end
38
-
39
- it "should have a valid borders in the default_format" do
40
- @borders.should be_kind_of(Borders)
41
- end
42
-
43
- it "should have a valid pattern in the default_format" do
44
- @pattern.should be_kind_of(Pattern)
45
- end
46
-
47
- it "should have a valid protection in the default_format" do
48
- @protection.should be_kind_of(Protection)
49
- end
50
- end
51
-
52
- describe StyleCollection, "adding new styles" do
53
- before(:each) do
54
- @s = StyleCollection.new
55
- @s.styles.should have(1).elements
56
- end
57
-
58
- it "should return the default style index when trying to add a nil style" do
59
- @s.add(nil).should === 16
60
- @s.styles.should have(1).elements
61
- end
62
-
63
- it "should correctly add a new blank style" do
64
- @s.add(StyleFormat.new).should === 0x10 + 1
65
- @s.styles.should have(2).elements
66
- end
67
-
68
- it "should not re-add an existing number format" do
69
- @s.number_format_index('General').should == 0
70
- end
71
-
72
- it "should add a new number format" do
73
- @s.number_format_index('never seen this before').should == 164
74
- end
75
- end
76
-
77
- describe StyleCollection, "biff" do
78
- before(:each) do
79
- @s = StyleCollection.new
80
- end
81
-
82
- it "should correctly convert number format data to biff" do
83
- @s.number_formats_biff.should === "" # Since there are no custom number formats.
84
- end
85
-
86
- it "should correctly convert cell styles data to biff" do
87
- @s.cell_styles_biff.should === File.read("spec/reference/all-cell-styles.bin")
88
- end
89
- end
data/spec/surpass_spec.rb DELETED
@@ -1,7 +0,0 @@
1
-
2
- require File.join(File.dirname(__FILE__), %w[spec_helper])
3
-
4
- describe Surpass do
5
- end
6
-
7
- # EOF
@@ -1,57 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- include Utilities
4
-
5
- describe Utilities do
6
- it "should round trip pixels to twips" do
7
- pixels_to_twips(twips_to_pixels(5)).should == 5.0
8
- end
9
-
10
- it "should round trip points to pixels" do
11
- points_to_pixels(pixels_to_points(5)).should == 5.0
12
- end
13
- end
14
-
15
- describe Utilities, "Excel boolean conversion" do
16
- it "should convert true values to 1" do
17
- as_numeric(true).should == 1
18
- end
19
-
20
- it "should convert false values to 0" do
21
- as_numeric(false).should == 0
22
- end
23
-
24
- it "should convert 1 to true" do
25
- as_boolean(1).should be_true
26
- end
27
-
28
- it "should convert 0 to false" do
29
- as_boolean(0).should be_false
30
- end
31
-
32
- it "should raise an error with anything else" do
33
- lambda { as_boolean(5) }.should raise_error("Can't convert 5 from excel boolean!")
34
- end
35
- end
36
-
37
- describe Utilities, "Excel date converter" do
38
- it "should convert objects of class Date" do
39
- as_excel_date(Date.civil(2008,1,1)).should == 39448
40
- end
41
-
42
- it "should convert objects of class DateTime" do
43
- as_excel_date(DateTime.new(2008,1,1,12,45)).should == 39448.53125
44
- end
45
-
46
- it "should convert objects of class Time" do
47
- as_excel_date(Time.gm(2008,1,1,12,45)).should == 39448.53125
48
- end
49
- end
50
-
51
- describe Utilities, "hex function" do
52
- it "should description" do
53
- (0...200).each do |i|
54
- hex(i).to_i(16).should == i
55
- end
56
- end
57
- end
@@ -1,48 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe Workbook, "to_biff" do
4
- before(:each) do
5
- @w = Workbook.new
6
- ws = @w.add_sheet('Image')
7
- ws.insert_bitmap('examples/python.bmp', 2, 2)
8
- ws.insert_bitmap('examples/python.bmp', 10, 2)
9
-
10
- end
11
-
12
- # Use this to run code in python source and compare resulting binaries.
13
- it "should not raise an error" do
14
- if false
15
- ruby_biff = @w.to_biff
16
- python_biff = File.read("/Users/ana/src/pyexcelerator/trunk/workbook.bin")
17
-
18
- 0.upto(ruby_biff.length) do |i|
19
- next if ruby_biff[0,i] === python_biff[0,i]
20
- puts ruby_biff[i-5, 10].inspect
21
- puts python_biff[i-5, 10].inspect
22
- raise "files are identical up to #{i.to_s}"
23
- end
24
- end
25
- end
26
- end
27
-
28
- describe Workbook, "description" do
29
- before(:all) do
30
- strings = File.read("spec/data/random-strings.txt").split("\n")
31
-
32
- @book = Workbook.new
33
- @sheet = @book.add_sheet
34
-
35
- colcount = 20 + 1
36
- rowcount = 20 + 1
37
-
38
- colcount.times do |c|
39
- rowcount.times do |r|
40
- i = c * rowcount + r
41
- @sheet.write(r, c, strings[i])
42
- end
43
- end
44
- end
45
- it "should description" do
46
- # @book.window_1_record
47
- end
48
- end
File without changes
data/stats/cloc.txt DELETED
@@ -1,8 +0,0 @@
1
- http://cloc.sourceforge.net v 1.03 T=0.5 s (34.0 files/s, 14940.0 lines/s)
2
- -------------------------------------------------------------------------------
3
- Language files blank comment code
4
- -------------------------------------------------------------------------------
5
- Ruby 17 819 1678 4973
6
- -------------------------------------------------------------------------------
7
- SUM: 17 819 1678 4973
8
- -------------------------------------------------------------------------------
data/stats/rcov.txt DELETED
File without changes
data/stats/specdoc.txt DELETED
@@ -1,158 +0,0 @@
1
-
2
- InterfaceHeaderRecord
3
- - should pack correctly
4
-
5
- InterfaceEndRecord
6
- - should pack correctly
7
-
8
- MMSRecord
9
- - should pack correctly
10
-
11
- WriteAccessRecord
12
- - should pack correctly
13
-
14
- DSFRecord
15
- - should pack correctly
16
-
17
- TabIDRecord
18
- - should pack correctly
19
-
20
- FnGroupCountRecord
21
- - should pack correctly
22
-
23
- WindowProtectRecord
24
- - should pack correctly
25
-
26
- ObjectProtectRecord
27
- - should pack correctly
28
-
29
- ScenarioProtectRecord
30
- - should pack correctly
31
-
32
- PasswordRecord
33
- - should pack correctly with blank password
34
- - should pack correctly with a password of 123456
35
- - should pack correctly with a password of abcdefghij
36
- - should pack correctly with a password of ok
37
-
38
- Prot4RevRecord
39
- - should pack correctly
40
-
41
- Prot4RevPassRecord
42
- - should pack correctly
43
-
44
- BackupRecord
45
- - should pack correctly
46
-
47
- HideObjRecord
48
- - should pack correctly
49
-
50
- RefreshAllRecord
51
- - should pack correctly
52
-
53
- BookBoolRecord
54
- - should pack correctly
55
-
56
- CountryRecord
57
- - should pack correctly
58
-
59
- UseSelfsRecord
60
- - should pack correctly
61
-
62
- EOFRecord
63
- - should pack correctly
64
-
65
- DateModeRecord
66
- - should pack correctly when passed true
67
- - should pack correctly when passed false
68
-
69
- PrecisionRecord
70
- - should pack correctly when passed true
71
- - should pack correctly when passed false
72
-
73
- CodepageBiff8Record
74
- - should pack correctly
75
-
76
- Window1Record
77
- - should pack correctly
78
-
79
- StyleRecord
80
- - should pack correctly
81
-
82
- BoundSheetRecord
83
- - should pack correctly
84
-
85
- DimensionsRecord
86
- - should pack correctly
87
-
88
- ExcelDocument
89
- - should save
90
-
91
- Reader
92
- - should read in the entire file
93
- - should correctly parse doc_magic
94
- - should correctly parse file_uid
95
- - should correctly parse rev_num
96
- - should correctly parse ver_num
97
- - should correctly parse byte_order
98
- - should correctly parse sector size
99
- - should correctly parse short sector size
100
- - should correctly parse total sat sectors
101
- - should correctly parse dir start sid
102
- - should correctly parse min stream size
103
- - should correctly parse ssat start sid
104
- - should correctly parse total ssat sectors
105
- - should correctly parse msat start sid
106
- - should correctly parse total msat sectors
107
- - should correctly parse the msat
108
- - should correctly parse the sat
109
- - should correctly parse the directory list
110
-
111
- StyleCollection initialization
112
- - should properly initialize the fonts hash
113
- - should property initialize the number_formats hash
114
- - should properly initialize the styles hash
115
- - should property initialize a default style
116
- - should have a valid font_index in the default_format
117
- - should have a valid number_format_index in the default_format
118
- - should have a valid alignment in the default_format
119
- - should have a valid borders in the default_format
120
- - should have a valid pattern in the default_format
121
- - should have a valid protection in the default_format
122
-
123
- StyleCollection adding new styles
124
- - should return the default style index when trying to add a nil style
125
- - should correctly add a new blank style
126
- - should not re-add an existing number format
127
- - should add a new number format
128
-
129
- StyleCollection biff
130
- - should correctly convert font data to biff
131
- - should correctly convert number format data to biff
132
- - should correctly convert cell styles data to biff
133
-
134
- Utilities
135
- - should round trip pixels to twips
136
- - should round trip points to pixels
137
-
138
- Utilities Excel boolean conversion
139
- - should convert true values to 1
140
- - should convert false values to 0
141
- - should convert 1 to true
142
- - should convert 0 to false
143
- - should raise an error with anything else
144
-
145
- Utilities Excel date converter
146
- - should convert objects of class Date
147
- - should convert objects of class DateTime
148
- - should convert objects of class Time
149
-
150
- Utilities hex function
151
- - should description
152
-
153
- Workbook to_biff
154
- - should not raise an error
155
-
156
- Finished in 0.100042 seconds
157
-
158
- 80 examples, 0 failures
data/webby/README.txt DELETED
@@ -1,6 +0,0 @@
1
- Documentation for Surpass, written in Webby.
2
-
3
- To build this, you will need this branch of Webby:
4
- bzr branch http://ananelson.com/code/webby
5
-
6
- Run "rake pdf" to create the web site and to compile the user manual using LaTeX.