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
data/webby/Sitefile DELETED
@@ -1,43 +0,0 @@
1
- require "gorgyrella"
2
- require "surpass"
3
-
4
- task :screenshots do
5
- require "tasks/screenshots"
6
- end
7
-
8
- task :default => :pdf
9
-
10
- task :rsync => [:pdf] do
11
- system "rsync -v -r --delete --exclude-from=rsync-exclude output/ ananelson@rubyforge.org:/var/www/gforge-projects/surpass/"
12
- end
13
-
14
- task :generate_source do
15
- `rm -r content/source`
16
- `mkdir content/source`
17
- `ls ../lib/surpass/*.rb`.chomp.split.each do |n|
18
- File.open("content/source/#{File.basename(n, '.rb')}.txt", "w") do |f|
19
- f.write %{---
20
- title: #{File.basename(n)}
21
- layout: web
22
- filter:
23
- - erb
24
- ---
25
- <%= gorg("/Users/ana/work/surpass/lib/surpass/#{File.basename(n)}") %>
26
- }
27
- end
28
- end
29
- end
30
-
31
- def manual_filename
32
- "surpass-manual-#{Surpass::VERSION.gsub(".", "-")}.pdf"
33
- end
34
-
35
- def gzipped_source
36
- bzr_version = `bzr revno ..`.strip
37
- filename = "surpass-r#{bzr_version}.tgz"
38
-
39
- # Create gzipped file
40
- `bzr export output/#{filename} ..`
41
-
42
- filename
43
- end
@@ -1,6 +0,0 @@
1
- ---
2
- filter: erb
3
- extension: css
4
- layout: false
5
- ---
6
- <%= `pygmentize -S perldoc -f html` %>
@@ -1,279 +0,0 @@
1
- /* ======================================================== */
2
- /* Created by Devit Schizoper */
3
- /* Created HomePages http://LoadFoo.starzonewebhost.com */
4
- /* Created Day 01.12.2006 */
5
- /* ======================================================== */
6
-
7
-
8
- body {
9
- margin: 0px;
10
- background: url(../img/top_bg.gif);
11
- background-repeat: repeat-x;
12
- font-family: Verdana, Arial, sans-serif;
13
- font-size: .6em;
14
- }
15
-
16
- p {
17
- line-height: 17px;
18
- margin: 11px 0 10px 0;
19
- padding: 0px;
20
- font-size: 1.2em;
21
- }
22
-
23
- code {
24
- font-size: 1.3em;
25
- }
26
- .code {
27
- font-size: 1.3em;
28
- }
29
-
30
- .highlight {
31
- font-size: 1.5em;
32
- }
33
-
34
- h2 {
35
- color: #9f9f9f;
36
- margin:0px;
37
- padding:0px;
38
- font-size: 15px;
39
- }
40
-
41
- ul {
42
- font-size: 10px;
43
- margin:0;
44
- padding:0;
45
- list-style-image: url(../img/bullet.gif);
46
- }
47
-
48
- a {
49
- color: #93B300;
50
- }
51
-
52
- a:hover {
53
- text-decoration: none;
54
- }
55
-
56
- blockquote{
57
- background: #F7FDE3;
58
- color: #606060;
59
- padding: 10px;
60
- }
61
-
62
-
63
- /**** Main Container ***/
64
-
65
-
66
- #wrap {
67
- margin-left: auto;
68
- margin-right: auto;
69
- width: 730px;
70
- }
71
-
72
-
73
- /**** Top ***/
74
-
75
-
76
- #top {
77
- width: 100%;
78
- height: 88px;
79
- color: #fff;
80
- background: #000 url(../img/top_bg.gif);
81
- overflow:hidden;
82
- }
83
-
84
- #top h2 {
85
- color: White;
86
- letter-spacing: 3px;
87
- font-size: 2.4em;
88
- font-weight: normal;
89
- position: relative;
90
- margin: 0px;
91
- top:33px;
92
- display:block;
93
- float:left;
94
- background: url(../img/bg_t.gif) no-repeat;
95
- padding-left: 10px;
96
- }
97
-
98
- #top h2 a {
99
- color: white;
100
- text-decoration: none;
101
- }
102
-
103
- #top h2 a:hover {
104
- color: #93B300;
105
- }
106
-
107
-
108
- /**** Main Menu ***/
109
-
110
-
111
- #menu {
112
- display: block;
113
- float:right;
114
- }
115
-
116
- #menu ul {
117
- margin: 0;
118
- list-style: none;
119
- }
120
-
121
- #menu li {
122
- display: block;
123
- float: left;
124
- white-space: nowrap;
125
- }
126
-
127
- #menu li a {
128
- display: block;
129
- padding: 55px 20px 12px 20px;
130
- text-decoration: none;
131
- color: #fff;
132
- font-weight: bold;
133
- }
134
-
135
- * html #menu a {width:1%;}
136
-
137
- #menu li a:hover {
138
- background: url(../img/bg_menu.gif);
139
- }
140
-
141
- #menu li a.current {
142
- letter-spacing: 1px;
143
- color: gray;
144
- background: url(../img/bg_menu.gif);
145
- }
146
-
147
- #menu li a.current:hover {
148
- color: #fff;
149
- }
150
-
151
-
152
- /**** Content Container ***/
153
-
154
-
155
- #content {
156
- width: 100%;
157
- margin-top:30px;
158
- }
159
-
160
- #content h2 {
161
- margin: 0;
162
- padding: 10px 0 10px 0;
163
- }
164
-
165
-
166
- /**** Content ***/
167
-
168
-
169
- #left ul {
170
- padding: 15px 0 15px 35px;
171
- margin:0;
172
- }
173
-
174
- #left li {
175
- margin-bottom:5px;
176
- }
177
-
178
- #left {
179
- width: 390px;
180
- float:left;
181
- display: block;
182
- margin-left: 20px;
183
- display: inline;
184
- }
185
-
186
-
187
- /**** Sidebar ***/
188
-
189
-
190
- #right {
191
- width: 315px;
192
- float: right;
193
- display:block;
194
- margin-top: 10px;
195
- }
196
-
197
- #right .box {
198
- width: 24em;/*280px*/
199
- background: #F6F9FB;
200
- border: 1px solid #E1E1E1;
201
- padding:10px 10px 15px 10px;
202
- float: right;
203
- }
204
-
205
- #right .box h2 {
206
- font-size: 1.1em;
207
- margin: 0px 0 0px 0;
208
- padding:0px 0 5px 0;
209
- }
210
-
211
- #right .box a {
212
- margin: 10px 0 10px 0;
213
- color: #93B300;
214
- font-size: 10px;
215
- }
216
-
217
- #right .box p {
218
- margin: 5px 0 10px 0;
219
- line-height: 15px;
220
- }
221
-
222
- #right .box ul {
223
- padding: 0 0 7px 20px;
224
- margin:10px 0 10px 0;
225
- }
226
-
227
- #right .box li {
228
- margin-top:5px;
229
- }
230
-
231
- #nav{ list-style: none; margin: 2.0em 0; width: 25em; float: right;}
232
- #nav li{ padding: 0; margin: 0; }
233
- #nav a{
234
- display: block;
235
- height: 2.0em;
236
- padding: 0.3em 0.3em 0.3em 0.8em;
237
- border-bottom: 2px; /*solid #1a1a1a*/
238
- border-top: 2px; /*solid #1a1a1a*/
239
- color: #93B300;
240
- background-color: #F7F9FB;
241
- font-weight: bold;
242
- text-decoration: none;
243
- }
244
-
245
- #nav a:hover{
246
- color: #1a1a1a;
247
- background: url(../img/bg_t.gif) no-repeat;
248
- background-color: #fff;
249
- font-weight: bold;
250
- }
251
-
252
- /**** Clear Div ***/
253
-
254
-
255
- #clear {
256
- display: block;
257
- clear: both;
258
- width: 100%;
259
- height:1px;
260
- overflow:hidden;
261
- }
262
-
263
-
264
- /**** Footer ***/
265
-
266
-
267
- #footer {
268
- margin: 40px auto 0 auto;
269
- text-align: center;
270
- border-top: dotted 1px gray;
271
- padding: 20px 0 20px 0;
272
- width: 70%;
273
- }
274
-
275
- #footer p {
276
- margin: 0px;
277
- padding: 0;
278
- font-size: 0.9em;
279
- }
Binary file
@@ -1,32 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new(__FILE__.gsub(/rb$/, "xls"))
5
- sheet = book.add_sheet
6
-
7
- # Passing true for the style parameter to write will invoke autoformatting.
8
- sheet.write(0, 0, "Hello World!", true)
9
- sheet.write(1, 0, 1, true)
10
- sheet.write(2, 0, 1.0, true)
11
- sheet.write(3, 0, Date.today, true)
12
- sheet.write(4, 0, DateTime.now, true)
13
- sheet.write(5, 0, Time.now, true)
14
-
15
- array_of_arrays = [
16
- [1, 2, 3],
17
- [1.0, 2.0, 3.0],
18
- [Date.today, DateTime.now],
19
- %w{a b c}
20
- ]
21
-
22
- # Writing arrays will automatically autoformat.
23
- sheet.write(7, 0, "With autoformat:")
24
- sheet.write_arrays(8, 0, array_of_arrays)
25
-
26
- # Unless you specify your own format, or nil for a generic default.
27
- sheet.write(13, 0, "Without autoformat:")
28
- sheet.write_arrays(14, 0, array_of_arrays, nil)
29
-
30
- sheet.set_column_widths(0..2, 20)
31
-
32
- book.save
Binary file
Binary file
@@ -1,15 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new
5
- sheet = book.add_sheet("Borders")
6
-
7
- per_row = 18
8
-
9
- Borders.line_type_directives.sort.each_with_index do |c, i|
10
- format = StyleFormat.new
11
- format.borders.all = c
12
- sheet.write(i*2+1, 1, c, format)
13
- end
14
-
15
- book.save(__FILE__.gsub(/rb$/, "xls"))
Binary file
Binary file
@@ -1,23 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new(__FILE__.gsub(/rb$/, "xls"))
5
- sheet = book.add_sheet("Colours") # You can name your worksheets.
6
-
7
- per_row = 18
8
-
9
- Formatting::COLORS.keys.sort.each_with_index do |c, i|
10
- format = StyleFormat.new
11
- format.pattern.color = c
12
- row = i % per_row
13
- color_column = (i/per_row)*2
14
- label_column = (i/per_row)*2 + 1
15
-
16
- sheet.write(row, color_column, nil, :fill_color => c)
17
- sheet.write(row, label_column, c, :font_size => 16)
18
-
19
- sheet.set_column_width(color_column, 3)
20
- sheet.set_column_width(label_column, 30)
21
- end
22
-
23
- book.save
Binary file
Binary file
@@ -1,11 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new
5
- sheet = book.add_sheet
6
-
7
- sheet.write(0, 0, "Hello World!")
8
-
9
- File.open(__FILE__.gsub(/rb$/, "xls"), "w") do |f|
10
- f.write book.data
11
- end
Binary file
Binary file
@@ -1,78 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new(__FILE__.gsub(/rb$/, "xls"))
5
- sheet = book.add_sheet("Demo Worksheet") # You can name your worksheets.
6
-
7
- # Let's set up some formatting.
8
-
9
- # Remember to use Excel-style formatting directives, not sprintf.
10
- date_format = StyleFormat.new(:number_format_string => "DDDD DD MMM YYYY")
11
-
12
- fancy_format = StyleFormat.new(
13
- :font_name => 'Times New Roman',
14
- :font_colour => 'green',
15
- :font_italic => true
16
- )
17
-
18
- sheet.write(0, 0, "Hello World!", fancy_format)
19
- sheet.write(0, 1, Date.today, date_format)
20
-
21
- # You can also set up formatting by passing attributes directly to the constituents of StyleFormat
22
-
23
- # Font colours.
24
- Formatting::COLOURS.keys.each_with_index do |c, i|
25
- format = StyleFormat.new
26
- format.font.name = 'Verdana'
27
- format.font.color = c
28
- format.font.size = i + 5
29
- sheet.write(i, 5, c, format)
30
- end
31
-
32
- # Font underlining.
33
-
34
- [:none, :single, :single_accounting, :double, :double_accounting, nil, true, false].each_with_index do |u, i|
35
- format = StyleFormat.new
36
- format.font.underline = u
37
- sheet.write(i, 7, u.to_s, format)
38
- end
39
-
40
- # Font bold, italic, strikethrough, outline are simple booleans.
41
- [:bold, :italic, :struck_out, :outline].each_with_index do |s, i|
42
- attribute = ("font_" + s.to_s).to_sym
43
- sheet.write(i, 8, s.to_s, StyleFormat.new(attribute => true))
44
- end
45
-
46
- # Cell alignment.
47
- sheet.write(15, 2, "top left", :text_align => 'top left',
48
- :border_top => 'pink',
49
- :border_left => 'pink'
50
- )
51
- sheet.write(15, 3, "top center", :text_align => 'top center')
52
- sheet.write(15, 4, "top right", :text_align => 'top right')
53
- sheet.write(16, 2, "bottom left", :text_align => 'bottom left')
54
- sheet.write(16, 3, "bottom centre", :text_align => 'bottom centre')
55
- sheet.write(16, 4, "bottom right", :text_align => 'bottom right',
56
- :border_bottom => 'pink',
57
- :border_right => 'pink'
58
- )
59
-
60
-
61
- # Borders
62
- sheet.write(3, 1, "borders",
63
- :border_right => 'medium blue',
64
- :border_left => 'yellow', # thin by default
65
- :border_top => 'dotted purple',
66
- :border_bottom => 'dashed' # black by default
67
- )
68
-
69
- # Or the hash-free option.
70
- crazy_border_format = StyleFormat.new
71
- crazy_border_format.borders.all = 'slanted-medium-dash-dotted grey'
72
- crazy_border_format.pattern.fill = 'light-cornflower-blue'
73
-
74
- sheet.write(5, 1, "borders", crazy_border_format)
75
-
76
- sheet.write(7, 1, "fill", :fill_color => 'yellow')
77
-
78
- book.save
Binary file
Binary file
@@ -1,8 +0,0 @@
1
- from xlwt import *
2
-
3
- book = Workbook()
4
- sheet = book.add_sheet("Sheet1")
5
-
6
- sheet.write(0, 0, "Hello World!")
7
-
8
- book.save("content/examples/hello-world-python.xls")
@@ -1,9 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new
5
- sheet = book.add_sheet
6
-
7
- sheet.write(0, 0, "Hello World!")
8
-
9
- book.save("content/examples/hello-world.xls")
Binary file
@@ -1,14 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new(__FILE__.gsub(/rb$/, "xls"))
5
- sheet = book.add_sheet
6
-
7
- date_format = StyleFormat.new(:number_format_string => 'DDD MMM YYYY')
8
- sheet.write(0, 0, Date.today, date_format)
9
-
10
- two_dp_format = StyleFormat.new
11
- two_dp_format.number_format_string = "#,##0.00"
12
- sheet.write(0, 1, 1002.71828, two_dp_format)
13
-
14
- book.save
Binary file
@@ -1,26 +0,0 @@
1
- require 'rubygems'
2
- require 'surpass'
3
-
4
- book = Workbook.new
5
- sheet = book.add_sheet("Patterns")
6
-
7
- per_row = 19
8
-
9
- Pattern.fill_directives.sort.each_with_index do |c, i|
10
- format = StyleFormat.new
11
- format.pattern.pattern = c
12
-
13
- row = i % per_row
14
- label_column = (i/per_row)*2
15
- pattern_column = (i/per_row)*2 + 1
16
-
17
- sheet.write(row, label_column, c, :font_size => 14)
18
- sheet.write(row, pattern_column, nil, format)
19
-
20
- sheet.write(row, pattern_column + 1, nil, :pattern_fore_colour => 'green', :fill_pattern => c)
21
- sheet.write(row, pattern_column + 2, nil, :pattern_fore_colour => 'yellow', :pattern_back_colour => 'blue', :fill_pattern => c)
22
-
23
- sheet.set_column_width(label_column, 30)
24
- end
25
-
26
- book.save(__FILE__.gsub(/rb$/, "xls"))
Binary file
@@ -1 +0,0 @@
1
- surpass -c | grep green
@@ -1 +0,0 @@
1
- surpass -h
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,16 +0,0 @@
1
- ---
2
- title: Surpass
3
- author: Ana Nelson
4
- layout: web
5
- filter:
6
- - erb
7
- - textile
8
- ---
9
-
10
- Homepage of the Surpass project. Surpass is software for creating Excel spreadsheets in pure native Ruby.
11
-
12
- h2. Example:
13
-
14
- <%= gorg("content/examples/formatting.rb", "1") %>
15
-
16
- <img src="examples/formatting.png" />
@@ -1,24 +0,0 @@
1
- ---
2
- title: Installation
3
- layout: web
4
- created_at: 2009-06-24 09:38:29.666689 +01:00
5
- filter:
6
- - erb
7
- - textile
8
- ---
9
-
10
- h2. Installing Surpass via Rubygems
11
-
12
- @sudo gem install surpass@
13
-
14
- h2. Installing Surpass from Source
15
-
16
- Source code is available from the "Bazaar":http://bazaar-vcs.org repository:
17
-
18
- @bzr branch http://ananelson.com/code/surpass@
19
-
20
- To install the gem:
21
-
22
- @sudo rake gem:install@
23
-
24
- from within the surpass directory.
@@ -1,7 +0,0 @@
1
- ---
2
- title: ExcelFormulaLexer.rb
3
- layout: web
4
- filter:
5
- - erb
6
- ---
7
- <%= gorg("/Users/ana/work/surpass/lib/surpass/ExcelFormulaLexer.rb") %>
@@ -1,7 +0,0 @@
1
- ---
2
- title: ExcelFormulaParser.rb
3
- layout: web
4
- filter:
5
- - erb
6
- ---
7
- <%= gorg("/Users/ana/work/surpass/lib/surpass/ExcelFormulaParser.rb") %>
@@ -1,7 +0,0 @@
1
- ---
2
- title: biff_record.rb
3
- layout: web
4
- filter:
5
- - erb
6
- ---
7
- <%= gorg("/Users/ana/work/surpass/lib/surpass/biff_record.rb") %>