surpass 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/README.txt +3 -20
- data/Rakefile +2 -13
- data/bin/surpass +8 -0
- data/examples/big-16mb.rb +25 -0
- data/examples/big-random-strings.rb +28 -0
- data/examples/blanks.rb +34 -0
- data/examples/blanks.xls +0 -0
- data/examples/col_width.rb +16 -0
- data/examples/col_width.xls +0 -0
- data/examples/dates.rb +31 -0
- data/examples/dates.xls +0 -0
- data/examples/format.rb +23 -0
- data/examples/format.xls +0 -0
- data/examples/hello-world.rb +9 -0
- data/examples/hello-world.xls +0 -0
- data/examples/image.rb +10 -0
- data/examples/image.xls +0 -0
- data/examples/merged.rb +36 -0
- data/examples/merged.xls +0 -0
- data/examples/merged0.rb +27 -0
- data/examples/merged0.xls +0 -0
- data/examples/merged1.rb +99 -0
- data/examples/merged1.xls +0 -0
- data/examples/num_formats.rb +55 -0
- data/examples/num_formats.xls +0 -0
- data/examples/numbers.rb +24 -0
- data/examples/numbers.xls +0 -0
- data/examples/outline.rb +110 -0
- data/examples/outline.xls +0 -0
- data/examples/panes.rb +48 -0
- data/examples/panes.xls +0 -0
- data/examples/protection.rb +132 -0
- data/examples/protection.xls +0 -0
- data/examples/python.bmp +0 -0
- data/examples/row_styles.rb +16 -0
- data/examples/row_styles.xls +0 -0
- data/examples/row_styles_empty.rb +15 -0
- data/examples/row_styles_empty.xls +0 -0
- data/examples/set_cell_and_range_style.rb +12 -0
- data/examples/set_cell_and_range_style.xls +0 -0
- data/examples/wrapped-text.rb +13 -0
- data/examples/wrapped-text.xls +0 -0
- data/examples/write_arrays.rb +22 -0
- data/examples/write_arrays.xls +0 -0
- data/examples/ws_props.rb +80 -0
- data/lib/surpass/ExcelFormula.g +366 -0
- data/lib/surpass/ExcelFormula.tokens +30 -0
- data/lib/surpass/ExcelFormulaLexer.rb +922 -0
- data/lib/surpass/ExcelFormulaParser.rb +602 -0
- data/lib/{biff_record.rb → surpass/biff_record.rb} +0 -0
- data/lib/{bitmap.rb → surpass/bitmap.rb} +0 -0
- data/lib/{cell.rb → surpass/cell.rb} +2 -34
- data/lib/{chart.rb → surpass/chart.rb} +0 -0
- data/lib/{column.rb → surpass/column.rb} +0 -0
- data/lib/{document.rb → surpass/document.rb} +0 -0
- data/lib/surpass/excel_formula.rb +23 -0
- data/lib/{excel_magic.rb → surpass/excel_magic.rb} +0 -0
- data/lib/{formatting.rb → surpass/formatting.rb} +93 -53
- data/lib/{row.rb → surpass/row.rb} +0 -0
- data/lib/{style.rb → surpass/style.rb} +2 -1
- data/lib/surpass/tokens.txt +2 -0
- data/lib/{utilities.rb → surpass/utilities.rb} +0 -0
- data/lib/{workbook.rb → surpass/workbook.rb} +0 -0
- data/lib/{worksheet.rb → surpass/worksheet.rb} +15 -6
- data/lib/surpass.rb +1 -1
- data/spec/biff_record_spec.rb +268 -0
- data/spec/cell_spec.rb +56 -0
- data/spec/data/random-strings.txt +10000 -0
- data/spec/document_spec.rb +168 -0
- data/spec/excel_formula_spec.rb +27 -0
- data/spec/formatting_spec.rb +53 -0
- data/spec/output/cells-rk.xls +0 -0
- data/spec/output/cells.xls +0 -0
- data/spec/output/mini.xls +0 -0
- data/spec/reference/P-0508-0000507647-3280-5298.xls +0 -0
- data/spec/reference/all-cell-styles.bin +0 -0
- data/spec/reference/all-number-formats.bin +0 -0
- data/spec/reference/all-styles.bin +0 -0
- data/spec/reference/mini.xls +0 -0
- data/spec/row_spec.rb +19 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/style_spec.rb +89 -0
- data/spec/surpass_spec.rb +7 -0
- data/spec/utilities_spec.rb +57 -0
- data/spec/workbook_spec.rb +48 -0
- data/spec/worksheet_spec.rb +0 -0
- data/stats/cloc.txt +8 -0
- data/stats/rcov.txt +0 -0
- data/stats/specdoc.txt +158 -0
- data/surpass.gemspec +40 -0
- data/tasks/setup.rb +1 -1
- data/tasks/zentest.rake +36 -0
- data/webby/README.txt +6 -0
- data/webby/Sitefile +43 -0
- data/webby/content/css/pygments.txt +6 -0
- data/webby/content/css/style.css +279 -0
- data/webby/content/examples/autoformat.png +0 -0
- data/webby/content/examples/autoformat.rb +32 -0
- data/webby/content/examples/autoformat.xls +0 -0
- data/webby/content/examples/borders.png +0 -0
- data/webby/content/examples/borders.rb +15 -0
- data/webby/content/examples/borders.xls +0 -0
- data/webby/content/examples/colours.png +0 -0
- data/webby/content/examples/colours.rb +23 -0
- data/webby/content/examples/colours.xls +0 -0
- data/webby/content/examples/data.png +0 -0
- data/webby/content/examples/data.rb +11 -0
- data/webby/content/examples/data.xls +0 -0
- data/webby/content/examples/formatting.png +0 -0
- data/webby/content/examples/formatting.rb +78 -0
- data/webby/content/examples/formatting.xls +0 -0
- data/webby/content/examples/hello-world.png +0 -0
- data/webby/content/examples/hello-world.py +8 -0
- data/webby/content/examples/hello-world.rb +9 -0
- data/webby/content/examples/hello-world.xls +0 -0
- data/webby/content/examples/number-format-string.png +0 -0
- data/webby/content/examples/number-format-string.rb +14 -0
- data/webby/content/examples/number-format-string.xls +0 -0
- data/webby/content/examples/patterns.png +0 -0
- data/webby/content/examples/patterns.rb +26 -0
- data/webby/content/examples/patterns.xls +0 -0
- data/webby/content/examples/show-greens.sh +1 -0
- data/webby/content/examples/surpass-info.sh +1 -0
- data/webby/content/img/Thumbs.db +0 -0
- data/webby/content/img/bg_menu.gif +0 -0
- data/webby/content/img/bg_t.gif +0 -0
- data/webby/content/img/bullet.gif +0 -0
- data/webby/content/img/logo.png +0 -0
- data/webby/content/img/logo_.jpg +0 -0
- data/webby/content/img/top_bg.gif +0 -0
- data/webby/content/img/top_bg_.gif +0 -0
- data/webby/content/index.txt +16 -0
- data/webby/content/installation/index.txt +24 -0
- data/webby/content/source/ExcelFormulaLexer.txt +7 -0
- data/webby/content/source/ExcelFormulaParser.txt +7 -0
- data/webby/content/source/biff_record.txt +7 -0
- data/webby/content/source/bitmap.txt +7 -0
- data/webby/content/source/cell.txt +7 -0
- data/webby/content/source/chart.txt +7 -0
- data/webby/content/source/column.txt +7 -0
- data/webby/content/source/document.txt +7 -0
- data/webby/content/source/excel_formula.txt +7 -0
- data/webby/content/source/excel_magic.txt +7 -0
- data/webby/content/source/formatting.txt +7 -0
- data/webby/content/source/row.txt +7 -0
- data/webby/content/source/style.txt +7 -0
- data/webby/content/source/utilities.txt +7 -0
- data/webby/content/source/workbook.txt +7 -0
- data/webby/content/source/worksheet.txt +7 -0
- data/webby/content/surpass-manual.erb +198 -0
- data/webby/layouts/book.txt +29 -0
- data/webby/layouts/default.txt +27 -0
- data/webby/layouts/two_column.txt +25 -0
- data/webby/layouts/web.txt +66 -0
- data/webby/output/.cairn +0 -0
- data/webby/output/css/blueprint/ie.css +26 -0
- data/webby/output/css/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/webby/output/css/blueprint/plugins/buttons/icons/key.png +0 -0
- data/webby/output/css/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/webby/output/css/blueprint/plugins/buttons/readme.txt +32 -0
- data/webby/output/css/blueprint/plugins/buttons/screen.css +97 -0
- data/webby/output/css/blueprint/plugins/fancy-type/readme.txt +14 -0
- data/webby/output/css/blueprint/plugins/fancy-type/screen.css +71 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/readme.txt +18 -0
- data/webby/output/css/blueprint/plugins/link-icons/screen.css +40 -0
- data/webby/output/css/blueprint/plugins/rtl/readme.txt +10 -0
- data/webby/output/css/blueprint/plugins/rtl/screen.css +109 -0
- data/webby/output/css/blueprint/print.css +30 -0
- data/webby/output/css/blueprint/screen.css +251 -0
- data/webby/output/css/blueprint/src/forms.css +49 -0
- data/webby/output/css/blueprint/src/grid.css +212 -0
- data/webby/output/css/blueprint/src/grid.png +0 -0
- data/webby/output/css/blueprint/src/ie.css +59 -0
- data/webby/output/css/blueprint/src/print.css +85 -0
- data/webby/output/css/blueprint/src/reset.css +38 -0
- data/webby/output/css/blueprint/src/typography.css +105 -0
- data/webby/output/css/pygments.css +59 -0
- data/webby/output/css/site.css +62 -0
- data/webby/output/css/style.css +279 -0
- data/webby/output/examples/autoformat.png +0 -0
- data/webby/output/examples/autoformat.rb +32 -0
- data/webby/output/examples/autoformat.xls +0 -0
- data/webby/output/examples/borders.png +0 -0
- data/webby/output/examples/borders.rb +15 -0
- data/webby/output/examples/borders.xls +0 -0
- data/webby/output/examples/colours.png +0 -0
- data/webby/output/examples/colours.rb +23 -0
- data/webby/output/examples/colours.xls +0 -0
- data/webby/output/examples/data.png +0 -0
- data/webby/output/examples/data.rb +11 -0
- data/webby/output/examples/data.xls +0 -0
- data/webby/output/examples/formatting.png +0 -0
- data/webby/output/examples/formatting.rb +78 -0
- data/webby/output/examples/formatting.xls +0 -0
- data/webby/output/examples/hello-world.png +0 -0
- data/webby/output/examples/hello-world.py +8 -0
- data/webby/output/examples/hello-world.rb +9 -0
- data/webby/output/examples/hello-world.xls +0 -0
- data/webby/output/examples/number-format-string.png +0 -0
- data/webby/output/examples/number-format-string.rb +14 -0
- data/webby/output/examples/number-format-string.xls +0 -0
- data/webby/output/examples/patterns.png +0 -0
- data/webby/output/examples/patterns.rb +26 -0
- data/webby/output/examples/patterns.xls +0 -0
- data/webby/output/examples/show-greens.sh +1 -0
- data/webby/output/examples/surpass-info.sh +1 -0
- data/webby/output/img/Thumbs.db +0 -0
- data/webby/output/img/bg_menu.gif +0 -0
- data/webby/output/img/bg_t.gif +0 -0
- data/webby/output/img/bullet.gif +0 -0
- data/webby/output/img/logo.png +0 -0
- data/webby/output/img/logo_.jpg +0 -0
- data/webby/output/img/top_bg.gif +0 -0
- data/webby/output/img/top_bg_.gif +0 -0
- data/webby/output/index.html +138 -0
- data/webby/output/installation/index.html +64 -0
- data/webby/output/installation/installation.html +1 -0
- data/webby/output/installation.html +1 -0
- data/webby/output/source/ExcelFormulaLexer.html +981 -0
- data/webby/output/source/ExcelFormulaParser.html +661 -0
- data/webby/output/source/biff_record.html +462 -0
- data/webby/output/source/bitmap.html +277 -0
- data/webby/output/source/cell.html +241 -0
- data/webby/output/source/chart.html +64 -0
- data/webby/output/source/column.html +99 -0
- data/webby/output/source/document.html +465 -0
- data/webby/output/source/excel_formula.html +82 -0
- data/webby/output/source/excel_magic.html +1072 -0
- data/webby/output/source/formatting.html +664 -0
- data/webby/output/source/row.html +169 -0
- data/webby/output/source/style.html +158 -0
- data/webby/output/source/surpass.html +110 -0
- data/webby/output/source/utilities.html +145 -0
- data/webby/output/source/workbook.html +265 -0
- data/webby/output/source/worksheet.html +331 -0
- data/webby/output/surpass-manual-0-0-5.pdf +0 -0
- data/webby/output/surpass-manual.aux +50 -0
- data/webby/output/surpass-manual.log +366 -0
- data/webby/output/surpass-manual.out +20 -0
- data/webby/output/surpass-manual.tex +582 -0
- data/webby/output/surpass-manual.toc +20 -0
- data/webby/rsync-exclude +7 -0
- data/webby/tasks/latex.rake +14 -0
- data/webby/tasks/screenshots.rb +58 -0
- data/webby/templates/article.erb +15 -0
- data/webby/templates/book.erb +16 -0
- data/webby/templates/page.erb +9 -0
- metadata +302 -24
- data/bin/surpass-info +0 -20
- data/lib/excel_formula.rb +0 -6
data/surpass.gemspec
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{surpass}
|
5
|
+
s.version = "0.0.6"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Ana Nelson"]
|
9
|
+
s.date = %q{2009-10-27}
|
10
|
+
s.default_executable = %q{surpass}
|
11
|
+
s.description = %q{Surpass is writing (and eventually reading) excel workbooks in pure Ruby. Surpass is based on xlwt (and pyExcelerator).
|
12
|
+
|
13
|
+
For comprehensive documentation, please refer to the PDF manual which is available from http://surpass.rubyforge.org or in the root directory of the source code repository.
|
14
|
+
|
15
|
+
If you like to learn from playing with working examples, then there are plenty in the examples/ and webby/examples directories of the source code.}
|
16
|
+
s.email = %q{ana@ananelson.com}
|
17
|
+
s.executables = ["surpass"]
|
18
|
+
s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "README.txt", "bin/surpass", "lib/surpass/ExcelFormula.g", "lib/surpass/ExcelFormula.tokens", "lib/surpass/tokens.txt", "spec/data/random-strings.txt", "stats/cloc.txt", "stats/rcov.txt", "stats/specdoc.txt", "webby/README.txt", "webby/content/css/pygments.txt", "webby/content/index.txt", "webby/content/installation/index.txt", "webby/content/source/ExcelFormulaLexer.txt", "webby/content/source/ExcelFormulaParser.txt", "webby/content/source/biff_record.txt", "webby/content/source/bitmap.txt", "webby/content/source/cell.txt", "webby/content/source/chart.txt", "webby/content/source/column.txt", "webby/content/source/document.txt", "webby/content/source/excel_formula.txt", "webby/content/source/excel_magic.txt", "webby/content/source/formatting.txt", "webby/content/source/row.txt", "webby/content/source/style.txt", "webby/content/source/surpass.txt", "webby/content/source/utilities.txt", "webby/content/source/workbook.txt", "webby/content/source/worksheet.txt", "webby/layouts/book.txt", "webby/layouts/default.txt", "webby/layouts/two_column.txt", "webby/layouts/web.txt"]
|
19
|
+
s.files = [".bzr/README", ".bzr/branch-format", ".bzr/branch/branch.conf", ".bzr/branch/format", ".bzr/branch/last-revision", ".bzr/branch/tags", ".bzr/checkout/conflicts", ".bzr/checkout/dirstate", ".bzr/checkout/format", ".bzr/checkout/merge-hashes", ".bzr/repository/format", ".bzr/repository/indices/151ac19fd622c8084eca354d80336510.iix", ".bzr/repository/indices/151ac19fd622c8084eca354d80336510.rix", ".bzr/repository/indices/151ac19fd622c8084eca354d80336510.six", ".bzr/repository/indices/151ac19fd622c8084eca354d80336510.tix", ".bzr/repository/indices/29647a57de6255f81ed838b5aaf89e54.iix", ".bzr/repository/indices/29647a57de6255f81ed838b5aaf89e54.rix", ".bzr/repository/indices/29647a57de6255f81ed838b5aaf89e54.six", ".bzr/repository/indices/29647a57de6255f81ed838b5aaf89e54.tix", ".bzr/repository/indices/5901bb87fc326fc481c268c7093087d6.iix", ".bzr/repository/indices/5901bb87fc326fc481c268c7093087d6.rix", ".bzr/repository/indices/5901bb87fc326fc481c268c7093087d6.six", ".bzr/repository/indices/5901bb87fc326fc481c268c7093087d6.tix", ".bzr/repository/indices/60afa9e7714310e7df9780bb1be8904f.iix", ".bzr/repository/indices/60afa9e7714310e7df9780bb1be8904f.rix", ".bzr/repository/indices/60afa9e7714310e7df9780bb1be8904f.six", ".bzr/repository/indices/60afa9e7714310e7df9780bb1be8904f.tix", ".bzr/repository/indices/6f8954ed6fa3fc3771613f06347014f4.iix", ".bzr/repository/indices/6f8954ed6fa3fc3771613f06347014f4.rix", ".bzr/repository/indices/6f8954ed6fa3fc3771613f06347014f4.six", ".bzr/repository/indices/6f8954ed6fa3fc3771613f06347014f4.tix", ".bzr/repository/indices/764c4380dd16055c6dc1d6ed22ce4c16.iix", ".bzr/repository/indices/764c4380dd16055c6dc1d6ed22ce4c16.rix", ".bzr/repository/indices/764c4380dd16055c6dc1d6ed22ce4c16.six", ".bzr/repository/indices/764c4380dd16055c6dc1d6ed22ce4c16.tix", ".bzr/repository/indices/929fece420d91bbac5a96347aee1b3d6.iix", ".bzr/repository/indices/929fece420d91bbac5a96347aee1b3d6.rix", ".bzr/repository/indices/929fece420d91bbac5a96347aee1b3d6.six", ".bzr/repository/indices/929fece420d91bbac5a96347aee1b3d6.tix", ".bzr/repository/indices/bba034b51d01b176f36c84a60d9f947f.iix", ".bzr/repository/indices/bba034b51d01b176f36c84a60d9f947f.rix", ".bzr/repository/indices/bba034b51d01b176f36c84a60d9f947f.six", ".bzr/repository/indices/bba034b51d01b176f36c84a60d9f947f.tix", ".bzr/repository/indices/de1db3c0ce54620ccf022905ad589c90.iix", ".bzr/repository/indices/de1db3c0ce54620ccf022905ad589c90.rix", ".bzr/repository/indices/de1db3c0ce54620ccf022905ad589c90.six", ".bzr/repository/indices/de1db3c0ce54620ccf022905ad589c90.tix", ".bzr/repository/indices/fac52d20970efba4203df3cef78176a2.iix", ".bzr/repository/indices/fac52d20970efba4203df3cef78176a2.rix", ".bzr/repository/indices/fac52d20970efba4203df3cef78176a2.six", ".bzr/repository/indices/fac52d20970efba4203df3cef78176a2.tix", ".bzr/repository/indices/fd968e63b0439f3eccfaf7ce7d421d0c.iix", ".bzr/repository/indices/fd968e63b0439f3eccfaf7ce7d421d0c.rix", ".bzr/repository/indices/fd968e63b0439f3eccfaf7ce7d421d0c.six", ".bzr/repository/indices/fd968e63b0439f3eccfaf7ce7d421d0c.tix", ".bzr/repository/obsolete_packs/14491a06534831c3c83658e356759a01.iix", ".bzr/repository/obsolete_packs/14491a06534831c3c83658e356759a01.pack", ".bzr/repository/obsolete_packs/14491a06534831c3c83658e356759a01.rix", ".bzr/repository/obsolete_packs/14491a06534831c3c83658e356759a01.six", ".bzr/repository/obsolete_packs/14491a06534831c3c83658e356759a01.tix", ".bzr/repository/obsolete_packs/25281e7274abffc32e7a43da7f8d0461.iix", ".bzr/repository/obsolete_packs/25281e7274abffc32e7a43da7f8d0461.pack", ".bzr/repository/obsolete_packs/25281e7274abffc32e7a43da7f8d0461.rix", ".bzr/repository/obsolete_packs/25281e7274abffc32e7a43da7f8d0461.six", ".bzr/repository/obsolete_packs/25281e7274abffc32e7a43da7f8d0461.tix", ".bzr/repository/obsolete_packs/337318464912506e396a98e2846375ee.iix", ".bzr/repository/obsolete_packs/337318464912506e396a98e2846375ee.pack", ".bzr/repository/obsolete_packs/337318464912506e396a98e2846375ee.rix", ".bzr/repository/obsolete_packs/337318464912506e396a98e2846375ee.six", ".bzr/repository/obsolete_packs/337318464912506e396a98e2846375ee.tix", ".bzr/repository/obsolete_packs/4b641e21199b5b3983ead40baee59157.iix", ".bzr/repository/obsolete_packs/4b641e21199b5b3983ead40baee59157.pack", ".bzr/repository/obsolete_packs/4b641e21199b5b3983ead40baee59157.rix", ".bzr/repository/obsolete_packs/4b641e21199b5b3983ead40baee59157.six", ".bzr/repository/obsolete_packs/4b641e21199b5b3983ead40baee59157.tix", ".bzr/repository/obsolete_packs/69d1464bc492b242c2c80b98f1eaca16.iix", ".bzr/repository/obsolete_packs/69d1464bc492b242c2c80b98f1eaca16.pack", ".bzr/repository/obsolete_packs/69d1464bc492b242c2c80b98f1eaca16.rix", ".bzr/repository/obsolete_packs/69d1464bc492b242c2c80b98f1eaca16.six", ".bzr/repository/obsolete_packs/69d1464bc492b242c2c80b98f1eaca16.tix", ".bzr/repository/obsolete_packs/7e561e10b317a3561596c12162aa0b62.iix", ".bzr/repository/obsolete_packs/7e561e10b317a3561596c12162aa0b62.pack", ".bzr/repository/obsolete_packs/7e561e10b317a3561596c12162aa0b62.rix", ".bzr/repository/obsolete_packs/7e561e10b317a3561596c12162aa0b62.six", ".bzr/repository/obsolete_packs/7e561e10b317a3561596c12162aa0b62.tix", ".bzr/repository/obsolete_packs/873c887bbba83618f871b71b92dd2cab.iix", ".bzr/repository/obsolete_packs/873c887bbba83618f871b71b92dd2cab.pack", ".bzr/repository/obsolete_packs/873c887bbba83618f871b71b92dd2cab.rix", ".bzr/repository/obsolete_packs/873c887bbba83618f871b71b92dd2cab.six", ".bzr/repository/obsolete_packs/873c887bbba83618f871b71b92dd2cab.tix", ".bzr/repository/pack-names", ".bzr/repository/packs/151ac19fd622c8084eca354d80336510.pack", ".bzr/repository/packs/29647a57de6255f81ed838b5aaf89e54.pack", ".bzr/repository/packs/5901bb87fc326fc481c268c7093087d6.pack", ".bzr/repository/packs/60afa9e7714310e7df9780bb1be8904f.pack", ".bzr/repository/packs/6f8954ed6fa3fc3771613f06347014f4.pack", ".bzr/repository/packs/764c4380dd16055c6dc1d6ed22ce4c16.pack", ".bzr/repository/packs/929fece420d91bbac5a96347aee1b3d6.pack", ".bzr/repository/packs/bba034b51d01b176f36c84a60d9f947f.pack", ".bzr/repository/packs/de1db3c0ce54620ccf022905ad589c90.pack", ".bzr/repository/packs/fac52d20970efba4203df3cef78176a2.pack", ".bzr/repository/packs/fd968e63b0439f3eccfaf7ce7d421d0c.pack", ".bzrignore", "History.txt", "LICENSE.txt", "README.txt", "Rakefile", "bin/surpass", "examples/big-16mb.rb", "examples/big-random-strings.rb", "examples/blanks.rb", "examples/col_width.rb", "examples/col_width.xls", "examples/dates.rb", "examples/format.rb", "examples/hello-world.rb", "examples/image.rb", "examples/merged.rb", "examples/merged0.rb", "examples/merged1.rb", "examples/num_formats.rb", "examples/numbers.rb", "examples/numbers.xls", "examples/outline.rb", "examples/outline.xls", "examples/panes.rb", "examples/protection.rb", "examples/python.bmp", "examples/row_styles.rb", "examples/row_styles_empty.rb", "examples/set_cell_and_range_style.rb", "examples/wrapped-text.rb", "examples/wrapped-text.xls", "examples/write_arrays.rb", "examples/write_arrays.xls", "examples/ws_props.rb", "lib/surpass.rb", "lib/surpass/ExcelFormula.g", "lib/surpass/ExcelFormula.tokens", "lib/surpass/ExcelFormulaLexer.rb", "lib/surpass/ExcelFormulaParser.rb", "lib/surpass/biff_record.rb", "lib/surpass/bitmap.rb", "lib/surpass/cell.rb", "lib/surpass/chart.rb", "lib/surpass/column.rb", "lib/surpass/document.rb", "lib/surpass/excel_formula.rb", "lib/surpass/excel_magic.rb", "lib/surpass/formatting.rb", "lib/surpass/row.rb", "lib/surpass/style.rb", "lib/surpass/tokens.txt", "lib/surpass/utilities.rb", "lib/surpass/workbook.rb", "lib/surpass/worksheet.rb", "out.bin", "spec/biff_record_spec.rb", "spec/cell_spec.rb", "spec/data/random-strings.txt", "spec/document_spec.rb", "spec/excel_formula_spec.rb", "spec/formatting_spec.rb", "spec/output/cells-rk.xls", "spec/output/cells.xls", "spec/output/mini.xls", "spec/reference/P-0508-0000507647-3280-5298.xls", "spec/reference/all-cell-styles.bin", "spec/reference/all-number-formats.bin", "spec/reference/all-styles.bin", "spec/reference/mini.xls", "spec/row_spec.rb", "spec/spec_helper.rb", "spec/style_spec.rb", "spec/surpass_spec.rb", "spec/utilities_spec.rb", "spec/workbook_spec.rb", "spec/worksheet_spec.rb", "stats/cloc.txt", "stats/rcov.txt", "stats/specdoc.txt", "test/test_surpass.rb", "webby/.DS_Store", "webby/README.txt", "webby/Sitefile", "webby/content/css/pygments.txt", "webby/content/css/style.css", "webby/content/examples/.array.rb.swp", "webby/content/examples/autoformat.png", "webby/content/examples/autoformat.rb", "webby/content/examples/autoformat.xls", "webby/content/examples/borders.png", "webby/content/examples/borders.rb", "webby/content/examples/borders.xls", "webby/content/examples/colours.png", "webby/content/examples/colours.rb", "webby/content/examples/colours.xls", "webby/content/examples/data.png", "webby/content/examples/data.rb", "webby/content/examples/data.xls", "webby/content/examples/formatting.png", "webby/content/examples/formatting.rb", "webby/content/examples/formatting.xls", "webby/content/examples/hello-world.png", "webby/content/examples/hello-world.py", "webby/content/examples/hello-world.rb", "webby/content/examples/hello-world.xls", "webby/content/examples/number-format-string.png", "webby/content/examples/number-format-string.rb", "webby/content/examples/number-format-string.xls", "webby/content/examples/patterns.png", "webby/content/examples/patterns.rb", "webby/content/examples/patterns.xls", "webby/content/examples/show-greens.sh", "webby/content/examples/surpass-info.sh", "webby/content/img/Thumbs.db", "webby/content/img/bg_menu.gif", "webby/content/img/bg_t.gif", "webby/content/img/bullet.gif", "webby/content/img/logo.png", "webby/content/img/logo_.jpg", "webby/content/img/top_bg.gif", "webby/content/img/top_bg_.gif", "webby/content/index.txt", "webby/content/installation/index.txt", "webby/content/source/ExcelFormulaLexer.txt", "webby/content/source/ExcelFormulaParser.txt", "webby/content/source/biff_record.txt", "webby/content/source/bitmap.txt", "webby/content/source/cell.txt", "webby/content/source/chart.txt", "webby/content/source/column.txt", "webby/content/source/document.txt", "webby/content/source/excel_formula.txt", "webby/content/source/excel_magic.txt", "webby/content/source/formatting.txt", "webby/content/source/row.txt", "webby/content/source/style.txt", "webby/content/source/surpass.txt", "webby/content/source/utilities.txt", "webby/content/source/workbook.txt", "webby/content/source/worksheet.txt", "webby/content/surpass-manual.erb", "webby/layouts/book.txt", "webby/layouts/default.txt", "webby/layouts/two_column.txt", "webby/layouts/web.txt", "webby/output/.cairn", "webby/output/css/pygments.css", "webby/output/css/style.css", "webby/output/examples/autoformat.png", "webby/output/examples/autoformat.rb", "webby/output/examples/autoformat.xls", "webby/output/examples/borders.png", "webby/output/examples/borders.rb", "webby/output/examples/borders.xls", "webby/output/examples/colours.png", "webby/output/examples/colours.rb", "webby/output/examples/colours.xls", "webby/output/examples/data.png", "webby/output/examples/data.rb", "webby/output/examples/data.xls", "webby/output/examples/formatting.png", "webby/output/examples/formatting.rb", "webby/output/examples/formatting.xls", "webby/output/examples/hello-world.png", "webby/output/examples/hello-world.py", "webby/output/examples/hello-world.rb", "webby/output/examples/hello-world.xls", "webby/output/examples/number-format-string.png", "webby/output/examples/number-format-string.rb", "webby/output/examples/number-format-string.xls", "webby/output/examples/patterns.png", "webby/output/examples/patterns.rb", "webby/output/examples/patterns.xls", "webby/output/examples/show-greens.sh", "webby/output/examples/surpass-info.sh", "webby/output/img/Thumbs.db", "webby/output/img/bg_menu.gif", "webby/output/img/bg_t.gif", "webby/output/img/bullet.gif", "webby/output/img/logo.png", "webby/output/img/logo_.jpg", "webby/output/img/top_bg.gif", "webby/output/img/top_bg_.gif", "webby/output/index.html", "webby/output/installation/index.html", "webby/output/source/ExcelFormulaLexer.html", "webby/output/source/ExcelFormulaParser.html", "webby/output/source/biff_record.html", "webby/output/source/bitmap.html", "webby/output/source/cell.html", "webby/output/source/chart.html", "webby/output/source/column.html", "webby/output/source/document.html", "webby/output/source/excel_formula.html", "webby/output/source/excel_magic.html", "webby/output/source/formatting.html", "webby/output/source/row.html", "webby/output/source/style.html", "webby/output/source/surpass.html", "webby/output/source/utilities.html", "webby/output/source/workbook.html", "webby/output/source/worksheet.html", "webby/output/surpass-manual-0-0-5.pdf", "webby/output/surpass-manual.aux", "webby/output/surpass-manual.log", "webby/output/surpass-manual.out", "webby/output/surpass-manual.tex", "webby/output/surpass-manual.toc", "webby/output/surpass-r65.tgz", "webby/rsync-exclude", "webby/tasks/latex.rake", "webby/tasks/screenshots.rb", "webby/templates/article.erb", "webby/templates/book.erb", "webby/templates/page.erb"]
|
20
|
+
s.homepage = %q{http://surpass.rubyforge.org}
|
21
|
+
s.rdoc_options = ["--main", "README.txt"]
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
s.rubyforge_project = %q{surpass}
|
24
|
+
s.rubygems_version = %q{1.3.5}
|
25
|
+
s.summary = %q{Surpass is writing (and eventually reading) excel workbooks in pure Ruby}
|
26
|
+
s.test_files = ["test/test_surpass.rb"]
|
27
|
+
|
28
|
+
if s.respond_to? :specification_version then
|
29
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
30
|
+
s.specification_version = 3
|
31
|
+
|
32
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
33
|
+
s.add_development_dependency(%q<bones>, [">= 2.5.1"])
|
34
|
+
else
|
35
|
+
s.add_dependency(%q<bones>, [">= 2.5.1"])
|
36
|
+
end
|
37
|
+
else
|
38
|
+
s.add_dependency(%q<bones>, [">= 2.5.1"])
|
39
|
+
end
|
40
|
+
end
|
data/tasks/setup.rb
CHANGED
@@ -147,7 +147,7 @@ RCOV = "#{RUBY} -S rcov"
|
|
147
147
|
RDOC = "#{RUBY} -S rdoc"
|
148
148
|
GEM = "#{RUBY} -S gem"
|
149
149
|
|
150
|
-
%w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
|
150
|
+
%w(rcov spec/rake/spectask rubyforge bones facets/ansicode zentest).each do |lib|
|
151
151
|
begin
|
152
152
|
require lib
|
153
153
|
Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}
|
data/tasks/zentest.rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
if HAVE_ZENTEST
|
2
|
+
|
3
|
+
# --------------------------------------------------------------------------
|
4
|
+
if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
|
5
|
+
require 'autotest'
|
6
|
+
|
7
|
+
namespace :test do
|
8
|
+
task :autotest do
|
9
|
+
Autotest.run
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Run the autotest loop"
|
14
|
+
task :autotest => 'test:autotest'
|
15
|
+
|
16
|
+
end # if test
|
17
|
+
|
18
|
+
# --------------------------------------------------------------------------
|
19
|
+
if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
|
20
|
+
require 'autotest/rspec'
|
21
|
+
|
22
|
+
namespace :spec do
|
23
|
+
task :autotest do
|
24
|
+
load '.autotest' if test(?f, '.autotest')
|
25
|
+
Autotest::Rspec.run
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
desc "Run the autotest loop"
|
30
|
+
task :autotest => 'spec:autotest'
|
31
|
+
|
32
|
+
end # if rspec
|
33
|
+
|
34
|
+
end # if HAVE_ZENTEST
|
35
|
+
|
36
|
+
# EOF
|
data/webby/README.txt
ADDED
data/webby/Sitefile
ADDED
@@ -0,0 +1,43 @@
|
|
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
|
@@ -0,0 +1,279 @@
|
|
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
|
@@ -0,0 +1,32 @@
|
|
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
|
@@ -0,0 +1,15 @@
|
|
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
|
@@ -0,0 +1,23 @@
|
|
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
|
Binary file
|
Binary file
|
@@ -0,0 +1,78 @@
|
|
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
|
Binary file
|
Binary file
|