caxlsx 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +112 -30
- data/README.md +73 -180
- data/examples/colored_links.rb +38 -52
- data/examples/example.rb +16 -1
- data/lib/axlsx.rb +0 -2
- data/lib/axlsx/drawing/bar_chart.rb +3 -3
- data/lib/axlsx/drawing/bar_series.rb +3 -5
- data/lib/axlsx/drawing/d_lbls.rb +1 -1
- data/lib/axlsx/drawing/series_title.rb +3 -1
- data/lib/axlsx/drawing/title.rb +3 -2
- data/lib/axlsx/package.rb +3 -11
- data/lib/axlsx/stylesheet/font.rb +10 -2
- data/lib/axlsx/util/validators.rb +1 -1
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/workbook.rb +0 -9
- data/lib/axlsx/workbook/worksheet/cell.rb +23 -2
- data/lib/axlsx/workbook/worksheet/col.rb +8 -4
- data/lib/axlsx/workbook/worksheet/rich_text_run.rb +1 -1
- data/lib/axlsx/workbook/worksheet/row.rb +2 -1
- data/lib/axlsx/workbook/worksheet/worksheet.rb +11 -4
- data/test/drawing/tc_series_title.rb +21 -0
- data/test/drawing/tc_title.rb +16 -0
- data/test/stylesheet/tc_font.rb +14 -2
- data/test/stylesheet/tc_styles.rb +27 -1
- data/test/tc_axlsx.rb +6 -0
- data/test/workbook/worksheet/tc_cell.rb +30 -2
- data/test/workbook/worksheet/tc_col.rb +16 -1
- data/test/workbook/worksheet/tc_rich_text_run.rb +3 -2
- data/test/workbook/worksheet/tc_row.rb +17 -0
- data/test/workbook/worksheet/tc_worksheet.rb +11 -0
- metadata +95 -95
- data/lib/axlsx/util/parser.rb +0 -44
data/lib/axlsx/util/parser.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
module Axlsx
|
3
|
-
# The Parser module mixes in a number of methods to help in generating a model from xml
|
4
|
-
# This module is not included in the axlsx library at this time. It is for future development only,
|
5
|
-
module Parser
|
6
|
-
|
7
|
-
# The xml to be parsed
|
8
|
-
attr_accessor :parser_xml
|
9
|
-
|
10
|
-
# parse and assign string attribute
|
11
|
-
def parse_string attr_name, xpath
|
12
|
-
send("#{attr_name}=", parse_value(xpath))
|
13
|
-
end
|
14
|
-
|
15
|
-
# parse convert and assign node text to symbol
|
16
|
-
def parse_symbol attr_name, xpath
|
17
|
-
v = parse_value xpath
|
18
|
-
v = v.to_sym unless v.nil?
|
19
|
-
send("#{attr_name}=", v)
|
20
|
-
end
|
21
|
-
|
22
|
-
# parse, convert and assign note text to integer
|
23
|
-
def parse_integer attr_name, xpath
|
24
|
-
v = parse_value xpath
|
25
|
-
v = v.to_i if v.respond_to?(:to_i)
|
26
|
-
send("#{attr_name}=", v)
|
27
|
-
end
|
28
|
-
|
29
|
-
# parse, convert and assign node text to float
|
30
|
-
def parse_float attr_name, xpath
|
31
|
-
v = parse_value xpath
|
32
|
-
v = v.to_f if v.respond_to?(:to_f)
|
33
|
-
send("#{attr_name}=", v)
|
34
|
-
end
|
35
|
-
|
36
|
-
# return node text based on xpath
|
37
|
-
def parse_value xpath
|
38
|
-
node = parser_xml.xpath(xpath)
|
39
|
-
return nil if node.empty?
|
40
|
-
node.text.strip
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|