axlsx 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +4 -0
- data/README.md +7 -4
- data/examples/example.rb +6 -4
- data/examples/example.rb~ +112 -0
- data/lib/schema/dc.xsd~ +118 -0
- data/lib/schema/dcterms.xsd~ +331 -0
- data/lib/schema/opc-coreProperties.xsd~ +50 -0
- metadata +43 -193
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -29
- data/axlsx.gemspec +0 -42
- data/doc/Axlsx.html +0 -2718
- data/doc/Axlsx/App.html +0 -2640
- data/doc/Axlsx/Axis.html +0 -1075
- data/doc/Axlsx/Bar3DChart.html +0 -1182
- data/doc/Axlsx/BarSeries.html +0 -711
- data/doc/Axlsx/Border.html +0 -779
- data/doc/Axlsx/BorderPr.html +0 -709
- data/doc/Axlsx/CatAxis.html +0 -769
- data/doc/Axlsx/CatAxisData.html +0 -397
- data/doc/Axlsx/Cell.html +0 -3187
- data/doc/Axlsx/CellAlignment.html +0 -1247
- data/doc/Axlsx/CellProtection.html +0 -565
- data/doc/Axlsx/CellStyle.html +0 -949
- data/doc/Axlsx/Chart.html +0 -1692
- data/doc/Axlsx/Color.html +0 -670
- data/doc/Axlsx/ContentType.html +0 -335
- data/doc/Axlsx/Core.html +0 -465
- data/doc/Axlsx/DataTypeValidator.html +0 -324
- data/doc/Axlsx/Default.html +0 -565
- data/doc/Axlsx/Drawing.html +0 -1264
- data/doc/Axlsx/Fill.html +0 -460
- data/doc/Axlsx/Font.html +0 -1554
- data/doc/Axlsx/GradientFill.html +0 -1026
- data/doc/Axlsx/GradientStop.html +0 -526
- data/doc/Axlsx/GraphicFrame.html +0 -642
- data/doc/Axlsx/Line3DChart.html +0 -1004
- data/doc/Axlsx/LineSeries.html +0 -605
- data/doc/Axlsx/Marker.html +0 -857
- data/doc/Axlsx/NumFmt.html +0 -562
- data/doc/Axlsx/OneCellAnchor.html +0 -982
- data/doc/Axlsx/Override.html +0 -552
- data/doc/Axlsx/Package.html +0 -825
- data/doc/Axlsx/Parser.html +0 -549
- data/doc/Axlsx/PatternFill.html +0 -681
- data/doc/Axlsx/Pic.html +0 -1701
- data/doc/Axlsx/PictureLocking.html +0 -1159
- data/doc/Axlsx/Pie3DChart.html +0 -489
- data/doc/Axlsx/PieSeries.html +0 -710
- data/doc/Axlsx/RegexValidator.html +0 -268
- data/doc/Axlsx/Relationship.html +0 -554
- data/doc/Axlsx/Relationships.html +0 -338
- data/doc/Axlsx/RestrictionValidator.html +0 -300
- data/doc/Axlsx/Row.html +0 -916
- data/doc/Axlsx/Scaling.html +0 -742
- data/doc/Axlsx/SerAxis.html +0 -641
- data/doc/Axlsx/Series.html +0 -813
- data/doc/Axlsx/SeriesTitle.html +0 -290
- data/doc/Axlsx/Styles.html +0 -1754
- data/doc/Axlsx/TableStyle.html +0 -705
- data/doc/Axlsx/TableStyleElement.html +0 -677
- data/doc/Axlsx/TableStyles.html +0 -594
- data/doc/Axlsx/Title.html +0 -543
- data/doc/Axlsx/TwoCellAnchor.html +0 -973
- data/doc/Axlsx/ValAxis.html +0 -538
- data/doc/Axlsx/ValAxisData.html +0 -321
- data/doc/Axlsx/View3D.html +0 -973
- data/doc/Axlsx/Workbook.html +0 -1630
- data/doc/Axlsx/Worksheet.html +0 -2682
- data/doc/Axlsx/Xf.html +0 -1780
- data/doc/_index.html +0 -649
- data/doc/class_list.html +0 -47
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -55
- data/doc/css/style.css +0 -322
- data/doc/file.LICENSE.html +0 -91
- data/doc/file.README.html +0 -338
- data/doc/file_list.html +0 -52
- data/doc/frames.html +0 -13
- data/doc/index.html +0 -338
- data/doc/js/app.js +0 -205
- data/doc/js/full_list.js +0 -167
- data/doc/js/jquery.js +0 -16
- data/doc/method_list.html +0 -3502
- data/doc/top-level-namespace.html +0 -103
- data/lib/axlsx.rb +0 -54
- data/lib/axlsx/content_type/content_type.rb +0 -23
- data/lib/axlsx/content_type/default.rb +0 -37
- data/lib/axlsx/content_type/override.rb +0 -37
- data/lib/axlsx/doc_props/app.rb +0 -178
- data/lib/axlsx/doc_props/core.rb +0 -34
- data/lib/axlsx/drawing/axis.rb +0 -90
- data/lib/axlsx/drawing/bar_3D_chart.rb +0 -128
- data/lib/axlsx/drawing/bar_series.rb +0 -64
- data/lib/axlsx/drawing/cat_axis.rb +0 -63
- data/lib/axlsx/drawing/cat_axis_data.rb +0 -35
- data/lib/axlsx/drawing/chart.rb +0 -179
- data/lib/axlsx/drawing/drawing.rb +0 -137
- data/lib/axlsx/drawing/graphic_frame.rb +0 -52
- data/lib/axlsx/drawing/line_3D_chart.rb +0 -106
- data/lib/axlsx/drawing/line_series.rb +0 -46
- data/lib/axlsx/drawing/marker.rb +0 -61
- data/lib/axlsx/drawing/one_cell_anchor.rb +0 -89
- data/lib/axlsx/drawing/pic.rb +0 -153
- data/lib/axlsx/drawing/picture_locking.rb +0 -72
- data/lib/axlsx/drawing/pie_3D_chart.rb +0 -41
- data/lib/axlsx/drawing/pie_series.rb +0 -56
- data/lib/axlsx/drawing/scaling.rb +0 -59
- data/lib/axlsx/drawing/ser_axis.rb +0 -45
- data/lib/axlsx/drawing/series.rb +0 -71
- data/lib/axlsx/drawing/series_title.rb +0 -22
- data/lib/axlsx/drawing/title.rb +0 -61
- data/lib/axlsx/drawing/two_cell_anchor.rb +0 -76
- data/lib/axlsx/drawing/val_axis.rb +0 -34
- data/lib/axlsx/drawing/val_axis_data.rb +0 -28
- data/lib/axlsx/drawing/view_3D.rb +0 -85
- data/lib/axlsx/package.rb +0 -214
- data/lib/axlsx/rels/relationship.rb +0 -44
- data/lib/axlsx/rels/relationships.rb +0 -25
- data/lib/axlsx/stylesheet/border.rb +0 -57
- data/lib/axlsx/stylesheet/border_pr.rb +0 -68
- data/lib/axlsx/stylesheet/cell_alignment.rb +0 -105
- data/lib/axlsx/stylesheet/cell_protection.rb +0 -36
- data/lib/axlsx/stylesheet/cell_style.rb +0 -65
- data/lib/axlsx/stylesheet/color.rb +0 -69
- data/lib/axlsx/stylesheet/fill.rb +0 -32
- data/lib/axlsx/stylesheet/font.rb +0 -139
- data/lib/axlsx/stylesheet/gradient_fill.rb +0 -76
- data/lib/axlsx/stylesheet/gradient_stop.rb +0 -33
- data/lib/axlsx/stylesheet/num_fmt.rb +0 -63
- data/lib/axlsx/stylesheet/pattern_fill.rb +0 -66
- data/lib/axlsx/stylesheet/styles.rb +0 -298
- data/lib/axlsx/stylesheet/table_style.rb +0 -47
- data/lib/axlsx/stylesheet/table_style_element.rb +0 -71
- data/lib/axlsx/stylesheet/table_styles.rb +0 -39
- data/lib/axlsx/stylesheet/xf.rb +0 -138
- data/lib/axlsx/util/constants.rb +0 -216
- data/lib/axlsx/util/parser.rb +0 -43
- data/lib/axlsx/util/simple_typed_list.rb +0 -160
- data/lib/axlsx/util/validators.rb +0 -132
- data/lib/axlsx/version.rb +0 -4
- data/lib/axlsx/workbook/workbook.rb +0 -160
- data/lib/axlsx/workbook/worksheet/cell.rb +0 -340
- data/lib/axlsx/workbook/worksheet/row.rb +0 -107
- data/lib/axlsx/workbook/worksheet/worksheet.rb +0 -278
@@ -1,103 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
7
|
-
Top Level Namespace
|
8
|
-
|
9
|
-
— AXLSX
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
relpath = '';
|
19
|
-
if (relpath != '') relpath += '/';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
-
|
26
|
-
|
27
|
-
</head>
|
28
|
-
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
|
-
<div id="header">
|
34
|
-
<div id="menu">
|
35
|
-
|
36
|
-
<a href="_index.html">Index</a> »
|
37
|
-
|
38
|
-
|
39
|
-
<span class="title">Top Level Namespace</span>
|
40
|
-
|
41
|
-
|
42
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
-
</div>
|
44
|
-
|
45
|
-
<div id="search">
|
46
|
-
|
47
|
-
<a id="class_list_link" href="#">Class List</a>
|
48
|
-
|
49
|
-
<a id="method_list_link" href="#">Method List</a>
|
50
|
-
|
51
|
-
<a id="file_list_link" href="#">File List</a>
|
52
|
-
|
53
|
-
</div>
|
54
|
-
<div class="clear"></div>
|
55
|
-
</div>
|
56
|
-
|
57
|
-
<iframe id="search_frame"></iframe>
|
58
|
-
|
59
|
-
<div id="content"><h1>Top Level Namespace
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
</h1>
|
64
|
-
|
65
|
-
<dl class="box">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
</dl>
|
75
|
-
<div class="clear"></div>
|
76
|
-
|
77
|
-
<h2>Defined Under Namespace</h2>
|
78
|
-
<p class="children">
|
79
|
-
|
80
|
-
|
81
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Axlsx.html" title="Axlsx (module)">Axlsx</a></span>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
</p>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
<div id="footer">
|
97
|
-
Generated on Mon Dec 5 14:21:23 2011 by
|
98
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
99
|
-
0.7.3 (ruby-1.8.7).
|
100
|
-
</div>
|
101
|
-
|
102
|
-
</body>
|
103
|
-
</html>
|
data/lib/axlsx.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
Encoding::default_internal = 'UTF-8' unless RUBY_VERSION < '1.9'
|
2
|
-
Encoding::default_external = 'UTF-8' unless RUBY_VERSION < '1.9'
|
3
|
-
|
4
|
-
require 'axlsx/util/simple_typed_list.rb'
|
5
|
-
require 'axlsx/util/constants.rb'
|
6
|
-
require 'axlsx/util/validators.rb'
|
7
|
-
|
8
|
-
# to be included with parsable intitites.
|
9
|
-
#require 'axlsx/util/parser.rb'
|
10
|
-
|
11
|
-
require 'axlsx/stylesheet/styles.rb'
|
12
|
-
|
13
|
-
require 'axlsx/doc_props/app.rb'
|
14
|
-
require 'axlsx/doc_props/core.rb'
|
15
|
-
require 'axlsx/content_type/content_type.rb'
|
16
|
-
require 'axlsx/rels/relationships.rb'
|
17
|
-
|
18
|
-
require 'axlsx/drawing/drawing.rb'
|
19
|
-
require 'axlsx/workbook/workbook.rb'
|
20
|
-
require 'axlsx/package.rb'
|
21
|
-
|
22
|
-
#required gems
|
23
|
-
require 'nokogiri'
|
24
|
-
require 'active_support/core_ext/object/instance_variables'
|
25
|
-
require 'active_support/inflector'
|
26
|
-
require 'RMagick'
|
27
|
-
require 'zip/zip'
|
28
|
-
|
29
|
-
#core dependencies
|
30
|
-
require 'bigdecimal'
|
31
|
-
require 'time'
|
32
|
-
|
33
|
-
|
34
|
-
# xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
|
35
|
-
module Axlsx
|
36
|
-
# determines the cell range for the items provided
|
37
|
-
def self.cell_range(items)
|
38
|
-
return "" unless items.first.is_a? Cell
|
39
|
-
ref = "#{items.first.row.worksheet.name}!" +
|
40
|
-
"#{items.first.r_abs}"
|
41
|
-
ref += ":#{items.last.r_abs}" if items.size > 1
|
42
|
-
ref
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.name_to_indices(name)
|
46
|
-
raise ArgumentError, 'invalid cell name' unless name.size > 1
|
47
|
-
v = name[/[A-Z]+/].reverse.chars.reduce({:base=>1, :i=>0}) do |v, c|
|
48
|
-
v[:i] += ((c.bytes.first - 65) + v[:base]); v[:base] *= 26; v
|
49
|
-
end
|
50
|
-
|
51
|
-
[v[:i]-1, ((name[/[1-9]+/]).to_i)-1]
|
52
|
-
|
53
|
-
end
|
54
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Axlsx
|
2
|
-
require 'axlsx/content_type/default.rb'
|
3
|
-
require 'axlsx/content_type/override.rb'
|
4
|
-
|
5
|
-
# ContentTypes used in the package. This is automatcially managed by the package package.
|
6
|
-
class ContentType < SimpleTypedList
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
super [Override, Default]
|
10
|
-
end
|
11
|
-
|
12
|
-
# Generates the xml document for [Content_Types].xml
|
13
|
-
# @return [String] The document as a string.
|
14
|
-
def to_xml()
|
15
|
-
builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
|
16
|
-
xml.Types(:xmlns => Axlsx::XML_NS_T) {
|
17
|
-
each { |type| type.to_xml(xml) }
|
18
|
-
}
|
19
|
-
end
|
20
|
-
builder.to_xml
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module Axlsx
|
2
|
-
# An default content part. These parts are automatically created by for you based on the content of your package.
|
3
|
-
class Default
|
4
|
-
|
5
|
-
# The extension of the content type.
|
6
|
-
# @return [String]
|
7
|
-
attr_reader :Extension
|
8
|
-
|
9
|
-
# The type of content.
|
10
|
-
# @return [String]
|
11
|
-
attr_reader :ContentType
|
12
|
-
|
13
|
-
#Creates a new Default object
|
14
|
-
# @option options [String] Extension
|
15
|
-
# @option options [String] ContentType
|
16
|
-
# @raise [ArgumentError] An argument error is raised if both Extension and ContentType are not specified.
|
17
|
-
def initialize(options={})
|
18
|
-
raise ArgumentError, "Extension and ContentType are required" unless options[:Extension] && options[:ContentType]
|
19
|
-
options.each do |o|
|
20
|
-
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
|
21
|
-
end
|
22
|
-
end
|
23
|
-
# Sets the file extension for this content type.
|
24
|
-
def Extension=(v) Axlsx::validate_string v; @Extension = v end
|
25
|
-
|
26
|
-
# Sets the content type
|
27
|
-
# @see Axlsx#validate_content_type
|
28
|
-
def ContentType=(v) Axlsx::validate_content_type v; @ContentType = v end
|
29
|
-
|
30
|
-
# Serializes the object to xml
|
31
|
-
# @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
|
32
|
-
# @return [String]
|
33
|
-
def to_xml(xml)
|
34
|
-
xml.Default(self.instance_values)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module Axlsx
|
2
|
-
# An override content part. These parts are automatically created by for you based on the content of your package.
|
3
|
-
class Override
|
4
|
-
|
5
|
-
# The type of content.
|
6
|
-
# @return [String]
|
7
|
-
attr_reader :ContentType
|
8
|
-
|
9
|
-
# The name and location of the part.
|
10
|
-
# @return [String]
|
11
|
-
attr_reader :PartName
|
12
|
-
|
13
|
-
#Creates a new Override object
|
14
|
-
# @option options [String] PartName
|
15
|
-
# @option options [String] ContentType
|
16
|
-
# @raise [ArgumentError] An argument error is raised if both PartName and ContentType are not specified.
|
17
|
-
def initialize(options={})
|
18
|
-
raise ArgumentError, "PartName and ContentType are required" unless options[:PartName] && options[:ContentType]
|
19
|
-
options.each do |o|
|
20
|
-
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# The name and location of the part.
|
25
|
-
def PartName=(v) Axlsx::validate_string v; @PartName = v end
|
26
|
-
|
27
|
-
# The content type.
|
28
|
-
# @see Axlsx#validate_content_type
|
29
|
-
def ContentType=(v) Axlsx::validate_content_type v; @ContentType = v end
|
30
|
-
|
31
|
-
# Serializes the Override object to xml
|
32
|
-
# @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
|
33
|
-
def to_xml(xml)
|
34
|
-
xml.Override(self.instance_values)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/axlsx/doc_props/app.rb
DELETED
@@ -1,178 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
module Axlsx
|
3
|
-
# App represents the app.xml document. The attributes for this object are primarily managed by the application the end user uses to edit the document. None of the attributes are required to serialize a valid xlsx object.
|
4
|
-
# @see shared-documentPropertiesExtended.xsd
|
5
|
-
# @note Support is not implemented for the following complex types:
|
6
|
-
#
|
7
|
-
# HeadingPairs (VectorVariant),
|
8
|
-
# TitlesOfParts (VectorLpstr),
|
9
|
-
# HLinks (VectorVariant),
|
10
|
-
# DigSig (DigSigBlob)
|
11
|
-
class App
|
12
|
-
|
13
|
-
# @return [String] The name of the document template.
|
14
|
-
attr_reader :Template
|
15
|
-
|
16
|
-
# @return [String] The name of the manager for the document.
|
17
|
-
attr_reader :Manager
|
18
|
-
|
19
|
-
# @return [String] The name of the company generating the document.
|
20
|
-
attr_reader :Company
|
21
|
-
|
22
|
-
# @return [Integer] The number of pages in the document.
|
23
|
-
attr_reader :Pages
|
24
|
-
|
25
|
-
# @return [Integer] The number of words in the document.
|
26
|
-
attr_reader :Words
|
27
|
-
|
28
|
-
# @return [Integer] The number of characters in the document.
|
29
|
-
attr_reader :Characters
|
30
|
-
|
31
|
-
# @return [String] The intended format of the presentation.
|
32
|
-
attr_reader :PresentationFormat
|
33
|
-
|
34
|
-
# @return [Integer] The number of lines in the document.
|
35
|
-
attr_reader :Lines
|
36
|
-
|
37
|
-
# @return [Integer] The number of paragraphs in the document
|
38
|
-
attr_reader :Paragraphs
|
39
|
-
|
40
|
-
# @return [Intger] The number of slides in the document.
|
41
|
-
attr_reader :Slides
|
42
|
-
|
43
|
-
# @return [Integer] The number of slides that have notes.
|
44
|
-
attr_reader :Notes
|
45
|
-
|
46
|
-
# @return [Integer] The total amount of time spent editing.
|
47
|
-
attr_reader :TotalTime
|
48
|
-
|
49
|
-
# @return [Integer] The number of hidden slides.
|
50
|
-
attr_reader :HiddenSlides
|
51
|
-
|
52
|
-
# @return [Integer] The total number multimedia clips
|
53
|
-
attr_reader :MMClips
|
54
|
-
|
55
|
-
# @return [Boolean] The display mode for the document thumbnail.
|
56
|
-
attr_reader :ScaleCrop
|
57
|
-
|
58
|
-
# @return [Boolean] The links in the document are up to date.
|
59
|
-
attr_reader :LinksUpToDate
|
60
|
-
|
61
|
-
# @return [Integer] The number of characters in the document including spaces.
|
62
|
-
attr_reader :CharactersWithSpaces
|
63
|
-
|
64
|
-
# @return [Boolean] Indicates if the document is shared.
|
65
|
-
attr_reader :ShareDoc
|
66
|
-
|
67
|
-
# @return [String] The base for hyper links in the document.
|
68
|
-
attr_reader :HyperLinkBase
|
69
|
-
|
70
|
-
# @return [Boolean] Indicates that the hyper links in the document have been changed.
|
71
|
-
attr_reader :HyperlinksChanged
|
72
|
-
|
73
|
-
# @return [String] The name of the application
|
74
|
-
attr_reader :Application
|
75
|
-
|
76
|
-
# @return [String] The version of the application.
|
77
|
-
attr_reader :AppVersion
|
78
|
-
|
79
|
-
# @return [Integer] Document security
|
80
|
-
attr_reader :DocSecurity
|
81
|
-
|
82
|
-
# Creates an App object
|
83
|
-
# @option options [String] Template
|
84
|
-
# @option options [String] Manager
|
85
|
-
# @option options [Integer] Pages
|
86
|
-
# @option options [Integer] Words
|
87
|
-
# @option options [Integer] Characters
|
88
|
-
# @option options [String] PresentationFormat
|
89
|
-
# @option options [Integer] Lines
|
90
|
-
# @option options [Integer] Paragraphs
|
91
|
-
# @option options [Integer] Slides
|
92
|
-
# @option options [Integer] Notes
|
93
|
-
# @option options [Integer] TotalTime
|
94
|
-
# @option options [Integer] HiddenSlides
|
95
|
-
# @option options [Integer] MMClips
|
96
|
-
# @option options [Boolean] ScaleCrop
|
97
|
-
# @option options [Boolean] LinksUpToDate
|
98
|
-
# @option options [Integer] CharactersWithSpaces
|
99
|
-
# @option options [Boolean] ShareDoc
|
100
|
-
# @option options [String] HyperLinkBase
|
101
|
-
# @option options [String] HyperlinksChanged
|
102
|
-
# @option options [String] Application
|
103
|
-
# @option options [String] AppVersion
|
104
|
-
# @option options [Integer] DocSecurity
|
105
|
-
def initalize(options={})
|
106
|
-
options.each do |o|
|
107
|
-
self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
# Sets the Template property of your app.xml file
|
112
|
-
def Template=(v) Axlsx::validate_string v; @Template = v; end
|
113
|
-
|
114
|
-
# Sets the Manager property of your app.xml file
|
115
|
-
def Manager=(v) Axlsx::validate_string v; @Manager = v; end
|
116
|
-
|
117
|
-
# Sets the Company property of your app.xml file
|
118
|
-
def Company=(v) Axlsx::validate_string v; @Company = v; end
|
119
|
-
|
120
|
-
# Sets the Pages property of your app.xml file
|
121
|
-
def Pages=(v) Axlsx::validate_int v; @Pages = v; end
|
122
|
-
|
123
|
-
# Sets the Words property of your app.xml file
|
124
|
-
def Words=(v) Axlsx::validate_int v; @Words = v; end
|
125
|
-
|
126
|
-
# Sets the Characters property of your app.xml file
|
127
|
-
def Characters=(v) Axlsx::validate_int v; @Characters = v; end
|
128
|
-
|
129
|
-
|
130
|
-
# Sets the PresentationFormat property of your app.xml file
|
131
|
-
def PresentationFormat=(v) Axlsx::validate_string v; @PresentationFormat = v; end
|
132
|
-
# Sets the Lines property of your app.xml file
|
133
|
-
def Lines=(v) Axlsx::validate_int v; @Lines = v; end
|
134
|
-
# Sets the Paragraphs property of your app.xml file
|
135
|
-
def Paragraphs=(v) Axlsx::validate_int v; @Paragraphs = v; end
|
136
|
-
# Sets the Slides property of your app.xml file
|
137
|
-
def Slides=(v) Axlsx::validate_int v; @Slides = v; end
|
138
|
-
# Sets the Notes property of your app.xml file
|
139
|
-
def Notes=(v) Axlsx::validate_int v; @Notes = v; end
|
140
|
-
# Sets the TotalTime property of your app.xml file
|
141
|
-
def TotalTime=(v) Axlsx::validate_int v; @TotalTime = v; end
|
142
|
-
# Sets the HiddenSlides property of your app.xml file
|
143
|
-
def HiddenSlides=(v) Axlsx::validate_int v; @HiddenSlides = v; end
|
144
|
-
# Sets the MMClips property of your app.xml file
|
145
|
-
def MMClips=(v) Axlsx::validate_int v; @MMClips = v; end
|
146
|
-
# Sets the ScaleCrop property of your app.xml file
|
147
|
-
def ScaleCrop=(v) Axlsx::validate_boolean v; @ScaleCrop = v; end
|
148
|
-
# Sets the LinksUpToDate property of your app.xml file
|
149
|
-
def LinksUpToDate=(v) Axlsx::validate_boolean v; @LinksUpToDate = v; end
|
150
|
-
# Sets the CharactersWithSpaces property of your app.xml file
|
151
|
-
def CharactersWithSpaces=(v) Axlsx::validate_int v; @CharactersWithSpaces = v; end
|
152
|
-
# Sets the ShareDoc property of your app.xml file
|
153
|
-
def ShareDoc=(v) Axlsx::validate_boolean v; @ShareDoc = v; end
|
154
|
-
# Sets the HyperLinkBase property of your app.xml file
|
155
|
-
def HyperLinkBase=(v) Axlsx::validate_string v; @HyperLinkBase = v; end
|
156
|
-
# Sets the HyperLinksChanged property of your app.xml file
|
157
|
-
def HyperlinksChanged=(v) Axlsx::validate_boolean v; @HyperlinksChanged = v; end
|
158
|
-
# Sets the Application property of your app.xml file
|
159
|
-
def Application=(v) Axlsx::validate_string v; @Application = v; end
|
160
|
-
# Sets the AppVersion property of your app.xml file
|
161
|
-
def AppVersion=(v) Axlsx::validate_string v; @AppVersion = v; end
|
162
|
-
# Sets the DocSecurity property of your app.xml file
|
163
|
-
def DocSecurity=(v) Axlsx::validate_int v; @DocSecurity = v; end
|
164
|
-
|
165
|
-
# Generate an app.xml document
|
166
|
-
# @return [String] The document as a string
|
167
|
-
def to_xml()
|
168
|
-
builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
|
169
|
-
xml.send(:Properties, :xmlns => APP_NS, :'xmlns:vt' => APP_NS_VT) {
|
170
|
-
self.instance_values.each do |name, value|
|
171
|
-
xml.send("ap:#{name}", value)
|
172
|
-
end
|
173
|
-
}
|
174
|
-
end
|
175
|
-
builder.to_xml
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|
data/lib/axlsx/doc_props/core.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module Axlsx
|
2
|
-
# The core object for the package.
|
3
|
-
# @note Packages manage their own core object.
|
4
|
-
# @see Package#core
|
5
|
-
class Core
|
6
|
-
# The author of the document. By default this is 'axlsx'
|
7
|
-
# @return [String]
|
8
|
-
attr_accessor :creator
|
9
|
-
|
10
|
-
# Creates a new Core object.
|
11
|
-
# @option options [String] creator
|
12
|
-
def initialize(options={})
|
13
|
-
@creator = options[:creator] || 'axlsx'
|
14
|
-
end
|
15
|
-
|
16
|
-
# Serializes the core object. The created dcterms item is set to the current time when this method is called.
|
17
|
-
# @return [String]
|
18
|
-
def to_xml()
|
19
|
-
builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
|
20
|
-
xml.send('cp:coreProperties',
|
21
|
-
:"xmlns:cp" => CORE_NS,
|
22
|
-
:'xmlns:dc' => CORE_NS_DC,
|
23
|
-
:'xmlns:dcmitype'=>CORE_NS_DCMIT,
|
24
|
-
:'xmlns:dcterms'=>CORE_NS_DCT,
|
25
|
-
:'xmlns:xsi'=>CORE_NS_XSI) {
|
26
|
-
xml['dc'].creator self.creator
|
27
|
-
xml['dcterms'].created Time.now.strftime('%Y-%m-%dT%H:%M:%S'), :'xsi:type'=>"dcterms:W3CDTF"
|
28
|
-
xml['cp'].revision 0
|
29
|
-
}
|
30
|
-
end
|
31
|
-
builder.to_xml
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|