openxml-docx 0.10.6 → 0.11.0.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Gemfile +7 -1
- data/Gemfile.lock +33 -30
- data/README.md +34 -8
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/openxml/docx.rb +5 -2
- data/lib/openxml/docx/element.rb +9 -0
- data/lib/openxml/docx/elements.rb +2 -2
- data/lib/openxml/docx/elements/absolute_position_tab.rb +1 -1
- data/lib/openxml/docx/elements/background.rb +3 -2
- data/lib/openxml/docx/elements/bidi_embed.rb +3 -1
- data/lib/openxml/docx/elements/bidi_override.rb +3 -1
- data/lib/openxml/docx/elements/book_fold_printing.rb +1 -1
- data/lib/openxml/docx/elements/book_fold_printing_sheets.rb +1 -1
- data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +1 -1
- data/lib/openxml/docx/elements/break.rb +1 -1
- data/lib/openxml/docx/elements/carriage_return.rb +1 -1
- data/lib/openxml/docx/elements/compatibility_setting.rb +3 -1
- data/lib/openxml/docx/elements/compatibility_settings.rb +3 -1
- data/lib/openxml/docx/elements/content_part.rb +1 -1
- data/lib/openxml/docx/elements/control.rb +1 -1
- data/lib/openxml/docx/elements/dirty.rb +1 -1
- data/lib/openxml/docx/elements/drawing.rb +4 -1
- data/lib/openxml/docx/elements/embed_bold.rb +1 -1
- data/lib/openxml/docx/elements/embed_bold_italic.rb +1 -1
- data/lib/openxml/docx/elements/embed_italic.rb +1 -1
- data/lib/openxml/docx/elements/embed_regular.rb +1 -1
- data/lib/openxml/docx/elements/embed_system_fonts.rb +1 -1
- data/lib/openxml/docx/elements/embed_true_type_fonts.rb +1 -1
- data/lib/openxml/docx/elements/even_and_odd_headers.rb +1 -1
- data/lib/openxml/docx/elements/family.rb +1 -1
- data/lib/openxml/docx/elements/font.rb +3 -1
- data/lib/openxml/docx/elements/font_alternate_name.rb +1 -1
- data/lib/openxml/docx/elements/font_character_set.rb +1 -1
- data/lib/openxml/docx/elements/font_panose_one.rb +1 -1
- data/lib/openxml/docx/elements/font_pitch.rb +1 -1
- data/lib/openxml/docx/elements/font_sig.rb +1 -1
- data/lib/openxml/docx/elements/grid_column.rb +1 -1
- data/lib/openxml/docx/elements/group_shape.rb +3 -1
- data/lib/openxml/docx/elements/last_rendered_page_break.rb +1 -1
- data/lib/openxml/docx/elements/long_day.rb +1 -1
- data/lib/openxml/docx/elements/long_month.rb +1 -1
- data/lib/openxml/docx/elements/long_year.rb +1 -1
- data/lib/openxml/docx/elements/markup_compatibility_alternate_content.rb +4 -1
- data/lib/openxml/docx/elements/markup_compatibility_choice.rb +3 -1
- data/lib/openxml/docx/elements/markup_compatibility_fallback.rb +4 -1
- data/lib/openxml/docx/elements/nonbreaking_hyphen.rb +1 -1
- data/lib/openxml/docx/elements/optional_hyphen.rb +1 -1
- data/lib/openxml/docx/elements/page_number.rb +1 -1
- data/lib/openxml/docx/elements/paragraph.rb +3 -1
- data/lib/openxml/docx/elements/ruby.rb +2 -1
- data/lib/openxml/docx/elements/run.rb +3 -1
- data/lib/openxml/docx/elements/save_subset_fonts.rb +1 -1
- data/lib/openxml/docx/elements/section_properties.rb +4 -1
- data/lib/openxml/docx/elements/short_day.rb +1 -1
- data/lib/openxml/docx/elements/short_month.rb +1 -1
- data/lib/openxml/docx/elements/short_year.rb +1 -1
- data/lib/openxml/docx/elements/symbol.rb +1 -1
- data/lib/openxml/docx/elements/tab.rb +1 -1
- data/lib/openxml/docx/elements/table.rb +3 -1
- data/lib/openxml/docx/elements/table_cell.rb +3 -1
- data/lib/openxml/docx/elements/table_grid.rb +3 -1
- data/lib/openxml/docx/elements/table_row.rb +3 -1
- data/lib/openxml/docx/elements/text.rb +1 -1
- data/lib/openxml/docx/elements/textbox_content.rb +4 -1
- data/lib/openxml/docx/elements/title_page.rb +1 -1
- data/lib/openxml/docx/elements/vml_container.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_effect_extent.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_extent.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_inline.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_nv_graphic_frame_properties.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_h.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_offset.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_v.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_simple_position.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_coordinate.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_none.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_square.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_through.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_tight.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_top_and_bottom.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_groups_group_shape_properties.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_groups_nv_shape_drawing_properties.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +4 -1
- data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +3 -1
- data/lib/openxml/docx/elements/word_processing_shapes_textual_contents.rb +3 -1
- data/lib/openxml/docx/elements/wordprocessing_shape_group.rb +3 -1
- data/lib/openxml/docx/{property_builder.rb → has_properties.rb} +13 -2
- data/lib/openxml/docx/properties/border.rb +2 -2
- data/lib/openxml/docx/properties/color.rb +1 -1
- data/lib/openxml/docx/properties/complex_property.rb +3 -1
- data/lib/openxml/docx/properties/container_property.rb +3 -1
- data/lib/openxml/docx/properties/shading.rb +2 -2
- data/lib/openxml/docx/properties/table_border.rb +2 -2
- data/lib/openxml/docx/properties/table_cell_border.rb +2 -2
- data/lib/openxml/docx/properties/underline.rb +1 -1
- data/lib/openxml/docx/section.rb +1 -1
- data/lib/openxml/docx/style.rb +3 -2
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/vml.rb +1 -2
- data/lib/openxml/vml/elements.rb +2 -2
- data/lib/openxml/vml/elements/group.rb +3 -1
- data/lib/openxml/vml/elements/rectangle.rb +3 -1
- data/lib/openxml/vml/elements/rounded_rectangle.rb +3 -1
- data/openxml-docx.gemspec +29 -22
- metadata +47 -347
- data/lib/openxml/docx/attribute_builder.rb +0 -327
- data/lib/openxml/docx/elements/container.rb +0 -37
- data/lib/openxml/docx/elements/element.rb +0 -65
- data/lib/openxml/drawingml.rb +0 -17
- data/lib/openxml/drawingml/elements.rb +0 -13
- data/lib/openxml/drawingml/elements/adjust_values_list.rb +0 -11
- data/lib/openxml/drawingml/elements/blip.rb +0 -18
- data/lib/openxml/drawingml/elements/blip_fill.rb +0 -14
- data/lib/openxml/drawingml/elements/children_extents.rb +0 -14
- data/lib/openxml/drawingml/elements/children_offset.rb +0 -14
- data/lib/openxml/drawingml/elements/extension.rb +0 -13
- data/lib/openxml/drawingml/elements/extension_list.rb +0 -11
- data/lib/openxml/drawingml/elements/extents.rb +0 -14
- data/lib/openxml/drawingml/elements/fill_rectangle.rb +0 -16
- data/lib/openxml/drawingml/elements/graphic.rb +0 -10
- data/lib/openxml/drawingml/elements/graphic_data.rb +0 -12
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +0 -17
- data/lib/openxml/drawingml/elements/head_end.rb +0 -28
- data/lib/openxml/drawingml/elements/no_autofit.rb +0 -10
- data/lib/openxml/drawingml/elements/no_fill.rb +0 -10
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +0 -17
- data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +0 -12
- data/lib/openxml/drawingml/elements/non_visual_picture_properties.rb +0 -10
- data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +0 -12
- data/lib/openxml/drawingml/elements/offset.rb +0 -14
- data/lib/openxml/drawingml/elements/outline.rb +0 -36
- data/lib/openxml/drawingml/elements/picture.rb +0 -10
- data/lib/openxml/drawingml/elements/picture_locks.rb +0 -23
- data/lib/openxml/drawingml/elements/picture_shape_properties.rb +0 -13
- data/lib/openxml/drawingml/elements/preset_geometry.rb +0 -210
- data/lib/openxml/drawingml/elements/preset_text_warp.rb +0 -25
- data/lib/openxml/drawingml/elements/round.rb +0 -10
- data/lib/openxml/drawingml/elements/shape_guide.rb +0 -40
- data/lib/openxml/drawingml/elements/solid_fill.rb +0 -10
- data/lib/openxml/drawingml/elements/source_rectangle.rb +0 -16
- data/lib/openxml/drawingml/elements/srgb_color.rb +0 -14
- data/lib/openxml/drawingml/elements/stretch.rb +0 -10
- data/lib/openxml/drawingml/elements/tail_end.rb +0 -28
- data/lib/openxml/drawingml/elements/transform_effect.rb +0 -18
- data/spec/elements/absolute_position_tab_spec.rb +0 -58
- data/spec/elements/background_spec.rb +0 -52
- data/spec/elements/bidi_embed_spec.rb +0 -35
- data/spec/elements/bidi_override_spec.rb +0 -35
- data/spec/elements/book_fold_printing_sheets_spec.rb +0 -27
- data/spec/elements/book_fold_printing_spec.rb +0 -19
- data/spec/elements/book_fold_reverse_printing_spec.rb +0 -19
- data/spec/elements/break_spec.rb +0 -34
- data/spec/elements/carriage_return_spec.rb +0 -12
- data/spec/elements/compatibility_setting_spec.rb +0 -41
- data/spec/elements/compatibility_settings_spec.rb +0 -8
- data/spec/elements/content_part_spec.rb +0 -18
- data/spec/elements/control_spec.rb +0 -41
- data/spec/elements/deleted_text_spec.rb +0 -24
- data/spec/elements/dirty_spec.rb +0 -12
- data/spec/elements/drawing_spec.rb +0 -11
- data/spec/elements/drawingml/adjust_values_list_spec.rb +0 -8
- data/spec/elements/drawingml/blip_fill_spec.rb +0 -44
- data/spec/elements/drawingml/blip_spec.rb +0 -47
- data/spec/elements/drawingml/extension_list_spec.rb +0 -8
- data/spec/elements/drawingml/extension_spec.rb +0 -19
- data/spec/elements/drawingml/extents_spec.rb +0 -33
- data/spec/elements/drawingml/fill_rectangle_spec.rb +0 -76
- data/spec/elements/drawingml/graphic_data_spec.rb +0 -19
- data/spec/elements/drawingml/graphic_frame_locks_spec.rb +0 -107
- data/spec/elements/drawingml/graphic_spec.rb +0 -8
- data/spec/elements/drawingml/head_end_spec.rb +0 -48
- data/spec/elements/drawingml/no_autofit_spec.rb +0 -8
- data/spec/elements/drawingml/no_fill_spec.rb +0 -8
- data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +0 -68
- data/spec/elements/drawingml/non_visual_picture_drawing_properties_spec.rb +0 -23
- data/spec/elements/drawingml/non_visual_picture_properties_spec.rb +0 -8
- data/spec/elements/drawingml/non_visual_shape_drawing_properties_spec.rb +0 -24
- data/spec/elements/drawingml/offset_spec.rb +0 -42
- data/spec/elements/drawingml/outline_spec.rb +0 -64
- data/spec/elements/drawingml/picture_locks_spec.rb +0 -122
- data/spec/elements/drawingml/picture_shape_properties_spec.rb +0 -21
- data/spec/elements/drawingml/picture_spec.rb +0 -8
- data/spec/elements/drawingml/preset_geometry_spec.rb +0 -19
- data/spec/elements/drawingml/preset_text_warp_spec.rb +0 -36
- data/spec/elements/drawingml/round_spec.rb +0 -8
- data/spec/elements/drawingml/shape_guide_spec.rb +0 -53
- data/spec/elements/drawingml/solid_fill_spec.rb +0 -8
- data/spec/elements/drawingml/source_rectangle_spec.rb +0 -76
- data/spec/elements/drawingml/srgb_color_spec.rb +0 -19
- data/spec/elements/drawingml/stretch_spec.rb +0 -8
- data/spec/elements/drawingml/tail_end_spec.rb +0 -47
- data/spec/elements/drawingml/transform_effect_spec.rb +0 -102
- data/spec/elements/embed_system_fonts_spec.rb +0 -19
- data/spec/elements/embed_true_type_fonts_spec.rb +0 -19
- data/spec/elements/even_and_odd_headers_spec.rb +0 -23
- data/spec/elements/font_alternate_name_spec.rb +0 -19
- data/spec/elements/font_character_set_spec.rb +0 -19
- data/spec/elements/font_panose_one_spec.rb +0 -19
- data/spec/elements/font_pitch_spec.rb +0 -21
- data/spec/elements/font_sig_spec.rb +0 -74
- data/spec/elements/grid_column_spec.rb +0 -15
- data/spec/elements/group_shape_spec.rb +0 -11
- data/spec/elements/last_rendered_page_break_spec.rb +0 -12
- data/spec/elements/long_day_spec.rb +0 -12
- data/spec/elements/long_month_spec.rb +0 -12
- data/spec/elements/long_year_spec.rb +0 -12
- data/spec/elements/markup_compatibility_alternate_content_spec.rb +0 -11
- data/spec/elements/markup_compatibility_choice_spec.rb +0 -22
- data/spec/elements/markup_compatibility_fallback_spec.rb +0 -11
- data/spec/elements/nonbreaking_hyphen_spec.rb +0 -12
- data/spec/elements/optional_hyphen_spec.rb +0 -12
- data/spec/elements/page_number_spec.rb +0 -12
- data/spec/elements/paragraph_spec.rb +0 -60
- data/spec/elements/ruby_spec.rb +0 -66
- data/spec/elements/run_spec.rb +0 -15
- data/spec/elements/save_subset_fonts_spec.rb +0 -19
- data/spec/elements/section_properties_spec.rb +0 -12
- data/spec/elements/short_day_spec.rb +0 -12
- data/spec/elements/short_month_spec.rb +0 -12
- data/spec/elements/short_year_spec.rb +0 -12
- data/spec/elements/symbol_spec.rb +0 -31
- data/spec/elements/tab_spec.rb +0 -12
- data/spec/elements/table_cell_spec.rb +0 -15
- data/spec/elements/table_grid_spec.rb +0 -17
- data/spec/elements/table_row_spec.rb +0 -18
- data/spec/elements/table_spec.rb +0 -21
- data/spec/elements/text_spec.rb +0 -24
- data/spec/elements/textbox_content_spec.rb +0 -8
- data/spec/elements/title_page_spec.rb +0 -23
- data/spec/elements/vml/group_spec.rb +0 -534
- data/spec/elements/vml/rectangle_spec.rb +0 -729
- data/spec/elements/vml/rounded_rectangle_spec.rb +0 -784
- data/spec/elements/vml_container_spec.rb +0 -11
- data/spec/elements/word_processing_drawing_anchor_spec.rb +0 -122
- data/spec/elements/word_processing_drawing_effect_extent_spec.rb +0 -77
- data/spec/elements/word_processing_drawing_extent_spec.rb +0 -34
- data/spec/elements/word_processing_drawing_nv_graphic_frame_properties_spec.rb +0 -11
- data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +0 -67
- data/spec/elements/word_processing_drawing_position_h_spec.rb +0 -22
- data/spec/elements/word_processing_drawing_position_v_spec.rb +0 -22
- data/spec/elements/word_processing_drawing_simple_position_spec.rb +0 -44
- data/spec/elements/word_processing_drawing_wrap_coordinate_spec.rb +0 -40
- data/spec/elements/word_processing_drawing_wrap_none_spec.rb +0 -12
- data/spec/elements/word_processing_drawing_wrap_polygon_spec.rb +0 -23
- data/spec/elements/word_processing_drawing_wrap_square_spec.rb +0 -65
- data/spec/elements/word_processing_drawing_wrap_through_spec.rb +0 -43
- data/spec/elements/word_processing_drawing_wrap_tight_spec.rb +0 -43
- data/spec/elements/word_processing_drawing_wrap_top_and_bottom_spec.rb +0 -30
- data/spec/elements/word_processing_groups_group_shape_properties_spec.rb +0 -21
- data/spec/elements/word_processing_groups_nv_shape_drawing_properties_spec.rb +0 -8
- data/spec/elements/word_processing_shapes_body_properties_spec.rb +0 -232
- data/spec/elements/word_processing_shapes_nv_drawing_properties_spec.rb +0 -64
- data/spec/elements/word_processing_shapes_shape_properties_spec.rb +0 -22
- data/spec/elements/word_processing_shapes_shape_spec.rb +0 -23
- data/spec/elements/word_processing_shapes_textual_content_spec.rb +0 -23
- data/spec/elements/wordprocessing_shape_group_spec.rb +0 -12
- data/spec/package_spec.rb +0 -36
- data/spec/parts/document_spec.rb +0 -95
- data/spec/parts/footer_spec.rb +0 -33
- data/spec/parts/header_spec.rb +0 -33
- data/spec/parts/settings_spec.rb +0 -19
- data/spec/parts/styles_spec.rb +0 -27
- data/spec/properties/alignment_spec.rb +0 -58
- data/spec/properties/auto_adjust_right_indent_spec.rb +0 -23
- data/spec/properties/auto_space_de_spec.rb +0 -23
- data/spec/properties/auto_space_dn_spec.rb +0 -23
- data/spec/properties/bidi_spec.rb +0 -22
- data/spec/properties/bold_spec.rb +0 -22
- data/spec/properties/border_spec.rb +0 -82
- data/spec/properties/cant_split_spec.rb +0 -22
- data/spec/properties/caps_spec.rb +0 -22
- data/spec/properties/character_spacing_spec.rb +0 -26
- data/spec/properties/color_spec.rb +0 -29
- data/spec/properties/column_spec.rb +0 -30
- data/spec/properties/columns_spec.rb +0 -164
- data/spec/properties/complex_bold_spec.rb +0 -22
- data/spec/properties/complex_font_size_spec.rb +0 -24
- data/spec/properties/complex_italics_spec.rb +0 -22
- data/spec/properties/complex_script_formatting_spec.rb +0 -22
- data/spec/properties/compress_punctuation_spec.rb +0 -32
- data/spec/properties/conditional_formatting_spec.rb +0 -64
- data/spec/properties/contextual_spacing_spec.rb +0 -22
- data/spec/properties/div_id_spec.rb +0 -17
- data/spec/properties/document_grid_spec.rb +0 -37
- data/spec/properties/double_strikethrough_spec.rb +0 -23
- data/spec/properties/east_asian_layout_spec.rb +0 -55
- data/spec/properties/effect_spec.rb +0 -43
- data/spec/properties/emboss_spec.rb +0 -22
- data/spec/properties/emphasis_spec.rb +0 -37
- data/spec/properties/even_and_odd_headers_spec.rb +0 -22
- data/spec/properties/expansion_spec.rb +0 -34
- data/spec/properties/font_size_spec.rb +0 -24
- data/spec/properties/font_spec.rb +0 -70
- data/spec/properties/footer_reference_spec.rb +0 -32
- data/spec/properties/form_protection_spec.rb +0 -22
- data/spec/properties/frame_spec.rb +0 -101
- data/spec/properties/grid_after_spec.rb +0 -26
- data/spec/properties/grid_before_spec.rb +0 -26
- data/spec/properties/grid_span_spec.rb +0 -24
- data/spec/properties/header_reference_spec.rb +0 -32
- data/spec/properties/header_spec.rb +0 -17
- data/spec/properties/headers_spec.rb +0 -39
- data/spec/properties/hidden_spec.rb +0 -22
- data/spec/properties/hidden_style_spec.rb +0 -22
- data/spec/properties/hidden_text_spec.rb +0 -22
- data/spec/properties/hide_mark_spec.rb +0 -22
- data/spec/properties/highlight_spec.rb +0 -97
- data/spec/properties/imprint_spec.rb +0 -22
- data/spec/properties/indentation_spec.rb +0 -100
- data/spec/properties/italics_spec.rb +0 -22
- data/spec/properties/keep_lines_spec.rb +0 -22
- data/spec/properties/keep_next_spec.rb +0 -22
- data/spec/properties/kerning_spec.rb +0 -24
- data/spec/properties/kinsoku_spec.rb +0 -32
- data/spec/properties/language_spec.rb +0 -20
- data/spec/properties/latent_styles_exception_spec.rb +0 -68
- data/spec/properties/latent_styles_spec.rb +0 -323
- data/spec/properties/line_numbering_spec.rb +0 -43
- data/spec/properties/linked_style_spec.rb +0 -17
- data/spec/properties/manual_width_spec.rb +0 -30
- data/spec/properties/math_spec.rb +0 -22
- data/spec/properties/mirror_indent_spec.rb +0 -22
- data/spec/properties/next_style_spec.rb +0 -17
- data/spec/properties/no_proof_spec.rb +0 -23
- data/spec/properties/no_wrap_spec.rb +0 -22
- data/spec/properties/numbering_spec.rb +0 -37
- data/spec/properties/outline_level_spec.rb +0 -20
- data/spec/properties/outline_spec.rb +0 -23
- data/spec/properties/overflow_punctuation_spec.rb +0 -23
- data/spec/properties/page_borders_spec.rb +0 -129
- data/spec/properties/page_break_before_spec.rb +0 -22
- data/spec/properties/page_margins_spec.rb +0 -64
- data/spec/properties/page_numbering_spec.rb +0 -54
- data/spec/properties/page_size_spec.rb +0 -43
- data/spec/properties/paper_source_spec.rb +0 -30
- data/spec/properties/paragraph_borders_spec.rb +0 -66
- data/spec/properties/paragraph_style_spec.rb +0 -12
- data/spec/properties/parent_style_spec.rb +0 -17
- data/spec/properties/personal_compose_spec.rb +0 -23
- data/spec/properties/personal_reply_spec.rb +0 -23
- data/spec/properties/personal_spec.rb +0 -23
- data/spec/properties/phonetic_guide_alignment_spec.rb +0 -42
- data/spec/properties/phonetic_guide_base_font_size_spec.rb +0 -25
- data/spec/properties/phonetic_guide_font_size_raise_spec.rb +0 -25
- data/spec/properties/phonetic_guide_font_size_spec.rb +0 -25
- data/spec/properties/phonetic_guide_language_spec.rb +0 -12
- data/spec/properties/position_spec.rb +0 -26
- data/spec/properties/primary_style_spec.rb +0 -22
- data/spec/properties/right_to_left_spec.rb +0 -22
- data/spec/properties/rtl_gutter_spec.rb +0 -23
- data/spec/properties/run_style_spec.rb +0 -12
- data/spec/properties/section_type_spec.rb +0 -33
- data/spec/properties/semi_hidden_spec.rb +0 -22
- data/spec/properties/shading_spec.rb +0 -64
- data/spec/properties/shadow_property_spec.rb +0 -23
- data/spec/properties/small_caps_spec.rb +0 -22
- data/spec/properties/snap_to_grid_spec.rb +0 -32
- data/spec/properties/spacing_spec.rb +0 -67
- data/spec/properties/spec_vanish_spec.rb +0 -22
- data/spec/properties/strikethrough_spec.rb +0 -23
- data/spec/properties/style_aliases_spec.rb +0 -22
- data/spec/properties/style_auto_redefinition_spec.rb +0 -22
- data/spec/properties/style_lock_spec.rb +0 -22
- data/spec/properties/style_name_spec.rb +0 -17
- data/spec/properties/supress_auto_hyphens_spec.rb +0 -22
- data/spec/properties/supress_line_numbers_spec.rb +0 -22
- data/spec/properties/supress_overlap_spec.rb +0 -22
- data/spec/properties/tab_spec.rb +0 -45
- data/spec/properties/table_border_spec.rb +0 -119
- data/spec/properties/table_borders_spec.rb +0 -41
- data/spec/properties/table_caption_spec.rb +0 -17
- data/spec/properties/table_cell_border_spec.rb +0 -119
- data/spec/properties/table_cell_borders_spec.rb +0 -40
- data/spec/properties/table_cell_cell_margin_spec.rb +0 -46
- data/spec/properties/table_cell_fit_text_spec.rb +0 -23
- data/spec/properties/table_cell_margin_spec.rb +0 -40
- data/spec/properties/table_cell_margins_spec.rb +0 -46
- data/spec/properties/table_cell_spacing_spec.rb +0 -21
- data/spec/properties/table_cell_width_spec.rb +0 -21
- data/spec/properties/table_description_spec.rb +0 -17
- data/spec/properties/table_header_spec.rb +0 -22
- data/spec/properties/table_indent_spec.rb +0 -43
- data/spec/properties/table_layout_spec.rb +0 -24
- data/spec/properties/table_look_spec.rb +0 -43
- data/spec/properties/table_overlap_spec.rb +0 -22
- data/spec/properties/table_p_pr_spec.rb +0 -68
- data/spec/properties/table_row_height_spec.rb +0 -20
- data/spec/properties/table_style_spec.rb +0 -17
- data/spec/properties/table_width_spec.rb +0 -21
- data/spec/properties/tabs_spec.rb +0 -39
- data/spec/properties/text_alignment_spec.rb +0 -33
- data/spec/properties/text_direction_spec.rb +0 -47
- data/spec/properties/textbox_tight_wrap_spec.rb +0 -33
- data/spec/properties/title_page_spec.rb +0 -22
- data/spec/properties/ui_priority_spec.rb +0 -22
- data/spec/properties/underline_spec.rb +0 -45
- data/spec/properties/unhide_when_used_spec.rb +0 -22
- data/spec/properties/valign_spec.rb +0 -19
- data/spec/properties/vertical_alignment_spec.rb +0 -26
- data/spec/properties/vertical_merge_spec.rb +0 -22
- data/spec/properties/vertical_text_alignment_spec.rb +0 -28
- data/spec/properties/wafter_spec.rb +0 -21
- data/spec/properties/wbefore_spec.rb +0 -21
- data/spec/properties/web_hidden_spec.rb +0 -22
- data/spec/properties/widow_control_spec.rb +0 -33
- data/spec/properties/word_wrap_spec.rb +0 -33
- data/spec/section_spec.rb +0 -48
- data/spec/spec_helper.rb +0 -16
- data/spec/style_spec.rb +0 -108
- data/spec/support/data/elements/break_element.xml +0 -4
- data/spec/support/data/elements/break_with_attributes_element.xml +0 -4
- data/spec/support/data/elements/grid_column_element.xml +0 -4
- data/spec/support/data/elements/paragraph_element.xml +0 -8
- data/spec/support/data/elements/paragraph_with_runs_element.xml +0 -14
- data/spec/support/data/elements/paragraph_with_section_properties_element.xml +0 -13
- data/spec/support/data/elements/run_element.xml +0 -8
- data/spec/support/data/elements/symbol_element.xml +0 -4
- data/spec/support/data/elements/table_cell_element.xml +0 -8
- data/spec/support/data/elements/table_element.xml +0 -18
- data/spec/support/data/elements/table_grid_element.xml +0 -6
- data/spec/support/data/elements/table_row_element.xml +0 -13
- data/spec/support/data/elements/text_element.xml +0 -4
- data/spec/support/data/parts/content_types_part.xml +0 -1
- data/spec/support/data/parts/document_with_children_part.xml +0 -2
- data/spec/support/data/parts/document_with_multiple_sections_part.xml +0 -24
- data/spec/support/data/parts/document_with_one_section_part.xml +0 -16
- data/spec/support/data/parts/empty_document_part.xml +0 -1
- data/spec/support/data/parts/empty_footer_part.xml +0 -1
- data/spec/support/data/parts/empty_header_part.xml +0 -1
- data/spec/support/data/parts/footer_with_children_part.xml +0 -1
- data/spec/support/data/parts/global_rels_part.xml +0 -1
- data/spec/support/data/parts/header_with_children_part.xml +0 -1
- data/spec/support/data/parts/rels_part.xml +0 -1
- data/spec/support/data/parts/settings_part.xml +0 -1
- data/spec/support/data/parts/styles_part.xml +0 -1
- data/spec/support/data/parts/styles_with_custom_style_part.xml +0 -20
- data/spec/support/data/styles/character_styles.xml +0 -15
- data/spec/support/data/styles/paragraph_styles.xml +0 -11
- data/spec/support/element_test_macros.rb +0 -242
- data/spec/support/part_test_macros.rb +0 -27
- data/spec/support/property_test_macros.rb +0 -177
- data/spec/support/style_test_macros.rb +0 -33
- data/spec/support/value_property_test_macros.rb +0 -69
@@ -1,327 +0,0 @@
|
|
1
|
-
module OpenXml
|
2
|
-
module Docx
|
3
|
-
module AttributeBuilder
|
4
|
-
|
5
|
-
VALID_THEME_COLORS = %i(accent1 accent2 accent3 accent4 accent5 accent6 background1 background2 dark1 dark2 followedHyperlink hyperlink light1 light2 none text1 text2)
|
6
|
-
|
7
|
-
VALID_TYPES = %i(apples
|
8
|
-
archedScallops
|
9
|
-
babyPacifier
|
10
|
-
babyRattle
|
11
|
-
balloons3Colors
|
12
|
-
balloonsHotAir
|
13
|
-
basicBlackDashes
|
14
|
-
basicBlackDots
|
15
|
-
basicBlackSquares
|
16
|
-
basicThinLines
|
17
|
-
basicWhiteDashes
|
18
|
-
basicWhiteDots
|
19
|
-
basicWhiteSquares
|
20
|
-
basicWideInline
|
21
|
-
basicWideMidline
|
22
|
-
basicWideOutline
|
23
|
-
bats
|
24
|
-
birds
|
25
|
-
birdsFlight
|
26
|
-
cabins
|
27
|
-
cakeSlice
|
28
|
-
candyCorn
|
29
|
-
celticKnotwork
|
30
|
-
certificateBanner
|
31
|
-
chainLink
|
32
|
-
champagneBottle
|
33
|
-
checkedBarBlack
|
34
|
-
checkedBarColor
|
35
|
-
checkered
|
36
|
-
christmasTree
|
37
|
-
circlesLines
|
38
|
-
circlesRectangles
|
39
|
-
classicalWave
|
40
|
-
clocks
|
41
|
-
compass
|
42
|
-
confetti
|
43
|
-
confettiGrays
|
44
|
-
confettiOutlines
|
45
|
-
confettiStreamers
|
46
|
-
confettiWhite
|
47
|
-
cornerTriangles
|
48
|
-
couponCutoutDashes
|
49
|
-
couponCutoutDots
|
50
|
-
crazyMaze
|
51
|
-
creaturesButterfly
|
52
|
-
creaturesFish
|
53
|
-
creaturesInsects
|
54
|
-
creaturesLadyBug
|
55
|
-
crossStitch
|
56
|
-
cup
|
57
|
-
custom
|
58
|
-
dashDotStroked
|
59
|
-
dashed
|
60
|
-
dashSmallGap
|
61
|
-
decoArch
|
62
|
-
decoArchColor
|
63
|
-
decoBlocks
|
64
|
-
diamondsGray
|
65
|
-
dotDash
|
66
|
-
dotDotDash
|
67
|
-
dotted
|
68
|
-
double
|
69
|
-
doubleD
|
70
|
-
doubleDiamonds
|
71
|
-
doubleWave
|
72
|
-
earth1
|
73
|
-
earth2
|
74
|
-
earth3
|
75
|
-
eclipsingSquares1
|
76
|
-
eclipsingSquares2
|
77
|
-
eggsBlack
|
78
|
-
fans
|
79
|
-
film
|
80
|
-
firecrackers
|
81
|
-
flowersBlockPrint
|
82
|
-
flowersDaisies
|
83
|
-
flowersModern1
|
84
|
-
flowersModern2
|
85
|
-
flowersPansy
|
86
|
-
flowersRedRose
|
87
|
-
flowersRoses
|
88
|
-
flowersTeacup
|
89
|
-
flowersTiny
|
90
|
-
gems
|
91
|
-
gingerbreadMan
|
92
|
-
gradient
|
93
|
-
handmade1
|
94
|
-
handmade2
|
95
|
-
heartBalloon
|
96
|
-
heartGray
|
97
|
-
hearts
|
98
|
-
heebieJeebies
|
99
|
-
holly
|
100
|
-
houseFunky
|
101
|
-
hypnotic
|
102
|
-
iceCreamCones
|
103
|
-
inset
|
104
|
-
lightBulb
|
105
|
-
lightning1
|
106
|
-
lightning2
|
107
|
-
mapleLeaf
|
108
|
-
mapleMuffins
|
109
|
-
mapPins
|
110
|
-
marquee
|
111
|
-
marqueeToothed
|
112
|
-
moons
|
113
|
-
mosaic
|
114
|
-
musicNotes
|
115
|
-
nil
|
116
|
-
none
|
117
|
-
northwest
|
118
|
-
outset
|
119
|
-
ovals
|
120
|
-
packages
|
121
|
-
palmsBlack
|
122
|
-
palmsColor
|
123
|
-
paperClips
|
124
|
-
papyrus
|
125
|
-
partyFavor
|
126
|
-
partyGlass
|
127
|
-
pencils
|
128
|
-
people
|
129
|
-
peopleHats
|
130
|
-
peopleWaving
|
131
|
-
poinsettias
|
132
|
-
postageStamp
|
133
|
-
pumpkin1
|
134
|
-
pushPinNote1
|
135
|
-
pushPinNote2
|
136
|
-
pyramids
|
137
|
-
pyramidsAbove
|
138
|
-
quadrants
|
139
|
-
rings
|
140
|
-
safari
|
141
|
-
sawtooth
|
142
|
-
sawtoothGray
|
143
|
-
scaredCat
|
144
|
-
seattle
|
145
|
-
shadowedSquares
|
146
|
-
shapes1
|
147
|
-
shapes2
|
148
|
-
sharksTeeth
|
149
|
-
shorebirdTracks
|
150
|
-
single
|
151
|
-
skyrocket
|
152
|
-
snowflakeFancy
|
153
|
-
snowflaskes
|
154
|
-
sombrero
|
155
|
-
southwest
|
156
|
-
stars
|
157
|
-
stars3d
|
158
|
-
starsBlack
|
159
|
-
starsShadowed
|
160
|
-
starsTop
|
161
|
-
sun
|
162
|
-
swirligig
|
163
|
-
thick
|
164
|
-
thickThinLargeGap
|
165
|
-
thickThinMediumGap
|
166
|
-
thickThinSmallGap
|
167
|
-
thinThickLargeGap
|
168
|
-
thinThickMediumGap
|
169
|
-
thinThickSmallGap
|
170
|
-
thinThickThinLargeGap
|
171
|
-
thinThickThinMediumGap
|
172
|
-
thinThickThinSmallGap
|
173
|
-
threeDEmboss
|
174
|
-
threeDEngrave
|
175
|
-
tornPaper
|
176
|
-
tornPaperBlack
|
177
|
-
trees
|
178
|
-
triangle1
|
179
|
-
triangle2
|
180
|
-
triangleCircle1
|
181
|
-
triangleCircle2
|
182
|
-
triangleParty
|
183
|
-
triangle
|
184
|
-
triple
|
185
|
-
twistedLines1
|
186
|
-
twistedLines2
|
187
|
-
vine
|
188
|
-
wave
|
189
|
-
waveline
|
190
|
-
weavingAngles
|
191
|
-
weavingBraid
|
192
|
-
weavingRibbon
|
193
|
-
weavingStrips
|
194
|
-
whiteFlowers
|
195
|
-
woodwork
|
196
|
-
xIllusions
|
197
|
-
zanyTriangles
|
198
|
-
zigZag
|
199
|
-
zigZagStitch)
|
200
|
-
|
201
|
-
def self.included(base)
|
202
|
-
base.extend(ClassMethods)
|
203
|
-
end
|
204
|
-
|
205
|
-
module ClassMethods
|
206
|
-
def attribute(name, expects: nil, one_of: nil, displays_as: nil, namespace: nil, matches: nil, deprecated: false)
|
207
|
-
bad_names = %w(tag name namespace properties_tag)
|
208
|
-
raise ArgumentError if bad_names.member? name
|
209
|
-
|
210
|
-
attr_reader name
|
211
|
-
|
212
|
-
define_method "#{name}=" do |value|
|
213
|
-
valid_in?(value, one_of) unless one_of.nil?
|
214
|
-
send(expects, value) unless expects.nil?
|
215
|
-
matches?(value, matches) unless matches.nil?
|
216
|
-
instance_variable_set "@#{name}", value
|
217
|
-
end
|
218
|
-
|
219
|
-
camelized_name = name.to_s.gsub(/_([a-z])/i) { $1.upcase }.to_sym
|
220
|
-
attributes[name] = [displays_as || camelized_name, namespace || @attribute_namespace]
|
221
|
-
end
|
222
|
-
|
223
|
-
def attributes
|
224
|
-
@attributes ||= {}
|
225
|
-
end
|
226
|
-
|
227
|
-
def with_namespace(namespace, &block)
|
228
|
-
@attribute_namespace = namespace
|
229
|
-
instance_eval(&block)
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
def render?
|
234
|
-
attributes.keys.map(&method(:send)).any?
|
235
|
-
end
|
236
|
-
|
237
|
-
def attributes
|
238
|
-
self.class.attributes
|
239
|
-
end
|
240
|
-
|
241
|
-
private
|
242
|
-
|
243
|
-
def xml_attributes
|
244
|
-
attributes.each_with_object({}) do |(name, options), attrs|
|
245
|
-
display, namespace = options
|
246
|
-
value = send(name)
|
247
|
-
attr_name = "#{namespace}:#{display}"
|
248
|
-
attr_name = "#{display}" if namespace.nil?
|
249
|
-
attrs[attr_name] = value unless value.nil?
|
250
|
-
end
|
251
|
-
end
|
252
|
-
|
253
|
-
def boolean(value)
|
254
|
-
message = "Invalid #{name}: frame must be true or false"
|
255
|
-
raise ArgumentError, message unless [true, false].member? value
|
256
|
-
end
|
257
|
-
|
258
|
-
def hex_color(value)
|
259
|
-
message = "Invalid #{name}: must be :auto or a hex color, e.g. 4F1B8C"
|
260
|
-
raise ArgumentError, message unless value == :auto || value =~ /^[0-9A-F]{6}$/
|
261
|
-
end
|
262
|
-
|
263
|
-
def hex_digit(value)
|
264
|
-
message = "Invalid #{name}: must be a two-digit hex number, e.g. BF"
|
265
|
-
raise ArgumentError, message unless value =~ /^[0-9A-F]{2}$/
|
266
|
-
end
|
267
|
-
|
268
|
-
def hex_digit_4(value)
|
269
|
-
message = "Invalid #{name}: must be a four-digit hex number, e.g. BF12"
|
270
|
-
raise ArgumentError, message unless value =~ /^[0-9A-F]{4}$/
|
271
|
-
end
|
272
|
-
|
273
|
-
def long_hex_number(value)
|
274
|
-
message = "Invalid #{name}: must be an eight-digit hex number, e.g., FFAC0013"
|
275
|
-
raise ArgumentError, message unless value =~ /^[0-9A-F]{8}$/
|
276
|
-
end
|
277
|
-
|
278
|
-
def hex_string(value)
|
279
|
-
message = "Invalid #{name}: must be a string of hexadecimal numbers, e.g. FFA23C6E"
|
280
|
-
raise ArgumentError, message unless value =~ /^[0-9A-F]+$/
|
281
|
-
end
|
282
|
-
|
283
|
-
def integer(value)
|
284
|
-
message = "Invalid #{name}: must be an integer"
|
285
|
-
raise ArgumentError, message unless value.is_a?(Integer)
|
286
|
-
end
|
287
|
-
|
288
|
-
def positive_integer(value)
|
289
|
-
message = "Invalid #{name}: must be a positive integer"
|
290
|
-
raise ArgumentError, message unless value.is_a?(Integer) && value >= 0
|
291
|
-
end
|
292
|
-
|
293
|
-
def string(value)
|
294
|
-
message = "Invalid #{name}: must be a string"
|
295
|
-
raise ArgumentError, message if !value.is_a?(String) || value.length.zero?
|
296
|
-
end
|
297
|
-
|
298
|
-
def percentage(value)
|
299
|
-
message = "Invalid #{name}: must be a percentage"
|
300
|
-
raise ArgumentError, message unless value.is_a?(String) && value =~ /-?[0-9]+(\.[0-9]+)?%/ # Regex supplied in sec. 22.9.2.9 of Office Open XML docs
|
301
|
-
end
|
302
|
-
|
303
|
-
def on_or_off(value)
|
304
|
-
valid_in? value, [:on, :off]
|
305
|
-
end
|
306
|
-
|
307
|
-
def valid_theme_color(value)
|
308
|
-
valid_in? value, VALID_THEME_COLORS
|
309
|
-
end
|
310
|
-
|
311
|
-
def valid_type(value)
|
312
|
-
valid_in? value, VALID_TYPES
|
313
|
-
end
|
314
|
-
|
315
|
-
def valid_in?(value, list)
|
316
|
-
message = "Invalid #{name}: must be one of #{list.join(", ")} (was #{value.inspect})"
|
317
|
-
raise ArgumentError, message unless list.member?(value)
|
318
|
-
end
|
319
|
-
|
320
|
-
def matches?(value, regexp)
|
321
|
-
message = "Value does not match #{regexp}"
|
322
|
-
raise ArgumentError, message unless value =~ regexp
|
323
|
-
end
|
324
|
-
|
325
|
-
end
|
326
|
-
end
|
327
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module OpenXml
|
2
|
-
module Docx
|
3
|
-
module Elements
|
4
|
-
class Container < Element
|
5
|
-
include PropertyBuilder
|
6
|
-
|
7
|
-
attr_reader :children
|
8
|
-
|
9
|
-
def initialize
|
10
|
-
@children = []
|
11
|
-
end
|
12
|
-
|
13
|
-
def <<(child)
|
14
|
-
children << child
|
15
|
-
end
|
16
|
-
|
17
|
-
def to_xml(xml)
|
18
|
-
xml[namespace].public_send(tag, xml_attributes) {
|
19
|
-
property_xml(xml)
|
20
|
-
children.each { |child| child.to_xml(xml) }
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def properties_tag
|
27
|
-
self.class.properties_tag || default_properties_tag
|
28
|
-
end
|
29
|
-
|
30
|
-
def default_properties_tag
|
31
|
-
:"#{tag}Pr"
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
module OpenXml
|
2
|
-
module Docx
|
3
|
-
module Elements
|
4
|
-
class Element
|
5
|
-
include AttributeBuilder
|
6
|
-
|
7
|
-
class << self
|
8
|
-
attr_reader :property_name
|
9
|
-
attr_reader :namespace
|
10
|
-
|
11
|
-
def tag(*args)
|
12
|
-
@tag = args.first if args.any?
|
13
|
-
@tag
|
14
|
-
end
|
15
|
-
|
16
|
-
def name(*args)
|
17
|
-
@property_name = args.first if args.any?
|
18
|
-
@name
|
19
|
-
end
|
20
|
-
|
21
|
-
def namespace(*args)
|
22
|
-
@namespace = args.first if args.any?
|
23
|
-
@namespace
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
def tag
|
29
|
-
self.class.tag || default_tag
|
30
|
-
end
|
31
|
-
|
32
|
-
def name
|
33
|
-
self.class.property_name || default_name
|
34
|
-
end
|
35
|
-
|
36
|
-
def namespace
|
37
|
-
self.class.namespace || default_namespace
|
38
|
-
end
|
39
|
-
|
40
|
-
def to_xml(xml)
|
41
|
-
xml[namespace].public_send(tag, xml_attributes)
|
42
|
-
end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def default_tag
|
47
|
-
(class_name[0, 1].downcase + class_name[1..-1]).to_sym
|
48
|
-
end
|
49
|
-
|
50
|
-
def default_name
|
51
|
-
class_name.gsub(/(.)([A-Z])/, '\1_\2').downcase
|
52
|
-
end
|
53
|
-
|
54
|
-
def default_namespace
|
55
|
-
:w
|
56
|
-
end
|
57
|
-
|
58
|
-
def class_name
|
59
|
-
self.class.to_s.split(/::/).last
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
data/lib/openxml/drawingml.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module OpenXml
|
2
|
-
module DrawingML
|
3
|
-
end
|
4
|
-
end
|
5
|
-
|
6
|
-
# For now, we'll rely on Docx's basic implementations
|
7
|
-
require "openxml/docx/attribute_builder"
|
8
|
-
require "openxml/docx/property_builder"
|
9
|
-
require "openxml/docx/properties"
|
10
|
-
require "openxml/docx/elements"
|
11
|
-
require "openxml/docx/package"
|
12
|
-
require "openxml/docx/parts"
|
13
|
-
require "openxml/docx/section"
|
14
|
-
require "openxml/docx/style"
|
15
|
-
|
16
|
-
# And then add our own stuff
|
17
|
-
require "openxml/drawingml/elements"
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module OpenXml
|
2
|
-
module DrawingML
|
3
|
-
module Elements
|
4
|
-
end
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
require "openxml/docx/elements/element"
|
9
|
-
require "openxml/docx/elements/container"
|
10
|
-
require "openxml/docx/elements/text"
|
11
|
-
Dir.glob("#{File.join(File.dirname(__FILE__), "elements", "*.rb")}").each do |file|
|
12
|
-
require file
|
13
|
-
end
|