surpass 0.0.9 → 0.1.0

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.
@@ -9,6 +9,7 @@ class Formula
9
9
  def initialize(formula_string)
10
10
  raise "formulas not available" unless FORMULAS_AVAILABLE
11
11
  @lexer = ExcelFormula::Lexer.new(formula_string)
12
+ # puts @lexer.inspect
12
13
  @parser = ExcelFormula::Parser.new(@lexer)
13
14
  begin
14
15
  @parser.formula
@@ -54,6 +54,11 @@ class Row
54
54
  pix = (points*83.0/50.0 + 2.0/5.0).round
55
55
  @height_in_pixels = pix if (pix > @height_in_pixels)
56
56
  end
57
+
58
+ def set_height(height)
59
+ @height = height * 20 #This seems to correspond to row height in excel.
60
+ @height_mismatch = 1
61
+ end
57
62
 
58
63
  def adjust_boundary_column_indexes(*args)
59
64
  args.each do |a|
@@ -128,9 +133,12 @@ class Row
128
133
  end
129
134
 
130
135
  style_index = @parent_wb.styles.add(style)
136
+
137
+ raise "trying to write to cell #{self.index}, #{col} - already exists!" if cell(col)
131
138
 
132
139
  adjust_height(style)
133
140
  adjust_boundary_column_indexes(col)
141
+
134
142
  case label
135
143
  when TrueClass, FalseClass
136
144
  @cells << BooleanCell.new(self, col, style_index, label)
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
+ - 1
7
8
  - 0
8
- - 9
9
- version: 0.0.9
9
+ version: 0.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ana Nelson
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-03 00:00:00 +01:00
17
+ date: 2010-06-13 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,8 +27,8 @@ dependencies:
27
27
  segments:
28
28
  - 3
29
29
  - 4
30
- - 1
31
- version: 3.4.1
30
+ - 3
31
+ version: 3.4.3
32
32
  type: :development
33
33
  version_requirements: *id001
34
34
  description: |-
@@ -51,15 +51,12 @@ extra_rdoc_files:
51
51
  - lib/surpass/ExcelFormula.tokens
52
52
  - lib/surpass/tokens.txt
53
53
  files:
54
+ - .bnsignore
54
55
  - History.txt
55
56
  - LICENSE.txt
56
57
  - README.txt
57
58
  - Rakefile
58
59
  - bin/surpass
59
- - debug-examples/formula-cell.bin
60
- - debug-examples/formula-cell.rb
61
- - debug-examples/formula-record.bin
62
- - debug-examples/formula-record.rb
63
60
  - lib/surpass.rb
64
61
  - lib/surpass/ExcelFormula.g
65
62
  - lib/surpass/ExcelFormula.tokens
@@ -1,14 +0,0 @@
1
- require "lib/surpass"
2
-
3
- class Parent
4
- def index
5
- 0
6
- end
7
- end
8
-
9
- cell = FormulaCell.new(Parent.new, 0, 0, ExcelFormula.new("1"))
10
-
11
- File.open("formula-cell.bin", "w") do |f|
12
- f.write cell.to_biff
13
- end
14
-
@@ -1,15 +0,0 @@
1
- require "lib/surpass"
2
-
3
- class Parent
4
- def index
5
- 0
6
- end
7
- end
8
-
9
- rpn = ExcelFormula.new("1").to_biff
10
- record = FormulaRecord.new(0, 0, 0, rpn)
11
-
12
- File.open("formula-record.bin", "w") do |f|
13
- f.write record.to_biff
14
- end
15
-