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
@@ -0,0 +1,14 @@
|
|
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
|
Binary file
|
@@ -0,0 +1,26 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
surpass -c | grep green
|
@@ -0,0 +1 @@
|
|
1
|
+
surpass -h
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
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" />
|
@@ -0,0 +1,24 @@
|
|
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.
|
@@ -0,0 +1,198 @@
|
|
1
|
+
---
|
2
|
+
title: Surpass Manual
|
3
|
+
author: Ana Nelson
|
4
|
+
created_at: 2009-01-30 13:08:32.468894 +00:00
|
5
|
+
layout: book
|
6
|
+
filter:
|
7
|
+
- erb
|
8
|
+
---
|
9
|
+
To compile this documentation requires \LaTeX and the gems Gorgyrella and Webby.
|
10
|
+
|
11
|
+
This documentation refers to Surpass version <%= Surpass::VERSION %>.
|
12
|
+
|
13
|
+
\chapter{Installation and Hello World} % (fold)
|
14
|
+
\label{cha:installation_and_hello_world}
|
15
|
+
|
16
|
+
\section{Dependencies} % (fold)
|
17
|
+
\label{sec:dependencies}
|
18
|
+
|
19
|
+
Surpass only needs basic Ruby. It has been tested using Ruby 1.8.6 and JRuby 1.1.5.
|
20
|
+
|
21
|
+
For development, you will want to have access to something that can open Microsoft Excel files. This could be Microsoft Excel, Open Office, Google Docs or even a gmail account.
|
22
|
+
|
23
|
+
% section dependencies (end)
|
24
|
+
|
25
|
+
\section{Gem Installation}
|
26
|
+
|
27
|
+
\begin{verbatim}
|
28
|
+
sudo gem install surpass
|
29
|
+
\end{verbatim}
|
30
|
+
|
31
|
+
\section{Source Installation}
|
32
|
+
|
33
|
+
\begin{verbatim}
|
34
|
+
bzr branch http://ananelson.com/code/surpass
|
35
|
+
cd surpass
|
36
|
+
sudo rake gem:install
|
37
|
+
\end{verbatim}
|
38
|
+
|
39
|
+
\section{Hello World}
|
40
|
+
|
41
|
+
Let's do a minimal "Hello World" script. We'll need to take care of any imports, initialize a Workbook object, create a Worksheet within the workbook, then write some text. Here's how.
|
42
|
+
|
43
|
+
\subsection{Surpass}
|
44
|
+
|
45
|
+
<%= gorgl("content/examples/hello-world.rb")%>
|
46
|
+
|
47
|
+
\subsection{Result}
|
48
|
+
|
49
|
+
And, here's how it looks.
|
50
|
+
|
51
|
+
\includegraphics[width=15cm]{examples/hello-world.png}
|
52
|
+
|
53
|
+
% chapter installation_and_hello_world (end)
|
54
|
+
|
55
|
+
\chapter{Writing Data} % (fold)
|
56
|
+
\label{cha:writing_data}
|
57
|
+
|
58
|
+
\section{write} % (fold)
|
59
|
+
\label{sec:write}
|
60
|
+
|
61
|
+
The basic method for writing data to cells is the worksheet's write method.
|
62
|
+
|
63
|
+
<%= gorgl("../lib/surpass/worksheet.rb", "write-method")%>
|
64
|
+
|
65
|
+
There are two required arguments, the row and column. These are zero-based indexes for the row and column. To write to the first cell in the spreadsheet, you would pass 0, 0. The next argument is the label, this is the value you want written in the cell. This defaults to an empty string (for no particular reason). You can write nil, a String, a Boolean, a Numeric or a Date format. If you pass an object belonging to an unsupported class, you will get an error message, and in this case you should call some method on your object which will return a String or whatever the appropriate label is. The fourth argument is for style, which should be either nil, true, a hash or an instance of the StyleFormat class. See the chapter on Formatting for more information. The style parameter defaults to nil, which means that the default Excel format will be applied.
|
66
|
+
|
67
|
+
\section{Writing Arrays of Data} % (fold)
|
68
|
+
\label{sec:writing_arrays_of_data}
|
69
|
+
|
70
|
+
Frequently, you may want to write more than one value at a time, and so Surpass has convenience methods which handle arrays for you. In the background, these are just looping over the array and calling write() for each value you pass. There's no magic here and, for now at least, no clever optimization. The available methods are write\_array\_to\_row, write\_array\_to\_column, and write\_arrays. The write\_arrays method expects an array of arrays, the first two expect a single array.
|
71
|
+
|
72
|
+
<%= gorgl("../lib/surpass/worksheet.rb", "write-arrays") %>
|
73
|
+
|
74
|
+
|
75
|
+
% section writing_arrays_of_data (end)
|
76
|
+
|
77
|
+
% section write (end)
|
78
|
+
|
79
|
+
\section{Autoformatting} % (fold)
|
80
|
+
\label{sec:autoformatting}
|
81
|
+
|
82
|
+
Autoformats are number formats which are automatically applied to Dates, Floats and similar classes. To have autoformats applied, then pass true as the style parameter to the write function.
|
83
|
+
|
84
|
+
Here is the relevant code from row.rb:
|
85
|
+
<%= gorgl("../lib/surpass/row.rb", "autoformats") %>
|
86
|
+
|
87
|
+
And here are the default formats being defined in style.rb:
|
88
|
+
<%= gorgl("../lib/surpass/style.rb", "autoformats") %>
|
89
|
+
|
90
|
+
If you use any of the array-writing methods, then autoformatting will be applied by default. To override this behaviour you can pass your own StyleFormat or nil to use the generic default format.
|
91
|
+
|
92
|
+
<%= gorgl("content/examples/autoformat.rb") %>
|
93
|
+
|
94
|
+
\includegraphics[width=15cm]{examples/autoformat.png}
|
95
|
+
|
96
|
+
% section autoformatting (end)
|
97
|
+
|
98
|
+
% chapter writing_data (end)
|
99
|
+
|
100
|
+
|
101
|
+
\chapter{Formatting} % (fold)
|
102
|
+
\label{cha:formatting}
|
103
|
+
|
104
|
+
\section{Reference}
|
105
|
+
|
106
|
+
There is a command line tool included with Surpass which provides some useful reference data:
|
107
|
+
|
108
|
+
<%= gorgl("content/examples/surpass-info.sh") %>
|
109
|
+
\begin{verbatim}
|
110
|
+
<%= IO.popen("cd ..; bash webby/content/examples/surpass-info.sh").read %>
|
111
|
+
\end{verbatim}
|
112
|
+
|
113
|
+
And since you are running this on the command line, you can save or pipe the output to other commands:
|
114
|
+
|
115
|
+
<%= gorgl("content/examples/show-greens.sh") %>
|
116
|
+
\begin{verbatim}
|
117
|
+
<%= IO.popen("cd ..; bash webby/content/examples/show-greens.sh").read %>
|
118
|
+
\end{verbatim}
|
119
|
+
|
120
|
+
\section{StyleFormat Class}
|
121
|
+
|
122
|
+
The StyleFormat class is a wrapper for the various types of formatting you can apply to a cell. StyleFormat has attributes:
|
123
|
+
|
124
|
+
\begin{itemize}
|
125
|
+
\item number\_format\_string
|
126
|
+
\item font
|
127
|
+
\item alignment
|
128
|
+
\item borders
|
129
|
+
\item pattern
|
130
|
+
\item protection
|
131
|
+
\end{itemize}
|
132
|
+
|
133
|
+
Each of these attributes (except for number\_format\_string) has a corresponding class, and you can look in lib/surpass/formatting.rb for the source.
|
134
|
+
|
135
|
+
There are two basic ways to set formatting options. You can pass a hash with formatting options when you initialize a new StyleFormat instance, or you can set individual attributes of the formatting classes. You can also combine both approaches, initializing with a hash and then modifying attributes.
|
136
|
+
|
137
|
+
\section{Number Format Strings} % (fold)
|
138
|
+
\label{sec:number_format_strings}
|
139
|
+
|
140
|
+
This attribute is a simple string, specifying the numeric/date format to be applied to the value stored in a cell.
|
141
|
+
|
142
|
+
\newpage
|
143
|
+
|
144
|
+
<%= gorgl("content/examples/number-format-string.rb") %>
|
145
|
+
\includegraphics[width=16cm]{examples/number-format-string.png}
|
146
|
+
|
147
|
+
% section number_format_strings (end)
|
148
|
+
|
149
|
+
|
150
|
+
\subsection{Specifying Colours}
|
151
|
+
|
152
|
+
Here is a list of available colours:
|
153
|
+
|
154
|
+
\begin{multicols}{3}
|
155
|
+
\begin{verbatim}
|
156
|
+
<%= Formatting::COLOURS.keys.sort.join("\n") %>
|
157
|
+
\end{verbatim}
|
158
|
+
\end{multicols}
|
159
|
+
|
160
|
+
\includegraphics[width=16cm]{examples/colours.png}
|
161
|
+
|
162
|
+
\subsection{Border Formats}
|
163
|
+
|
164
|
+
Here is a list of available border line types:
|
165
|
+
\begin{verbatim}
|
166
|
+
<%= Borders.line_type_directives.join("\n") %>
|
167
|
+
\end{verbatim}
|
168
|
+
\includegraphics[width=16cm]{examples/borders.png}
|
169
|
+
|
170
|
+
\subsection{Fill Patterns}
|
171
|
+
|
172
|
+
Here is a list of available fill patterns:
|
173
|
+
\begin{verbatim}
|
174
|
+
<%= Pattern.fill_directives.join("\n") %>
|
175
|
+
\end{verbatim}
|
176
|
+
\includegraphics[width=16cm]{examples/patterns.png}
|
177
|
+
|
178
|
+
\subsection{Surpass}
|
179
|
+
<%= gorgl("content/examples/formatting.rb")%>
|
180
|
+
|
181
|
+
And, here's how it looks.
|
182
|
+
|
183
|
+
\includegraphics[width=16cm]{examples/formatting.png}
|
184
|
+
|
185
|
+
% chapter formatting (end)
|
186
|
+
|
187
|
+
\chapter{Saving} % (fold)
|
188
|
+
\label{cha:saving}
|
189
|
+
|
190
|
+
Typically, you will call the workbook's save() method to write that workbook to a file. You can pass the filename as an argument to save(), or as an argument to new() when you first instantiate a workbook object.
|
191
|
+
|
192
|
+
However, you can also call a workbook's data() method, which gives you direct access to a workbook's binary data. You can write this to a file manually, as in this example:
|
193
|
+
|
194
|
+
<%= gorgl("content/examples/data.rb") %>
|
195
|
+
|
196
|
+
Or, you could use this data as an argument to Rails' send\_data method.
|
197
|
+
|
198
|
+
% chapter saving (end)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
extension: tex
|
3
|
+
filter: erb
|
4
|
+
---
|
5
|
+
\documentclass[a4paper]{book}
|
6
|
+
\usepackage{fullpage}
|
7
|
+
\usepackage{fancyvrb}
|
8
|
+
\usepackage{color}
|
9
|
+
\usepackage[ascii]{inputenc}
|
10
|
+
\usepackage{hyperref}
|
11
|
+
\usepackage[pdftex]{graphicx}
|
12
|
+
\usepackage{wrapfig}
|
13
|
+
\usepackage{multicol}
|
14
|
+
|
15
|
+
<%= pygments_latex_styles %>
|
16
|
+
|
17
|
+
|
18
|
+
\title{<%= @page.title %>}
|
19
|
+
\author{<%= @page.author %>}
|
20
|
+
|
21
|
+
\begin{document}
|
22
|
+
|
23
|
+
\maketitle
|
24
|
+
|
25
|
+
\tableofcontents
|
26
|
+
|
27
|
+
<%= @content %>
|
28
|
+
|
29
|
+
\end{document}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
extension: tex
|
3
|
+
filter: erb
|
4
|
+
---
|
5
|
+
\documentclass[a4paper]{article}
|
6
|
+
\usepackage{fullpage}
|
7
|
+
\usepackage{fancyvrb}
|
8
|
+
\usepackage{color}
|
9
|
+
\usepackage[ascii]{inputenc}
|
10
|
+
\usepackage{hyperref}
|
11
|
+
\usepackage[pdftex]{graphicx}
|
12
|
+
\usepackage{wrapfig}
|
13
|
+
\usepackage{multicol}
|
14
|
+
|
15
|
+
<%= pygments_latex_styles %>
|
16
|
+
|
17
|
+
|
18
|
+
\title{<%= @page.title %>}
|
19
|
+
\author{<%= @page.author %>}
|
20
|
+
|
21
|
+
\begin{document}
|
22
|
+
|
23
|
+
\maketitle
|
24
|
+
|
25
|
+
<%= @content %>
|
26
|
+
|
27
|
+
\end{document}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
extension: tex
|
3
|
+
filter: erb
|
4
|
+
---
|
5
|
+
\documentclass[a4paper, twocolumn]{article}
|
6
|
+
\usepackage{fullpage}
|
7
|
+
\usepackage{fancyvrb}
|
8
|
+
\usepackage{color}
|
9
|
+
\usepackage[ascii]{inputenc}
|
10
|
+
\usepackage{hyperref}
|
11
|
+
\usepackage[pdftex]{graphicx}
|
12
|
+
|
13
|
+
<%= pygments_latex_styles %>
|
14
|
+
|
15
|
+
|
16
|
+
\title{<%= @page.title %>}
|
17
|
+
\author{<%= @page.author %>}
|
18
|
+
|
19
|
+
\begin{document}
|
20
|
+
|
21
|
+
\maketitle
|
22
|
+
|
23
|
+
<%= @content %>
|
24
|
+
|
25
|
+
\end{document}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
extension: html
|
3
|
+
filter: erb
|
4
|
+
---
|
5
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
6
|
+
|
7
|
+
<!-- ========================================================== -->
|
8
|
+
<!-- Created by Devit Schizoper -->
|
9
|
+
<!-- Created HomePages http://LoadFoo.starzonewebhost.com -->
|
10
|
+
<!-- Created Day 01.12.2006 -->
|
11
|
+
<!-- ========================================================== -->
|
12
|
+
|
13
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
14
|
+
<head>
|
15
|
+
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
16
|
+
<meta name="author" content="LoadFoO" />
|
17
|
+
<meta name="description" content="Site description" />
|
18
|
+
<meta name="keywords" content="key, words" />
|
19
|
+
<title>Surpass :: <%= @page.title %></title>
|
20
|
+
<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
|
21
|
+
<link rel="stylesheet" href="/css/pygments.css" type="text/css" />
|
22
|
+
<link rel="shortcut icon" href="favicon.ico" />
|
23
|
+
</head>
|
24
|
+
|
25
|
+
<body>
|
26
|
+
<div id="wrap">
|
27
|
+
<div id="top">
|
28
|
+
<h2><a href="/" title="Back to main page">Surpass</a></h2>
|
29
|
+
<div id="menu">
|
30
|
+
<ul>
|
31
|
+
<% [
|
32
|
+
['/installation', "Installation"],
|
33
|
+
['/examples', "Examples"],
|
34
|
+
['/source', "Source"],
|
35
|
+
].each do |a, t| -%>
|
36
|
+
<li><a href="<%= a %>"><%= t %></a></li>
|
37
|
+
<% end -%>
|
38
|
+
</ul>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div id="content">
|
42
|
+
<div id="left">
|
43
|
+
<h2><%= @page.title %></h2>
|
44
|
+
<%= @content %>
|
45
|
+
</div>
|
46
|
+
<div id="right">
|
47
|
+
<ul id="nav">
|
48
|
+
<li><a href="<%= manual_filename %>">Download PDF Manual</a></li>
|
49
|
+
<li><a href="http://rubyforge.org/projects/surpass">Rubyforge Project Page</a></li>
|
50
|
+
<li><a href="<%= gzipped_source %>">Download Latest Source (tgz)</a></li>
|
51
|
+
</ul>
|
52
|
+
<div class="box">
|
53
|
+
<h2 style="margin-top:17px">Latest News</h2>
|
54
|
+
<ul>
|
55
|
+
<li>...</li>
|
56
|
+
</ul>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
<div id="clear"></div></div>
|
60
|
+
<div id="footer">
|
61
|
+
<p>Site template designed by <a href="http://loadfoo.org/" rel="external">LoadFoO</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="external">CSS</a> & <a href="http://validator.w3.org/check?uri=referer" rel="external">XHTML</a></p>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
</body>
|
66
|
+
</html>
|
data/webby/output/.cairn
ADDED
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
|
3
|
+
|
4
|
+
Blueprint CSS Framework 0.8
|
5
|
+
http://blueprintcss.org
|
6
|
+
|
7
|
+
* Copyright (c) 2007-Present. See LICENSE for more info.
|
8
|
+
* See README for instructions on how to use Blueprint.
|
9
|
+
* For credits and origins, see AUTHORS.
|
10
|
+
* This is a compressed file. See the sources in the 'src' directory.
|
11
|
+
|
12
|
+
----------------------------------------------------------------------- */
|
13
|
+
|
14
|
+
/* ie.css */
|
15
|
+
body {text-align:center;}
|
16
|
+
.container {text-align:left;}
|
17
|
+
* html .column, * html div.span-1, * html div.span-2, * html div.span-3, * html div.span-4, * html div.span-5, * html div.span-6, * html div.span-7, * html div.span-8, * html div.span-9, * html div.span-10, * html div.span-11, * html div.span-12, * html div.span-13, * html div.span-14, * html div.span-15, * html div.span-16, * html div.span-17, * html div.span-18, * html div.span-19, * html div.span-20, * html div.span-21, * html div.span-22, * html div.span-23, * html div.span-24 {overflow-x:hidden;}
|
18
|
+
* html legend {margin:-18px -8px 16px 0;padding:0;}
|
19
|
+
ol {margin-left:2em;}
|
20
|
+
sup {vertical-align:text-top;}
|
21
|
+
sub {vertical-align:text-bottom;}
|
22
|
+
html>body p code {*white-space:normal;}
|
23
|
+
hr {margin:-8px auto 11px;}
|
24
|
+
.clearfix, .container {display:inline-block;}
|
25
|
+
* html .clearfix, * html .container {height:1%;}
|
26
|
+
fieldset {padding-top:0;}
|
Binary file
|
Binary file
|
Binary file
|