openxml-docx 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8371a885347f44a0163d4936ddae25af56ec4698
4
- data.tar.gz: 6e0992067fd06fc2e0ca688b6490a5c06207cf5c
3
+ metadata.gz: f3dfb16056ec9fdc822d040094c61d70283c95f2
4
+ data.tar.gz: 9dc43fc4dbb4fb986194bae94d89d3a2b9806fa7
5
5
  SHA512:
6
- metadata.gz: 25e1308b7e4e9d728de9f021ba0738be258bb23c55fee303528efc8b16daaf1eb644f0bcabce92d5f04a1d9ecb124ef0169df6fc6da2e713be36d0aec2c826ed
7
- data.tar.gz: 3a8a60baa5ddf2e20eb8b7a7416a3996a067d765ed9921597ddbda2ff61330bdce5f4f9641f26122a31e18f09efff7a2fc91445d9b7cdc10b868b3b0da4166dc
6
+ metadata.gz: f04788b1ee97bb998beb9dbdee1f2952f4b50a90302a37f1141702d905d347aca0be9dd7aef38f25f005d219067173e09f4d230f13f72c652d5feba674b8198c
7
+ data.tar.gz: 7cfe6251c00ae103028098509d2d05a184d3d63de713c510d5e8d08729d04934875bb426d3df6709811c9f11559b3bff1980f27bb3881760b1c1704d71eb33cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openxml-docx (0.10.3)
4
+ openxml-docx (0.10.4)
5
5
  nokogiri
6
6
  openxml-package (>= 0.2.2)
7
7
 
@@ -0,0 +1,12 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class TitlePage < Element
5
+ tag :titlePg
6
+
7
+ attribute :value, expects: :boolean, displays_as: :val, namespace: :w
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Properties
4
+ class EvenAndOddHeaders < ToggleProperty
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Properties
4
+ class TitlePage < ToggleProperty
5
+ tag :titlePg
6
+ end
7
+ end
8
+ end
9
+ end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module OpenXml
2
2
  module Docx
3
- VERSION = "0.10.3"
3
+ VERSION = "0.10.4"
4
4
  end
5
5
  end
@@ -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.3
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