openxml-docx 0.10.3 → 0.10.4
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/openxml/docx/elements/title_page.rb +12 -0
- data/lib/openxml/docx/properties/even_and_odd_headers.rb +8 -0
- data/lib/openxml/docx/properties/title_page.rb +9 -0
- data/lib/openxml/docx/section.rb +2 -0
- data/lib/openxml/docx/version.rb +1 -1
- data/spec/elements/even_and_odd_headers_spec.rb +23 -0
- data/spec/elements/title_page_spec.rb +23 -0
- data/spec/properties/even_and_odd_headers_spec.rb +23 -0
- data/spec/properties/title_page_spec.rb +23 -0
- data/spec/section_spec.rb +2 -0
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3dfb16056ec9fdc822d040094c61d70283c95f2
|
4
|
+
data.tar.gz: 9dc43fc4dbb4fb986194bae94d89d3a2b9806fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f04788b1ee97bb998beb9dbdee1f2952f4b50a90302a37f1141702d905d347aca0be9dd7aef38f25f005d219067173e09f4d230f13f72c652d5feba674b8198c
|
7
|
+
data.tar.gz: 7cfe6251c00ae103028098509d2d05a184d3d63de713c510d5e8d08729d04934875bb426d3df6709811c9f11559b3bff1980f27bb3881760b1c1704d71eb33cd
|
data/Gemfile.lock
CHANGED
data/lib/openxml/docx/section.rb
CHANGED
@@ -24,6 +24,8 @@ module OpenXml
|
|
24
24
|
value_property :text_direction
|
25
25
|
value_property :type, as: :section_type
|
26
26
|
value_property :vertical_alignment, as: :vertical_text_alignment
|
27
|
+
value_property :title_page
|
28
|
+
value_property :even_and_odd_headers
|
27
29
|
|
28
30
|
def to_xml(xml)
|
29
31
|
property_xml xml
|
data/lib/openxml/docx/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::EvenAndOddHeaders do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :evenAndOddHeaders, name: "even_and_odd_headers"
|
7
|
+
|
8
|
+
with_no_attributes_set do
|
9
|
+
it_should_output "<w:evenAndOddHeaders/>", assign: false
|
10
|
+
end
|
11
|
+
|
12
|
+
for_attribute(:value) do
|
13
|
+
with_value(true) do
|
14
|
+
it_should_assign_successfully
|
15
|
+
it_should_output "<w:evenAndOddHeaders w:val=\"true\"/>"
|
16
|
+
end
|
17
|
+
|
18
|
+
with_value(:somethingElse) do
|
19
|
+
it_should_raise_an_exception
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::TitlePage do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :titlePg, name: "title_page"
|
7
|
+
|
8
|
+
with_no_attributes_set do
|
9
|
+
it_should_output "<w:titlePg/>", assign: false
|
10
|
+
end
|
11
|
+
|
12
|
+
for_attribute(:value) do
|
13
|
+
with_value(true) do
|
14
|
+
it_should_assign_successfully
|
15
|
+
it_should_output "<w:titlePg w:val=\"true\"/>"
|
16
|
+
end
|
17
|
+
|
18
|
+
with_value(:somethingElse) do
|
19
|
+
it_should_raise_an_exception
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Properties::EvenAndOddHeaders do
|
4
|
+
include ValuePropertyTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :evenAndOddHeaders, name: "even_and_odd_headers"
|
7
|
+
|
8
|
+
with_value(true) do
|
9
|
+
it_should_work
|
10
|
+
it_should_output "<w:evenAndOddHeaders/>"
|
11
|
+
end
|
12
|
+
|
13
|
+
with_value(false) do
|
14
|
+
it_should_work
|
15
|
+
it_should_output ""
|
16
|
+
end
|
17
|
+
|
18
|
+
with_value(nil) do
|
19
|
+
it_should_work
|
20
|
+
it_should_output ""
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Properties::TitlePage do
|
4
|
+
include ValuePropertyTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :titlePg, name: "title_page"
|
7
|
+
|
8
|
+
with_value(true) do
|
9
|
+
it_should_work
|
10
|
+
it_should_output "<w:titlePg/>"
|
11
|
+
end
|
12
|
+
|
13
|
+
with_value(false) do
|
14
|
+
it_should_work
|
15
|
+
it_should_output ""
|
16
|
+
end
|
17
|
+
|
18
|
+
with_value(nil) do
|
19
|
+
it_should_work
|
20
|
+
it_should_output ""
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/spec/section_spec.rb
CHANGED
@@ -20,6 +20,8 @@ describe OpenXml::Docx::Section do
|
|
20
20
|
it_should_have_value_property :text_direction, with_value: :lr
|
21
21
|
it_should_have_value_property :type, as_instance_of: :section_type, with_value: :oddPage
|
22
22
|
it_should_have_value_property :vertical_alignment, as_instance_of: :vertical_text_alignment, with_value: :both
|
23
|
+
it_should_have_value_property :title_page
|
24
|
+
it_should_have_value_property :even_and_odd_headers
|
23
25
|
|
24
26
|
context "if no attribute are set" do
|
25
27
|
before(:each) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openxml-docx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gene Doyel
|
@@ -207,6 +207,7 @@ files:
|
|
207
207
|
- lib/openxml/docx/elements/table_row.rb
|
208
208
|
- lib/openxml/docx/elements/text.rb
|
209
209
|
- lib/openxml/docx/elements/textbox_content.rb
|
210
|
+
- lib/openxml/docx/elements/title_page.rb
|
210
211
|
- lib/openxml/docx/elements/vml_container.rb
|
211
212
|
- lib/openxml/docx/elements/word_processing_drawing_anchor.rb
|
212
213
|
- lib/openxml/docx/elements/word_processing_drawing_effect_extent.rb
|
@@ -273,6 +274,7 @@ files:
|
|
273
274
|
- lib/openxml/docx/properties/effect.rb
|
274
275
|
- lib/openxml/docx/properties/emboss.rb
|
275
276
|
- lib/openxml/docx/properties/emphasis.rb
|
277
|
+
- lib/openxml/docx/properties/even_and_odd_headers.rb
|
276
278
|
- lib/openxml/docx/properties/expansion.rb
|
277
279
|
- lib/openxml/docx/properties/font.rb
|
278
280
|
- lib/openxml/docx/properties/font_size.rb
|
@@ -383,6 +385,7 @@ files:
|
|
383
385
|
- lib/openxml/docx/properties/text_alignment.rb
|
384
386
|
- lib/openxml/docx/properties/text_direction.rb
|
385
387
|
- lib/openxml/docx/properties/textbox_tight_wrap.rb
|
388
|
+
- lib/openxml/docx/properties/title_page.rb
|
386
389
|
- lib/openxml/docx/properties/toggle_property.rb
|
387
390
|
- lib/openxml/docx/properties/transparent_container_property.rb
|
388
391
|
- lib/openxml/docx/properties/ui_priority.rb
|
@@ -495,6 +498,7 @@ files:
|
|
495
498
|
- spec/elements/drawingml/transform_effect_spec.rb
|
496
499
|
- spec/elements/embed_system_fonts_spec.rb
|
497
500
|
- spec/elements/embed_true_type_fonts_spec.rb
|
501
|
+
- spec/elements/even_and_odd_headers_spec.rb
|
498
502
|
- spec/elements/font_alternate_name_spec.rb
|
499
503
|
- spec/elements/font_character_set_spec.rb
|
500
504
|
- spec/elements/font_panose_one_spec.rb
|
@@ -528,6 +532,7 @@ files:
|
|
528
532
|
- spec/elements/table_spec.rb
|
529
533
|
- spec/elements/text_spec.rb
|
530
534
|
- spec/elements/textbox_content_spec.rb
|
535
|
+
- spec/elements/title_page_spec.rb
|
531
536
|
- spec/elements/vml/group_spec.rb
|
532
537
|
- spec/elements/vml/rectangle_spec.rb
|
533
538
|
- spec/elements/vml/rounded_rectangle_spec.rb
|
@@ -588,6 +593,7 @@ files:
|
|
588
593
|
- spec/properties/effect_spec.rb
|
589
594
|
- spec/properties/emboss_spec.rb
|
590
595
|
- spec/properties/emphasis_spec.rb
|
596
|
+
- spec/properties/even_and_odd_headers_spec.rb
|
591
597
|
- spec/properties/expansion_spec.rb
|
592
598
|
- spec/properties/font_size_spec.rb
|
593
599
|
- spec/properties/font_spec.rb
|
@@ -691,6 +697,7 @@ files:
|
|
691
697
|
- spec/properties/text_alignment_spec.rb
|
692
698
|
- spec/properties/text_direction_spec.rb
|
693
699
|
- spec/properties/textbox_tight_wrap_spec.rb
|
700
|
+
- spec/properties/title_page_spec.rb
|
694
701
|
- spec/properties/ui_priority_spec.rb
|
695
702
|
- spec/properties/underline_spec.rb
|
696
703
|
- spec/properties/unhide_when_used_spec.rb
|