rubyword 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -0
  4. data/CHANGELOG.txt +10 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE +22 -0
  7. data/README.md +125 -0
  8. data/Rakefile +4 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/doc/README.md +1 -0
  12. data/doc/text.md +1 -0
  13. data/lib/rubyword/configuration.rb +5 -0
  14. data/lib/rubyword/document.rb +81 -0
  15. data/lib/rubyword/element/base.rb +12 -0
  16. data/lib/rubyword/element/image.rb +45 -0
  17. data/lib/rubyword/element/link.rb +35 -0
  18. data/lib/rubyword/element/list.rb +35 -0
  19. data/lib/rubyword/element/page_break.rb +26 -0
  20. data/lib/rubyword/element/section.rb +67 -0
  21. data/lib/rubyword/element/text.rb +137 -0
  22. data/lib/rubyword/element/text_break.rb +20 -0
  23. data/lib/rubyword/version.rb +3 -0
  24. data/lib/rubyword/writer/part/base.rb +13 -0
  25. data/lib/rubyword/writer/part/content_types.rb +39 -0
  26. data/lib/rubyword/writer/part/doc_props_app.rb +20 -0
  27. data/lib/rubyword/writer/part/doc_props_core.rb +32 -0
  28. data/lib/rubyword/writer/part/doc_props_custom.rb +16 -0
  29. data/lib/rubyword/writer/part/document.rb +56 -0
  30. data/lib/rubyword/writer/part/font_table.rb +12 -0
  31. data/lib/rubyword/writer/part/footer.rb +50 -0
  32. data/lib/rubyword/writer/part/header.rb +40 -0
  33. data/lib/rubyword/writer/part/numbering.rb +51 -0
  34. data/lib/rubyword/writer/part/rels.rb +26 -0
  35. data/lib/rubyword/writer/part/rels_document.rb +31 -0
  36. data/lib/rubyword/writer/part/settings.rb +93 -0
  37. data/lib/rubyword/writer/part/styles.rb +91 -0
  38. data/lib/rubyword/writer/part/theme.rb +12 -0
  39. data/lib/rubyword/writer/part/toc.rb +89 -0
  40. data/lib/rubyword/writer/part/web_settings.rb +21 -0
  41. data/lib/rubyword/writer/style/base.rb +16 -0
  42. data/lib/rubyword/writer/style/section.rb +65 -0
  43. data/lib/rubyword/writer.rb +87 -0
  44. data/lib/rubyword.rb +9 -0
  45. data/rubyword.gemspec +27 -0
  46. data/sample/test.rb +78 -0
  47. data/spec/rubyword/document_spec.rb +11 -0
  48. data/spec/spec_helper.rb +32 -0
  49. data/template/fontTable.xml +54 -0
  50. data/template/theme.xml +284 -0
  51. metadata +197 -0
@@ -0,0 +1,284 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <a:theme
3
+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office 主题​​">
4
+ <a:themeElements>
5
+ <a:clrScheme name="Office">
6
+ <a:dk1>
7
+ <a:sysClr val="windowText" lastClr="000000"/>
8
+ </a:dk1>
9
+ <a:lt1>
10
+ <a:sysClr val="window" lastClr="FFFFFF"/>
11
+ </a:lt1>
12
+ <a:dk2>
13
+ <a:srgbClr val="1F497D"/>
14
+ </a:dk2>
15
+ <a:lt2>
16
+ <a:srgbClr val="EEECE1"/>
17
+ </a:lt2>
18
+ <a:accent1>
19
+ <a:srgbClr val="4F81BD"/>
20
+ </a:accent1>
21
+ <a:accent2>
22
+ <a:srgbClr val="C0504D"/>
23
+ </a:accent2>
24
+ <a:accent3>
25
+ <a:srgbClr val="9BBB59"/>
26
+ </a:accent3>
27
+ <a:accent4>
28
+ <a:srgbClr val="8064A2"/>
29
+ </a:accent4>
30
+ <a:accent5>
31
+ <a:srgbClr val="4BACC6"/>
32
+ </a:accent5>
33
+ <a:accent6>
34
+ <a:srgbClr val="F79646"/>
35
+ </a:accent6>
36
+ <a:hlink>
37
+ <a:srgbClr val="0000FF"/>
38
+ </a:hlink>
39
+ <a:folHlink>
40
+ <a:srgbClr val="800080"/>
41
+ </a:folHlink>
42
+ </a:clrScheme>
43
+ <a:fontScheme name="Office">
44
+ <a:majorFont>
45
+ <a:latin typeface="Cambria"/>
46
+ <a:ea typeface=""/>
47
+ <a:cs typeface=""/>
48
+ <a:font script="Jpan" typeface="MS ゴシック"/>
49
+ <a:font script="Hang" typeface="맑은 고딕"/>
50
+ <a:font script="Hans" typeface="宋体"/>
51
+ <a:font script="Hant" typeface="新細明體"/>
52
+ <a:font script="Arab" typeface="Times New Roman"/>
53
+ <a:font script="Hebr" typeface="Times New Roman"/>
54
+ <a:font script="Thai" typeface="Angsana New"/>
55
+ <a:font script="Ethi" typeface="Nyala"/>
56
+ <a:font script="Beng" typeface="Vrinda"/>
57
+ <a:font script="Gujr" typeface="Shruti"/>
58
+ <a:font script="Khmr" typeface="MoolBoran"/>
59
+ <a:font script="Knda" typeface="Tunga"/>
60
+ <a:font script="Guru" typeface="Raavi"/>
61
+ <a:font script="Cans" typeface="Euphemia"/>
62
+ <a:font script="Cher" typeface="Plantagenet Cherokee"/>
63
+ <a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
64
+ <a:font script="Tibt" typeface="Microsoft Himalaya"/>
65
+ <a:font script="Thaa" typeface="MV Boli"/>
66
+ <a:font script="Deva" typeface="Mangal"/>
67
+ <a:font script="Telu" typeface="Gautami"/>
68
+ <a:font script="Taml" typeface="Latha"/>
69
+ <a:font script="Syrc" typeface="Estrangelo Edessa"/>
70
+ <a:font script="Orya" typeface="Kalinga"/>
71
+ <a:font script="Mlym" typeface="Kartika"/>
72
+ <a:font script="Laoo" typeface="DokChampa"/>
73
+ <a:font script="Sinh" typeface="Iskoola Pota"/>
74
+ <a:font script="Mong" typeface="Mongolian Baiti"/>
75
+ <a:font script="Viet" typeface="Times New Roman"/>
76
+ <a:font script="Uigh" typeface="Microsoft Uighur"/>
77
+ <a:font script="Geor" typeface="Sylfaen"/>
78
+ </a:majorFont>
79
+ <a:minorFont>
80
+ <a:latin typeface="Calibri"/>
81
+ <a:ea typeface=""/>
82
+ <a:cs typeface=""/>
83
+ <a:font script="Jpan" typeface="MS 明朝"/>
84
+ <a:font script="Hang" typeface="맑은 고딕"/>
85
+ <a:font script="Hans" typeface="宋体"/>
86
+ <a:font script="Hant" typeface="新細明體"/>
87
+ <a:font script="Arab" typeface="Arial"/>
88
+ <a:font script="Hebr" typeface="Arial"/>
89
+ <a:font script="Thai" typeface="Cordia New"/>
90
+ <a:font script="Ethi" typeface="Nyala"/>
91
+ <a:font script="Beng" typeface="Vrinda"/>
92
+ <a:font script="Gujr" typeface="Shruti"/>
93
+ <a:font script="Khmr" typeface="DaunPenh"/>
94
+ <a:font script="Knda" typeface="Tunga"/>
95
+ <a:font script="Guru" typeface="Raavi"/>
96
+ <a:font script="Cans" typeface="Euphemia"/>
97
+ <a:font script="Cher" typeface="Plantagenet Cherokee"/>
98
+ <a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
99
+ <a:font script="Tibt" typeface="Microsoft Himalaya"/>
100
+ <a:font script="Thaa" typeface="MV Boli"/>
101
+ <a:font script="Deva" typeface="Mangal"/>
102
+ <a:font script="Telu" typeface="Gautami"/>
103
+ <a:font script="Taml" typeface="Latha"/>
104
+ <a:font script="Syrc" typeface="Estrangelo Edessa"/>
105
+ <a:font script="Orya" typeface="Kalinga"/>
106
+ <a:font script="Mlym" typeface="Kartika"/>
107
+ <a:font script="Laoo" typeface="DokChampa"/>
108
+ <a:font script="Sinh" typeface="Iskoola Pota"/>
109
+ <a:font script="Mong" typeface="Mongolian Baiti"/>
110
+ <a:font script="Viet" typeface="Arial"/>
111
+ <a:font script="Uigh" typeface="Microsoft Uighur"/>
112
+ <a:font script="Geor" typeface="Sylfaen"/>
113
+ </a:minorFont>
114
+ </a:fontScheme>
115
+ <a:fmtScheme name="Office">
116
+ <a:fillStyleLst>
117
+ <a:solidFill>
118
+ <a:schemeClr val="phClr"/>
119
+ </a:solidFill>
120
+ <a:gradFill rotWithShape="1">
121
+ <a:gsLst>
122
+ <a:gs pos="0">
123
+ <a:schemeClr val="phClr">
124
+ <a:tint val="50000"/>
125
+ <a:satMod val="300000"/>
126
+ </a:schemeClr>
127
+ </a:gs>
128
+ <a:gs pos="35000">
129
+ <a:schemeClr val="phClr">
130
+ <a:tint val="37000"/>
131
+ <a:satMod val="300000"/>
132
+ </a:schemeClr>
133
+ </a:gs>
134
+ <a:gs pos="100000">
135
+ <a:schemeClr val="phClr">
136
+ <a:tint val="15000"/>
137
+ <a:satMod val="350000"/>
138
+ </a:schemeClr>
139
+ </a:gs>
140
+ </a:gsLst>
141
+ <a:lin ang="16200000" scaled="1"/>
142
+ </a:gradFill>
143
+ <a:gradFill rotWithShape="1">
144
+ <a:gsLst>
145
+ <a:gs pos="0">
146
+ <a:schemeClr val="phClr">
147
+ <a:shade val="51000"/>
148
+ <a:satMod val="130000"/>
149
+ </a:schemeClr>
150
+ </a:gs>
151
+ <a:gs pos="80000">
152
+ <a:schemeClr val="phClr">
153
+ <a:shade val="93000"/>
154
+ <a:satMod val="130000"/>
155
+ </a:schemeClr>
156
+ </a:gs>
157
+ <a:gs pos="100000">
158
+ <a:schemeClr val="phClr">
159
+ <a:shade val="94000"/>
160
+ <a:satMod val="135000"/>
161
+ </a:schemeClr>
162
+ </a:gs>
163
+ </a:gsLst>
164
+ <a:lin ang="16200000" scaled="0"/>
165
+ </a:gradFill>
166
+ </a:fillStyleLst>
167
+ <a:lnStyleLst>
168
+ <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr">
169
+ <a:solidFill>
170
+ <a:schemeClr val="phClr">
171
+ <a:shade val="95000"/>
172
+ <a:satMod val="105000"/>
173
+ </a:schemeClr>
174
+ </a:solidFill>
175
+ <a:prstDash val="solid"/>
176
+ </a:ln>
177
+ <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr">
178
+ <a:solidFill>
179
+ <a:schemeClr val="phClr"/>
180
+ </a:solidFill>
181
+ <a:prstDash val="solid"/>
182
+ </a:ln>
183
+ <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr">
184
+ <a:solidFill>
185
+ <a:schemeClr val="phClr"/>
186
+ </a:solidFill>
187
+ <a:prstDash val="solid"/>
188
+ </a:ln>
189
+ </a:lnStyleLst>
190
+ <a:effectStyleLst>
191
+ <a:effectStyle>
192
+ <a:effectLst>
193
+ <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0">
194
+ <a:srgbClr val="000000">
195
+ <a:alpha val="38000"/>
196
+ </a:srgbClr>
197
+ </a:outerShdw>
198
+ </a:effectLst>
199
+ </a:effectStyle>
200
+ <a:effectStyle>
201
+ <a:effectLst>
202
+ <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0">
203
+ <a:srgbClr val="000000">
204
+ <a:alpha val="35000"/>
205
+ </a:srgbClr>
206
+ </a:outerShdw>
207
+ </a:effectLst>
208
+ </a:effectStyle>
209
+ <a:effectStyle>
210
+ <a:effectLst>
211
+ <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0">
212
+ <a:srgbClr val="000000">
213
+ <a:alpha val="35000"/>
214
+ </a:srgbClr>
215
+ </a:outerShdw>
216
+ </a:effectLst>
217
+ <a:scene3d>
218
+ <a:camera prst="orthographicFront">
219
+ <a:rot lat="0" lon="0" rev="0"/>
220
+ </a:camera>
221
+ <a:lightRig rig="threePt" dir="t">
222
+ <a:rot lat="0" lon="0" rev="1200000"/>
223
+ </a:lightRig>
224
+ </a:scene3d>
225
+ <a:sp3d>
226
+ <a:bevelT w="63500" h="25400"/>
227
+ </a:sp3d>
228
+ </a:effectStyle>
229
+ </a:effectStyleLst>
230
+ <a:bgFillStyleLst>
231
+ <a:solidFill>
232
+ <a:schemeClr val="phClr"/>
233
+ </a:solidFill>
234
+ <a:gradFill rotWithShape="1">
235
+ <a:gsLst>
236
+ <a:gs pos="0">
237
+ <a:schemeClr val="phClr">
238
+ <a:tint val="40000"/>
239
+ <a:satMod val="350000"/>
240
+ </a:schemeClr>
241
+ </a:gs>
242
+ <a:gs pos="40000">
243
+ <a:schemeClr val="phClr">
244
+ <a:tint val="45000"/>
245
+ <a:shade val="99000"/>
246
+ <a:satMod val="350000"/>
247
+ </a:schemeClr>
248
+ </a:gs>
249
+ <a:gs pos="100000">
250
+ <a:schemeClr val="phClr">
251
+ <a:shade val="20000"/>
252
+ <a:satMod val="255000"/>
253
+ </a:schemeClr>
254
+ </a:gs>
255
+ </a:gsLst>
256
+ <a:path path="circle">
257
+ <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/>
258
+ </a:path>
259
+ </a:gradFill>
260
+ <a:gradFill rotWithShape="1">
261
+ <a:gsLst>
262
+ <a:gs pos="0">
263
+ <a:schemeClr val="phClr">
264
+ <a:tint val="80000"/>
265
+ <a:satMod val="300000"/>
266
+ </a:schemeClr>
267
+ </a:gs>
268
+ <a:gs pos="100000">
269
+ <a:schemeClr val="phClr">
270
+ <a:shade val="30000"/>
271
+ <a:satMod val="200000"/>
272
+ </a:schemeClr>
273
+ </a:gs>
274
+ </a:gsLst>
275
+ <a:path path="circle">
276
+ <a:fillToRect l="50000" t="50000" r="50000" b="50000"/>
277
+ </a:path>
278
+ </a:gradFill>
279
+ </a:bgFillStyleLst>
280
+ </a:fmtScheme>
281
+ </a:themeElements>
282
+ <a:objectDefaults/>
283
+ <a:extraClrSchemeLst/>
284
+ </a:theme>
metadata ADDED
@@ -0,0 +1,197 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubyword
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - young
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-10-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nokogiri
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: zip
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: open-uri
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: fastimage
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: RubyWord is a simple, efficient Word document generation gem and easy
112
+ to generate docx file.
113
+ email:
114
+ - youngjy6@gmail.com
115
+ executables:
116
+ - console
117
+ - setup
118
+ extensions: []
119
+ extra_rdoc_files: []
120
+ files:
121
+ - ".gitignore"
122
+ - ".rspec"
123
+ - CHANGELOG.txt
124
+ - Gemfile
125
+ - LICENSE
126
+ - README.md
127
+ - Rakefile
128
+ - bin/console
129
+ - bin/setup
130
+ - doc/README.md
131
+ - doc/text.md
132
+ - lib/rubyword.rb
133
+ - lib/rubyword/configuration.rb
134
+ - lib/rubyword/document.rb
135
+ - lib/rubyword/element/base.rb
136
+ - lib/rubyword/element/image.rb
137
+ - lib/rubyword/element/link.rb
138
+ - lib/rubyword/element/list.rb
139
+ - lib/rubyword/element/page_break.rb
140
+ - lib/rubyword/element/section.rb
141
+ - lib/rubyword/element/text.rb
142
+ - lib/rubyword/element/text_break.rb
143
+ - lib/rubyword/version.rb
144
+ - lib/rubyword/writer.rb
145
+ - lib/rubyword/writer/part/base.rb
146
+ - lib/rubyword/writer/part/content_types.rb
147
+ - lib/rubyword/writer/part/doc_props_app.rb
148
+ - lib/rubyword/writer/part/doc_props_core.rb
149
+ - lib/rubyword/writer/part/doc_props_custom.rb
150
+ - lib/rubyword/writer/part/document.rb
151
+ - lib/rubyword/writer/part/font_table.rb
152
+ - lib/rubyword/writer/part/footer.rb
153
+ - lib/rubyword/writer/part/header.rb
154
+ - lib/rubyword/writer/part/numbering.rb
155
+ - lib/rubyword/writer/part/rels.rb
156
+ - lib/rubyword/writer/part/rels_document.rb
157
+ - lib/rubyword/writer/part/settings.rb
158
+ - lib/rubyword/writer/part/styles.rb
159
+ - lib/rubyword/writer/part/theme.rb
160
+ - lib/rubyword/writer/part/toc.rb
161
+ - lib/rubyword/writer/part/web_settings.rb
162
+ - lib/rubyword/writer/style/base.rb
163
+ - lib/rubyword/writer/style/section.rb
164
+ - rubyword.gemspec
165
+ - sample/test.rb
166
+ - spec/rubyword/document_spec.rb
167
+ - spec/spec_helper.rb
168
+ - template/fontTable.xml
169
+ - template/theme.xml
170
+ homepage: https://github.com/yigger/rubyword
171
+ licenses:
172
+ - MIT
173
+ metadata: {}
174
+ post_install_message:
175
+ rdoc_options: []
176
+ require_paths:
177
+ - lib
178
+ required_ruby_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ required_rubygems_version: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ requirements: []
189
+ rubyforge_project:
190
+ rubygems_version: 2.6.14
191
+ signing_key:
192
+ specification_version: 4
193
+ summary: Generate MS Word for ruby
194
+ test_files:
195
+ - spec/rubyword/document_spec.rb
196
+ - spec/spec_helper.rb
197
+ has_rdoc: