thinreports 0.7.7 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -6
- data/.travis.yml +4 -10
- data/CHANGELOG.md +220 -0
- data/Gemfile +3 -3
- data/MIT-LICENSE +1 -1
- data/README.md +286 -0
- data/Rakefile +38 -8
- data/examples/character_spacing/character_spacing.rb +8 -0
- data/examples/character_spacing/character_spacing.tlf +1 -0
- data/examples/dynamic_image/dynamic_image.rb +31 -0
- data/examples/dynamic_image/dynamic_image.tlf +1 -0
- data/{test/case → examples}/dynamic_image/img200x100.png +0 -0
- data/{test/case → examples}/dynamic_image/img50x50.png +0 -0
- data/examples/dynamic_style/dynamic_style.rb +150 -0
- data/examples/dynamic_style/dynamic_style.tlf +1 -0
- data/examples/dynamic_style/dynamic_style_in_list.tlf +1 -0
- data/{test/case → examples}/dynamic_style/image.png +0 -0
- data/examples/eudc/eudc.rb +20 -0
- data/examples/eudc/eudc.tlf +1 -0
- data/{test/case → examples}/eudc/eudc.ttf +0 -0
- data/{test/case → examples}/helper.rb +14 -12
- data/examples/hidden_shapes/hidden_shapes.rb +9 -0
- data/examples/hidden_shapes/hidden_shapes.tlf +1 -0
- data/examples/list_events/list_events.rb +59 -0
- data/examples/list_events/list_events_0_7_7.tlf +1 -0
- data/examples/list_events/list_events_0_8.tlf +1 -0
- data/{test/case → examples}/list_manual_generation/list_manual_generation.rb +4 -4
- data/examples/list_manual_generation/list_manual_generation.tlf +1 -0
- data/{test/case → examples}/list_page_number/list_page_number.rb +3 -3
- data/examples/list_page_number/list_page_number.tlf +1 -0
- data/examples/page_number/page_number.rb +33 -0
- data/examples/page_number/page_number.tlf +1 -0
- data/examples/password_setting/password_setting.rb +10 -0
- data/examples/password_setting/password_setting.tlf +1 -0
- data/examples/report_callbacks/report_callbacks.rb +31 -0
- data/examples/report_callbacks/report_callbacks.tlf +1 -0
- data/{test/case → examples}/single_line_tblock/single_line_tblock.rb +2 -2
- data/examples/single_line_tblock/single_line_tblock.tlf +1 -0
- data/examples/tblock_overflow/tblock_overflow.rb +20 -0
- data/examples/tblock_overflow/tblock_overflow.tlf +1 -0
- data/examples/tblock_styles/font_size.tlf +1 -0
- data/examples/tblock_styles/tblock_styles.rb +43 -0
- data/examples/tblock_styles/tblock_styles.tlf +1 -0
- data/examples/text_align/text_align.rb +8 -0
- data/examples/text_align/text_align.tlf +1 -0
- data/examples/typeB_page_size/B4_ISO.tlf +1 -0
- data/examples/typeB_page_size/B4_JIS.tlf +1 -0
- data/{test/case → examples}/typeB_page_size/typeB_page_size.rb +3 -3
- data/examples/word_wrap/word_wrap.rb +26 -0
- data/examples/word_wrap/word_wrap.tlf +1 -0
- data/{resources/fonts → fonts}/IPA_Font_License_Agreement_v1.0.txt +0 -0
- data/{resources/fonts → fonts}/ipag.ttf +0 -0
- data/{resources/fonts → fonts}/ipagp.ttf +0 -0
- data/{resources/fonts → fonts}/ipam.ttf +0 -0
- data/{resources/fonts → fonts}/ipamp.ttf +0 -0
- data/lib/thinreports.rb +14 -2
- data/lib/thinreports/config.rb +30 -10
- data/lib/thinreports/core/errors.rb +23 -20
- data/lib/thinreports/core/events.rb +18 -19
- data/lib/thinreports/core/format/base.rb +20 -20
- data/lib/thinreports/core/format/builder.rb +14 -22
- data/lib/thinreports/core/shape.rb +9 -13
- data/lib/thinreports/core/shape/base.rb +4 -5
- data/lib/thinreports/core/shape/base/interface.rb +15 -15
- data/lib/thinreports/core/shape/base/internal.rb +15 -20
- data/lib/thinreports/core/shape/basic.rb +1 -1
- data/lib/thinreports/core/shape/basic/block_format.rb +3 -4
- data/lib/thinreports/core/shape/basic/block_interface.rb +9 -4
- data/lib/thinreports/core/shape/basic/block_internal.rb +9 -10
- data/lib/thinreports/core/shape/basic/format.rb +11 -10
- data/lib/thinreports/core/shape/basic/interface.rb +3 -3
- data/lib/thinreports/core/shape/basic/internal.rb +4 -5
- data/lib/thinreports/core/shape/image_block.rb +1 -1
- data/lib/thinreports/core/shape/image_block/format.rb +5 -6
- data/lib/thinreports/core/shape/image_block/interface.rb +9 -7
- data/lib/thinreports/core/shape/image_block/internal.rb +5 -6
- data/lib/thinreports/core/shape/list.rb +1 -1
- data/lib/thinreports/core/shape/list/configuration.rb +30 -15
- data/lib/thinreports/core/shape/list/events.rb +11 -11
- data/lib/thinreports/core/shape/list/format.rb +27 -28
- data/lib/thinreports/core/shape/list/manager.rb +128 -95
- data/lib/thinreports/core/shape/list/page.rb +54 -50
- data/lib/thinreports/core/shape/list/page_state.rb +15 -16
- data/lib/thinreports/core/shape/list/section_format.rb +14 -15
- data/lib/thinreports/core/shape/list/section_interface.rb +15 -16
- data/lib/thinreports/core/shape/list/section_internal.rb +7 -8
- data/lib/thinreports/core/shape/list/store.rb +10 -11
- data/lib/thinreports/core/shape/manager.rb +1 -1
- data/lib/thinreports/core/shape/manager/format.rb +10 -11
- data/lib/thinreports/core/shape/manager/internal.rb +21 -20
- data/lib/thinreports/core/shape/manager/target.rb +63 -34
- data/lib/thinreports/core/shape/page_number.rb +1 -1
- data/lib/thinreports/core/shape/page_number/format.rb +3 -3
- data/lib/thinreports/core/shape/page_number/interface.rb +2 -2
- data/lib/thinreports/core/shape/page_number/internal.rb +3 -3
- data/lib/thinreports/core/shape/style.rb +1 -1
- data/lib/thinreports/core/shape/style/base.rb +29 -29
- data/lib/thinreports/core/shape/style/basic.rb +1 -1
- data/lib/thinreports/core/shape/style/graphic.rb +10 -25
- data/lib/thinreports/core/shape/style/text.rb +36 -30
- data/lib/thinreports/core/shape/text.rb +1 -1
- data/lib/thinreports/core/shape/text/format.rb +8 -9
- data/lib/thinreports/core/shape/text/interface.rb +2 -2
- data/lib/thinreports/core/shape/text/internal.rb +6 -7
- data/lib/thinreports/core/shape/text_block.rb +1 -1
- data/lib/thinreports/core/shape/text_block/format.rb +17 -18
- data/lib/thinreports/core/shape/text_block/formatter.rb +7 -8
- data/lib/thinreports/core/shape/text_block/formatter/basic.rb +13 -12
- data/lib/thinreports/core/shape/text_block/formatter/datetime.rb +8 -9
- data/lib/thinreports/core/shape/text_block/formatter/number.rb +11 -12
- data/lib/thinreports/core/shape/text_block/formatter/padding.rb +9 -32
- data/lib/thinreports/core/shape/text_block/interface.rb +2 -2
- data/lib/thinreports/core/shape/text_block/internal.rb +19 -20
- data/lib/thinreports/core/utils.rb +33 -32
- data/lib/thinreports/generator.rb +6 -8
- data/lib/thinreports/generator/base.rb +15 -24
- data/lib/thinreports/generator/configuration.rb +10 -9
- data/lib/thinreports/generator/pdf.rb +27 -30
- data/lib/thinreports/generator/pdf/configuration.rb +11 -6
- data/lib/thinreports/generator/pdf/document.rb +28 -28
- data/lib/thinreports/generator/pdf/document/draw_shape.rb +30 -31
- data/lib/thinreports/generator/pdf/document/font.rb +53 -44
- data/lib/thinreports/generator/pdf/document/graphics.rb +8 -9
- data/lib/thinreports/generator/pdf/document/graphics/attributes.rb +25 -25
- data/lib/thinreports/generator/pdf/document/graphics/basic.rb +25 -25
- data/lib/thinreports/generator/pdf/document/graphics/image.rb +15 -15
- data/lib/thinreports/generator/pdf/document/graphics/text.rb +40 -41
- data/lib/thinreports/generator/pdf/document/page.rb +20 -21
- data/lib/thinreports/generator/pdf/document/parse_color.rb +9 -10
- data/lib/thinreports/generator/pdf/document/parse_svg.rb +14 -15
- data/lib/thinreports/generator/pdf/drawer/base.rb +13 -14
- data/lib/thinreports/generator/pdf/drawer/list.rb +13 -14
- data/lib/thinreports/generator/pdf/drawer/list_section.rb +13 -14
- data/lib/thinreports/generator/pdf/drawer/page.rb +16 -17
- data/lib/thinreports/generator/pdf/prawn_ext.rb +17 -33
- data/lib/thinreports/layout.rb +2 -2
- data/lib/thinreports/layout/base.rb +22 -36
- data/lib/thinreports/layout/configuration.rb +11 -9
- data/lib/thinreports/layout/format.rb +26 -27
- data/lib/thinreports/layout/version.rb +8 -9
- data/lib/thinreports/report.rb +10 -14
- data/lib/thinreports/report/base.rb +104 -126
- data/lib/thinreports/report/events.rb +5 -5
- data/lib/thinreports/report/internal.rb +41 -33
- data/lib/thinreports/{core → report}/page.rb +38 -30
- data/lib/thinreports/version.rb +2 -3
- data/test/data/font.ttf +0 -0
- data/test/data/layout_block.tlf +1 -0
- data/test/data/layout_list.tlf +1 -0
- data/test/data/layout_list_noheader.tlf +1 -0
- data/test/data/layout_text1.tlf +1 -0
- data/test/data/layout_text2.tlf +1 -0
- data/test/test_helper.rb +74 -0
- data/test/{unit/tmp → tmp}/.gitkeep +0 -0
- data/test/unit/core/format/test_base.rb +14 -14
- data/test/unit/core/format/test_builder.rb +19 -23
- data/test/unit/core/shape/base/test_internal.rb +34 -37
- data/test/unit/core/shape/basic/test_basic_format.rb +4 -4
- data/test/unit/core/shape/basic/test_basic_interface.rb +15 -13
- data/test/unit/core/shape/basic/test_basic_internal.rb +19 -16
- data/test/unit/core/shape/basic/test_format.rb +4 -4
- data/test/unit/core/shape/basic/test_interface.rb +36 -46
- data/test/unit/core/shape/basic/test_internal.rb +23 -20
- data/test/unit/core/shape/image_block/test_format.rb +5 -5
- data/test/unit/core/shape/image_block/test_interface.rb +17 -16
- data/test/unit/core/shape/image_block/test_internal.rb +19 -16
- data/test/unit/core/shape/list/test_configuration.rb +45 -33
- data/test/unit/core/shape/list/test_events.rb +7 -7
- data/test/unit/core/shape/list/test_format.rb +16 -18
- data/test/unit/core/shape/list/test_manager.rb +5 -5
- data/test/unit/core/shape/list/test_page.rb +80 -22
- data/test/unit/core/shape/list/test_page_state.rb +12 -12
- data/test/unit/core/shape/list/test_section_format.rb +16 -17
- data/test/unit/core/shape/list/test_section_interface.rb +30 -22
- data/test/unit/core/shape/list/test_section_internal.rb +21 -19
- data/test/unit/core/shape/list/test_store.rb +7 -7
- data/test/unit/core/shape/manager/test_format.rb +11 -15
- data/test/unit/core/shape/manager/test_internal.rb +9 -9
- data/test/unit/core/shape/manager/test_target.rb +85 -57
- data/test/unit/core/shape/page_number/test_format.rb +4 -4
- data/test/unit/core/shape/page_number/test_interface.rb +11 -8
- data/test/unit/core/shape/page_number/test_internal.rb +5 -5
- data/test/unit/core/shape/styles/test_base.rb +9 -9
- data/test/unit/core/shape/styles/test_basic.rb +5 -5
- data/test/unit/core/shape/styles/test_graphic.rb +19 -33
- data/test/unit/core/shape/styles/test_text.rb +18 -7
- data/test/unit/core/shape/text/test_format.rb +6 -6
- data/test/unit/core/shape/text/test_internal.rb +11 -12
- data/test/unit/core/shape/text_block/formatter/test_basic.rb +16 -16
- data/test/unit/core/shape/text_block/formatter/test_datetime.rb +4 -4
- data/test/unit/core/shape/text_block/formatter/test_number.rb +34 -34
- data/test/unit/core/shape/text_block/formatter/test_padding.rb +44 -44
- data/test/unit/core/shape/text_block/test_format.rb +8 -8
- data/test/unit/core/shape/text_block/test_formatter.rb +17 -17
- data/test/unit/core/shape/text_block/test_interface.rb +37 -20
- data/test/unit/core/shape/text_block/test_internal.rb +38 -38
- data/test/unit/core/test_events.rb +5 -5
- data/test/unit/core/test_shape.rb +6 -6
- data/test/unit/core/test_utils.rb +68 -0
- data/test/unit/generator/pdf/document/graphics/test_attributes.rb +4 -4
- data/test/unit/generator/pdf/document/graphics/test_text.rb +60 -53
- data/test/unit/generator/pdf/document/test_draw_shape.rb +9 -7
- data/test/unit/generator/pdf/document/test_font.rb +79 -58
- data/test/unit/generator/pdf/document/test_graphics.rb +18 -19
- data/test/unit/generator/pdf/document/test_page.rb +44 -45
- data/test/unit/generator/pdf/document/test_parse_color.rb +5 -5
- data/test/unit/generator/pdf/test_configuration.rb +16 -9
- data/test/unit/generator/pdf/test_document.rb +8 -16
- data/test/unit/generator/test_base.rb +31 -42
- data/test/unit/generator/test_configuration.rb +6 -6
- data/test/unit/generator/test_pdf.rb +17 -14
- data/test/unit/layout/test_base.rb +34 -79
- data/test/unit/layout/test_configuration.rb +12 -37
- data/test/unit/layout/test_format.rb +36 -39
- data/test/unit/layout/test_version.rb +4 -4
- data/test/unit/report/test_base.rb +134 -213
- data/test/unit/report/test_events.rb +4 -4
- data/test/unit/report/test_internal.rb +84 -86
- data/test/unit/test_config.rb +31 -12
- data/test/unit/test_layout.rb +7 -7
- data/test/unit/test_report.rb +12 -24
- data/thinreports.gemspec +18 -22
- metadata +101 -200
- data/LICENSE +0 -1
- data/README.rdoc +0 -166
- data/doc/yardoc_templates/default/layout/html/footer.erb +0 -10
- data/lib/thinreports/core.rb +0 -20
- data/lib/thinreports/core/ext.rb +0 -5
- data/lib/thinreports/core/ext/array.rb +0 -19
- data/lib/thinreports/core/ext/hash.rb +0 -19
- data/lib/thinreports/core/ext/object.rb +0 -25
- data/lib/thinreports/core/format.rb +0 -14
- data/lib/thinreports/core/ordered_hash.rb +0 -39
- data/lib/thinreports/generator/pdf/drawer.rb +0 -16
- data/tasks/doc.rake +0 -12
- data/tasks/test.rake +0 -56
- data/test/benchmark/basic_estimate.tlf +0 -1
- data/test/benchmark/bench_basic_estimate.rb +0 -95
- data/test/case/character_spacing/character_spacing.rb +0 -8
- data/test/case/character_spacing/character_spacing.tlf +0 -1
- data/test/case/dynamic_image/dynamic_image.rb +0 -41
- data/test/case/dynamic_image/dynamic_image.tlf +0 -1
- data/test/case/dynamic_style/dynamic_style.rb +0 -154
- data/test/case/dynamic_style/dynamic_style.tlf +0 -1
- data/test/case/dynamic_style/dynamic_style_in_list.tlf +0 -1
- data/test/case/eudc/eudc.rb +0 -20
- data/test/case/eudc/eudc.tlf +0 -1
- data/test/case/hidden_shapes/hidden_shapes.rb +0 -9
- data/test/case/hidden_shapes/hidden_shapes.tlf +0 -1
- data/test/case/list_events/list_events.rb +0 -32
- data/test/case/list_events/list_events.tlf +0 -1
- data/test/case/list_manual_generation/list_manual_generation.tlf +0 -1
- data/test/case/list_page_number/list_page_number.tlf +0 -1
- data/test/case/page_number/page_number.rb +0 -33
- data/test/case/page_number/page_number.tlf +0 -1
- data/test/case/password_setting/password_setting.rb +0 -10
- data/test/case/password_setting/password_setting.tlf +0 -1
- data/test/case/single_line_tblock/single_line_tblock.tlf +0 -1
- data/test/case/tblock_overflow/tblock_overflow.rb +0 -20
- data/test/case/tblock_overflow/tblock_overflow.tlf +0 -1
- data/test/case/tblock_styles/tblock_styles.rb +0 -27
- data/test/case/tblock_styles/tblock_styles.tlf +0 -1
- data/test/case/text_align/text_align.rb +0 -8
- data/test/case/text_align/text_align.tlf +0 -1
- data/test/case/typeB_page_size/B4_ISO.tlf +0 -1
- data/test/case/typeB_page_size/B4_JIS.tlf +0 -1
- data/test/case/word_wrap/word_wrap.rb +0 -26
- data/test/case/word_wrap/word_wrap.tlf +0 -1
- data/test/unit/core/ext/array_spec.rb +0 -29
- data/test/unit/core/ext/hash_spec.rb +0 -29
- data/test/unit/core/ext/object_spec.rb +0 -30
- data/test/unit/core/ordered_hash_spec.rb +0 -51
- data/test/unit/core/shape/base/test_interface.rb +0 -52
- data/test/unit/core/utils_spec.rb +0 -56
- data/test/unit/data/basic_layout1.tlf +0 -1
- data/test/unit/data/basic_layout2.tlf +0 -1
- data/test/unit/data/basic_list_layout.tlf +0 -1
- data/test/unit/data/basic_list_noheader_layout.tlf +0 -1
- data/test/unit/helper.rb +0 -87
@@ -1 +0,0 @@
|
|
1
|
-
{"version":"0.7.6","finger-print":2040879295,"config":{"title":"","option":{},"page":{"paper-type":"A4","orientation":"portrait","margin-top":"20","margin-bottom":"20","margin-left":"20","margin-right":"20"}},"svg":"<svg width=\"595.2\" height=\"841.8\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\" viewBox=\"0 0 595.2 841.8\"><g class=\"canvas\"><!--SHAPE{\"type\":\"s-tblock\",\"id\":\"single_none\",\"display\":\"true\",\"desc\":null,\"multiple\":\"false\",\"valign\":\"\",\"line-height\":\"\",\"box\":{\"x\":33.1,\"y\":101,\"width\":210.1,\"height\":17},\"format\":{\"base\":\"\",\"type\":\"\"},\"value\":\"\",\"ref-id\":\"\",\"overflow\":\"expand\",\"word-wrap\":\"none\",\"svg\":{\"tag\":\"text\",\"attrs\":{\"x\":33.1,\"y\":113.9,\"xml:space\":\"preserve\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"kerning\":\"auto\",\"id\":\"goog_478710130\",\"fill\":\"#000000\",\"fill-opacity\":\"1\",\"font-size\":\"18\",\"font-family\":\"Helvetica\",\"font-weight\":\"normal\",\"font-style\":\"normal\",\"text-anchor\":\"start\",\"text-decoration\":\"none\"}}}SHAPE--><!--LAYOUT<g xmlns=\"http://www.w3.org/2000/svg\" class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"false\" id=\"goog_478710130\" x-id=\"single_none\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"210.1\" x-height=\"17\" x-left=\"33.1\" x-top=\"101\" x-overflow=\"expand\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"210.1\" height=\"17\" x=\"33.1\" y=\"101\"/><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"35.1\" y=\"112\">single_none</text></g>LAYOUT--><!--SHAPE{\"type\":\"s-tblock\",\"id\":\"multiple_none\",\"display\":\"true\",\"desc\":null,\"multiple\":\"true\",\"valign\":\"\",\"line-height\":\"\",\"box\":{\"x\":290.2,\"y\":101.9,\"width\":259.1,\"height\":105.1},\"format\":{\"base\":\"\",\"type\":\"\"},\"value\":\"\",\"ref-id\":\"\",\"overflow\":\"\",\"word-wrap\":\"none\",\"svg\":{\"tag\":\"textArea\",\"attrs\":{\"x\":290.2,\"y\":101.8,\"width\":259.1,\"height\":105.1,\"xml:space\":\"preserve\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"kerning\":\"auto\",\"id\":\"goog_478710131\",\"fill\":\"#000000\",\"fill-opacity\":\"1\",\"font-size\":\"18\",\"font-family\":\"Helvetica\",\"font-weight\":\"normal\",\"font-style\":\"normal\",\"text-anchor\":\"start\",\"text-decoration\":\"none\"}}}SHAPE--><!--LAYOUT<g xmlns=\"http://www.w3.org/2000/svg\" class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"true\" id=\"goog_478710131\" x-id=\"multiple_none\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"259.1\" x-height=\"105.1\" x-left=\"290.2\" x-top=\"101.9\" x-word-wrap=\"none\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"259.1\" height=\"105.1\" x=\"290.2\" y=\"101.9\"/><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"292.2\" y=\"112.9\">multiple_none</text></g>LAYOUT--><rect stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" fill-opacity=\"1\" class=\"s-rect\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" rx=\"0\" ry=\"0\" id=\"goog_1119358811\" width=\"259.1\" height=\"105.1\" x=\"290.2\" y=\"101.9\"/><!--SHAPE{\"type\":\"s-tblock\",\"id\":\"multiple_break_word\",\"display\":\"true\",\"desc\":null,\"multiple\":\"true\",\"valign\":\"\",\"line-height\":\"\",\"box\":{\"x\":290.2,\"y\":232.9,\"width\":259.1,\"height\":105.1},\"format\":{\"base\":\"\",\"type\":\"\"},\"value\":\"\",\"ref-id\":\"\",\"overflow\":\"truncate\",\"word-wrap\":\"break-word\",\"svg\":{\"tag\":\"textArea\",\"attrs\":{\"x\":290.2,\"y\":232.8,\"width\":259.1,\"height\":105.1,\"xml:space\":\"preserve\",\"kerning\":\"auto\",\"id\":\"goog_1119358812\",\"fill\":\"#000000\",\"fill-opacity\":\"1\",\"font-size\":\"18\",\"font-family\":\"Helvetica\",\"font-weight\":\"normal\",\"font-style\":\"normal\",\"text-decoration\":\"none\",\"text-anchor\":\"start\"}}}SHAPE--><!--LAYOUT<g xmlns=\"http://www.w3.org/2000/svg\" class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"true\" id=\"goog_1119358812\" x-id=\"multiple_break_word\" x-width=\"259.1\" x-height=\"105.1\" x-left=\"290.2\" x-top=\"232.9\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" x-overflow=\"truncate\" x-word-wrap=\"break-word\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"259.1\" height=\"105.1\" x=\"290.2\" y=\"232.9\"/><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"292.2\" y=\"243.9\">multiple_break_word</text></g>LAYOUT--><rect stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" fill-opacity=\"1\" class=\"s-rect\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" rx=\"0\" ry=\"0\" id=\"goog_1119358813\" width=\"259.1\" height=\"105.1\" x=\"290.2\" y=\"232.9\"/><line stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" class=\"s-line\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" id=\"goog_1119358814\" x1=\"251.2\" x2=\"251.2\" y1=\"100\" y2=\"379.1\"/><!--SHAPE{\"type\":\"s-tblock\",\"id\":\"single_break_word\",\"display\":\"true\",\"desc\":null,\"multiple\":\"false\",\"valign\":\"\",\"line-height\":\"\",\"box\":{\"x\":35,\"y\":235,\"width\":210.1,\"height\":17},\"format\":{\"base\":\"\",\"type\":\"\"},\"value\":\"\",\"ref-id\":\"\",\"overflow\":\"expand\",\"word-wrap\":\"break-word\",\"svg\":{\"tag\":\"text\",\"attrs\":{\"x\":35,\"y\":247.9,\"xml:space\":\"preserve\",\"kerning\":\"auto\",\"id\":\"goog_1119358815\",\"fill\":\"#000000\",\"fill-opacity\":\"1\",\"font-size\":\"18\",\"font-family\":\"Helvetica\",\"font-weight\":\"normal\",\"font-style\":\"normal\",\"text-decoration\":\"none\",\"text-anchor\":\"start\"}}}SHAPE--><!--LAYOUT<g xmlns=\"http://www.w3.org/2000/svg\" class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"false\" id=\"goog_1119358815\" x-id=\"single_break_word\" x-width=\"210.1\" x-height=\"17\" x-left=\"35\" x-top=\"235\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" x-overflow=\"expand\" x-word-wrap=\"break-word\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"210.1\" height=\"17\" x=\"35\" y=\"235\"/><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"37\" y=\"246\">single_break_word</text></g>LAYOUT--><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" id=\"goog_1119358816\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"58\" x-height=\"17\" x-left=\"32.1\" x-top=\"36\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"58\" height=\"17\" x=\"32.1\" y=\"36\"/><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"32.1\" y=\"48.9\">Locale:</text></g><!--SHAPE{\"type\":\"s-tblock\",\"id\":\"locale\",\"display\":\"true\",\"desc\":null,\"multiple\":\"false\",\"valign\":\"\",\"line-height\":\"\",\"box\":{\"x\":100,\"y\":36,\"width\":145.1,\"height\":17},\"format\":{\"base\":\"\",\"type\":\"\"},\"value\":\"\",\"ref-id\":\"\",\"overflow\":\"\",\"word-wrap\":\"none\",\"svg\":{\"tag\":\"text\",\"attrs\":{\"x\":100,\"y\":48.9,\"xml:space\":\"preserve\",\"kerning\":\"auto\",\"id\":\"goog_1119358817\",\"fill\":\"#000000\",\"fill-opacity\":\"1\",\"font-size\":\"18\",\"font-family\":\"Helvetica\",\"font-weight\":\"normal\",\"font-style\":\"normal\",\"text-anchor\":\"start\",\"text-decoration\":\"none\"}}}SHAPE--><!--LAYOUT<g xmlns=\"http://www.w3.org/2000/svg\" class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"false\" id=\"goog_1119358817\" x-id=\"locale\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"145.1\" x-height=\"17\" x-left=\"100\" x-top=\"36\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"145.1\" height=\"17\" x=\"100\" y=\"36\"/><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"102\" y=\"47\">locale</text></g>LAYOUT--><rect stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" fill-opacity=\"1\" class=\"s-rect\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" rx=\"0\" ry=\"0\" id=\"goog_1119358818\" width=\"210.1\" height=\"17\" x=\"33.1\" y=\"101\"/><rect stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" fill-opacity=\"1\" class=\"s-rect\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" rx=\"0\" ry=\"0\" id=\"goog_1119358820\" width=\"210.1\" height=\"17\" x=\"34.1\" y=\"235\"/></g></svg>","state":{"layout-guide":[{"type":"x","position":59.5},{"type":"y","position":61}]}}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'test/unit/helper'
|
4
|
-
|
5
|
-
describe 'Array#simple_deep_copy' do
|
6
|
-
|
7
|
-
it 'should original not be same as copied' do
|
8
|
-
original = []
|
9
|
-
original.wont_be_same_as original.simple_deep_copy
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should not immutable elements at fist node has been cloned' do
|
13
|
-
original = ['element', Time.now]
|
14
|
-
copied = original.simple_deep_copy
|
15
|
-
|
16
|
-
original.each_with_index do |o, i|
|
17
|
-
o.wont_be_same_as copied[i]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should immutable objects at first node returns the raw' do
|
22
|
-
original = [nil, 1, 100, :symbol]
|
23
|
-
copied = original.simple_deep_copy
|
24
|
-
|
25
|
-
original.each_with_index do |o, i|
|
26
|
-
o.must_be_same_as copied[i]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'test/unit/helper'
|
4
|
-
|
5
|
-
describe 'Hash#simple_deep_copy' do
|
6
|
-
|
7
|
-
it 'should original not be same as copied' do
|
8
|
-
original = {}
|
9
|
-
original.wont_be_same_as original.simple_deep_copy
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should not immutable elements at fist node has been cloned' do
|
13
|
-
original = {:a => 'string', :b => Time.now}
|
14
|
-
copied = original.simple_deep_copy
|
15
|
-
|
16
|
-
original.each do |k, v|
|
17
|
-
v.wont_be_same_as copied[k]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should immutable objects at first node returns the raw' do
|
22
|
-
original = {:a => nil, :b => 1, :c => 100, :d => :symbol}
|
23
|
-
copied = original.simple_deep_copy
|
24
|
-
|
25
|
-
original.each do |k, v|
|
26
|
-
v.must_be_same_as copied[k]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'test/unit/helper'
|
4
|
-
|
5
|
-
describe 'String#blank?' do
|
6
|
-
it 'should return the true value if self is empty' do
|
7
|
-
''.blank?.must_equal true
|
8
|
-
"".blank?.must_equal true
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should return the false value if self is not empty' do
|
12
|
-
[' ', ' ', 'string', '日本語'].each do |v|
|
13
|
-
v.blank?.must_equal false
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe 'NilClass#blank?' do
|
19
|
-
it 'should always return the true value' do
|
20
|
-
nil.blank?.must_equal true
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe 'OtherClasses#blank?' do
|
25
|
-
it 'should always return the false value' do
|
26
|
-
[0, 1, -1, 9.99, true, false, ::Time.now].each do |v|
|
27
|
-
v.blank?.must_equal false
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'test/unit/helper'
|
4
|
-
|
5
|
-
include ThinReports::TestHelpers
|
6
|
-
|
7
|
-
describe 'OrderedHash#[]=' do
|
8
|
-
before do
|
9
|
-
skip_if_ruby19
|
10
|
-
@ohash = ThinReports::Core::OrderedHash.new
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should be given keys in stored in the keys array' do
|
14
|
-
@ohash[:foo] = 'foo'
|
15
|
-
@ohash[:hoge] = 'hoge'
|
16
|
-
@ohash.instance_variable_get(:@keys).must_equal [:foo, :hoge]
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should properly set the given value' do
|
20
|
-
@ohash[:foo] = 'foo'
|
21
|
-
@ohash[:foo].must_equal 'foo'
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should not exist a duplicate key in store of key' do
|
25
|
-
@ohash[:foo] = 'foo1'
|
26
|
-
@ohash[:foo] = 'foo2'
|
27
|
-
@ohash.instance_variable_get(:@keys).uniq.size.must_equal 1
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe 'OrderedHash#each_key' do
|
32
|
-
it 'should get the key in the order registerd' do
|
33
|
-
skip_if_ruby19
|
34
|
-
|
35
|
-
ohash = ThinReports::Core::OrderedHash.new
|
36
|
-
(keys = [:key3, :key1, :key2]).each {|key| ohash[key] = key.to_s }
|
37
|
-
|
38
|
-
i = 0
|
39
|
-
ohash.each_key do |key|
|
40
|
-
key.must_equal keys[i]; i += 1
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe 'OrderedHash on Ruby 1.9' do
|
46
|
-
it 'should same Hash class on Ruby 1.9' do
|
47
|
-
skip_if_ruby18
|
48
|
-
|
49
|
-
ThinReports::Core::OrderedHash.must_be_same_as ::Hash
|
50
|
-
end
|
51
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'test/unit/helper'
|
4
|
-
|
5
|
-
class ThinReports::Core::Shape::Base::TestInterface < MiniTest::Unit::TestCase
|
6
|
-
include ThinReports::TestHelpers
|
7
|
-
|
8
|
-
class TestInterface < ThinReports::Core::Shape::Base::Interface
|
9
|
-
internal_delegators :m1, :m2
|
10
|
-
|
11
|
-
# For testing
|
12
|
-
# Instead, #internal method is overwritten by flexmock.
|
13
|
-
def init_internal(parent, format)
|
14
|
-
# Nothing to do
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def setup
|
19
|
-
internal = flexmock(:m1 => 'm1', :m2 => 'm2')
|
20
|
-
@interface = TestInterface.new(flexmock('parent'), flexmock('format'))
|
21
|
-
|
22
|
-
flexmock(@interface, :internal => internal)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_internal_delegators_macro
|
26
|
-
assert_respond_to @interface, :m1
|
27
|
-
assert_respond_to @interface, :m2
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_methods_delegated_from_internal
|
31
|
-
assert_same @interface.m1, @interface.internal.m1
|
32
|
-
assert_same @interface.m2, @interface.internal.m2
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_forced_to_specify_an_internal_argument
|
36
|
-
internal = flexmock('forced_internal')
|
37
|
-
interface = TestInterface.new(flexmock('parent'), flexmock('format'),
|
38
|
-
internal)
|
39
|
-
|
40
|
-
assert_same internal, interface.internal
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_copy
|
44
|
-
flexmock(@interface.internal, :copy => flexmock('new_internal'),
|
45
|
-
:format => flexmock('format'))
|
46
|
-
|
47
|
-
new_interface = @interface.copy(flexmock('new_parent'))
|
48
|
-
|
49
|
-
refute_same new_interface, @interface
|
50
|
-
assert_instance_of TestInterface, new_interface
|
51
|
-
end
|
52
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'test/unit/helper'
|
4
|
-
|
5
|
-
include ThinReports::TestHelpers
|
6
|
-
|
7
|
-
describe '#block_exec_on' do
|
8
|
-
it 'should return raw context if not given a block' do
|
9
|
-
expected = '123'
|
10
|
-
block_exec_on(expected).must_be_same_as expected
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should be run correctly without receiver if no block argument' do
|
14
|
-
block_exec_on('123', &proc{ reverse! }).must_equal '321'
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should be run correctly with an receiver if block has an argument' do
|
18
|
-
block_exec_on([2, 1, 3], &proc{ |a| a.sort! }).must_equal [1, 2, 3]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe '#ruby_18' do
|
23
|
-
it 'should not be run and return false if ruby version more than 1.8' do
|
24
|
-
skip_if_ruby18
|
25
|
-
|
26
|
-
ruby_18 {
|
27
|
-
flunk '#ruby_18 should not be executed!'
|
28
|
-
}.must_equal false
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should be run if ruby version less than 1.9' do
|
32
|
-
skip_if_ruby19
|
33
|
-
|
34
|
-
ruby_18 {
|
35
|
-
pass '#ruby_18 was executed correctly!'; true
|
36
|
-
}.must_equal true
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe '#ruby_19' do
|
41
|
-
it 'should not be run and return false if ruby version less than 1.9' do
|
42
|
-
skip_if_ruby19
|
43
|
-
|
44
|
-
ruby_19 {
|
45
|
-
flunk '#ruby_19 should not be executed!'
|
46
|
-
}.must_equal false
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'should be run if ruby version more than 1.9' do
|
50
|
-
skip_if_ruby18
|
51
|
-
|
52
|
-
ruby_19 {
|
53
|
-
pass '#ruby_19 was executed correctly!'; true
|
54
|
-
}.must_equal true
|
55
|
-
end
|
56
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":"0.6.0.pre3","finger-print":-164125034,"config":{"title":"Basic Layout","option":{},"page":{"paper-type":"A4","orientation":"portrait","margin-top":"20","margin-bottom":"20","margin-left":"20","margin-right":"20"}},"svg":"<svg width=\"595.2\" height=\"841.8\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\" viewBox=\"0 0 595.2 841.8\"><defs></defs><g class=\"canvas\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" letter-spacing=\"normal\" x-display=\"true\" x-id=\"\" font-size=\"36\" font-family=\"Times New Roman\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"middle\" text-decoration=\"none\" x-width=\"206\" x-height=\"100\" x-left=\"197.6\" x-top=\"370.9\" x-valign=\"center\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"206\" height=\"100\" x=\"197.6\" y=\"370.9\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"300.6\" y=\"428.4\">Basic Layout1</text></g></g></svg>"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":"0.6.0.pre3","finger-print":-312717403,"config":{"title":"Basic Layout2","option":{},"page":{"paper-type":"A4","orientation":"portrait","margin-top":"20","margin-bottom":"20","margin-left":"20","margin-right":"20"}},"svg":"<svg width=\"595.2\" height=\"841.8\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\" viewBox=\"0 0 595.2 841.8\"><defs></defs><g class=\"canvas\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" letter-spacing=\"normal\" x-display=\"true\" x-id=\"\" stroke=\"none\" font-weight=\"normal\" font-style=\"normal\" font-family=\"Times New Roman\" font-size=\"36\" text-anchor=\"middle\" x-valign=\"center\" text-decoration=\"none\" x-width=\"206\" x-height=\"100\" x-left=\"197.6\" x-top=\"370.9\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"206\" height=\"100\" x=\"197.6\" y=\"370.9\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"300.6\" y=\"428.4\">Basic Layout2</text></g></g></svg>"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":"0.7.0","finger-print":651703864,"config":{"title":"Basic List Layout","option":{},"page":{"paper-type":"A4","orientation":"portrait","margin-top":"20","margin-bottom":"20","margin-left":"20","margin-right":"20"}},"svg":"<svg width=\"595.2\" height=\"841.8\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\" viewBox=\"0 0 595.2 841.8\"><g class=\"canvas\"><!--SHAPE{\"type\":\"s-list\",\"id\":\"list\",\"display\":\"true\",\"desc\":null,\"footer\":{\"height\":55.5,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" stroke=\\\"none\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" font-family=\\\"Helvetica\\\" font-size=\\\"18\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"53\\\" x-height=\\\"18\\\" x-left=\\\"271.1\\\" x-top=\\\"318.3\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"53\\\" height=\\\"18\\\" x=\\\"271.1\\\" y=\\\"318.3\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"271.1\\\" y=\\\"335.3\\\">Footer</text></g>\"},\"translate\":{\"x\":0,\"y\":-218.5}},\"footer-enabled\":\"true\",\"page-footer\":{\"height\":55.5,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" stroke=\\\"none\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" font-family=\\\"Helvetica\\\" font-size=\\\"18\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"99\\\" x-height=\\\"18\\\" x-left=\\\"248.1\\\" x-top=\\\"262.8\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"99\\\" height=\\\"18\\\" x=\\\"248.1\\\" y=\\\"262.8\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"248.1\\\" y=\\\"279.8\\\">Page Footer</text></g>\"},\"translate\":{\"x\":0,\"y\":-163}},\"page-footer-enabled\":\"true\",\"detail\":{\"height\":50,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" font-size=\\\"18\\\" font-family=\\\"Helvetica\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"47\\\" x-height=\\\"18\\\" x-left=\\\"274.1\\\" x-top=\\\"186\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"47\\\" height=\\\"18\\\" x=\\\"274.1\\\" y=\\\"186\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"274.1\\\" y=\\\"203\\\">Detail</text></g>\"},\"translate\":{\"x\":0,\"y\":-89}},\"header\":{\"height\":61,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" font-size=\\\"18\\\" font-family=\\\"Helvetica\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"60\\\" x-height=\\\"18\\\" x-left=\\\"267.6\\\" x-top=\\\"116\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"60\\\" height=\\\"18\\\" x=\\\"267.6\\\" y=\\\"116\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"267.6\\\" y=\\\"133\\\">Header</text></g>\"},\"translate\":{\"x\":0,\"y\":-76}},\"header-enabled\":\"true\",\"svg\":{\"tag\":\"g\",\"attrs\":{}},\"content-height\":261.1,\"page-break\":\"true\"}SHAPE--><!--LAYOUT<g class=\"s-list\" x-id=\"list\" x-header-enabled=\"true\" x-page-footer-enabled=\"true\" x-footer-enabled=\"true\" x-changing-page=\"true\" x-display=\"true\" width=\"555.2\" height=\"322.1\" x=\"20\" y=\"20\"><g class=\"s-list-header\" transform=\"translate(0,-76) rotate(0 0 0)\" x-top=\"20\" x-height=\"61\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"60\" x-height=\"18\" x-left=\"267.6\" x-top=\"116\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"60\" height=\"18\" x=\"267.6\" y=\"116\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"267.6\" y=\"133\">Header</text></g></g><g class=\"s-list-detail\" transform=\"translate(0,-89) rotate(0 0 0)\" x-top=\"81\" x-height=\"50\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"47\" x-height=\"18\" x-left=\"274.1\" x-top=\"186\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"47\" height=\"18\" x=\"274.1\" y=\"186\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"274.1\" y=\"203\">Detail</text></g></g><g class=\"s-list-page-footer\" transform=\"translate(0,-113) rotate(0 0 0)\" x-top=\"131\" x-height=\"55.5\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" stroke=\"none\" font-weight=\"normal\" font-style=\"normal\" font-family=\"Helvetica\" font-size=\"18\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"99\" x-height=\"18\" x-left=\"248.1\" x-top=\"262.8\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"99\" height=\"18\" x=\"248.1\" y=\"262.8\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"248.1\" y=\"279.8\">Page Footer</text></g></g><g class=\"s-list-footer\" transform=\"translate(0,-113) rotate(0 0 0)\" x-top=\"186.5\" x-height=\"55.5\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" stroke=\"none\" font-weight=\"normal\" font-style=\"normal\" font-family=\"Helvetica\" font-size=\"18\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"53\" x-height=\"18\" x-left=\"271.1\" x-top=\"318.3\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"53\" height=\"18\" x=\"271.1\" y=\"318.3\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"271.1\" y=\"335.3\">Footer</text></g></g><text class=\"s-list-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"22\" y=\"30.8\">list</text><rect stroke-dasharray=\"5\" stroke=\"#BBBBBB\" stroke-width=\"1\" fill=\"#FFFFFF\" fill-opacity=\"0\" class=\"s-list-face\" width=\"555.2\" height=\"322.1\" x=\"20\" y=\"20\"></rect></g>LAYOUT--></g></svg>"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":"0.7.0","finger-print":644609150,"config":{"title":"Basic List (No Header) Layout","option":{},"page":{"paper-type":"A4","orientation":"portrait","margin-top":"20","margin-bottom":"20","margin-left":"20","margin-right":"20"}},"svg":"<svg width=\"595.2\" height=\"841.8\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\" viewBox=\"0 0 595.2 841.8\"><g class=\"canvas\"><!--SHAPE{\"type\":\"s-list\",\"id\":\"default\",\"display\":\"true\",\"desc\":null,\"footer\":{\"height\":55.5,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" stroke=\\\"none\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" font-family=\\\"Helvetica\\\" font-size=\\\"18\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"53\\\" x-height=\\\"18\\\" x-left=\\\"271.1\\\" x-top=\\\"318.3\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"53\\\" height=\\\"18\\\" x=\\\"271.1\\\" y=\\\"318.3\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"271.1\\\" y=\\\"335.3\\\">Footer</text></g>\"},\"translate\":{\"x\":0,\"y\":-279.5}},\"footer-enabled\":\"true\",\"page-footer\":{\"height\":55.5,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" stroke=\\\"none\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" font-family=\\\"Helvetica\\\" font-size=\\\"18\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"99\\\" x-height=\\\"18\\\" x-left=\\\"248.1\\\" x-top=\\\"262.8\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"99\\\" height=\\\"18\\\" x=\\\"248.1\\\" y=\\\"262.8\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"248.1\\\" y=\\\"279.8\\\">Page Footer</text></g>\"},\"translate\":{\"x\":0,\"y\":-224}},\"page-footer-enabled\":\"true\",\"detail\":{\"height\":50,\"svg\":{\"tag\":\"g\",\"content\":\"<g class=\\\"s-text\\\" stroke-width=\\\"0\\\" fill=\\\"#000000\\\" fill-opacity=\\\"1\\\" kerning=\\\"auto\\\" x-display=\\\"true\\\" x-id=\\\"\\\" font-size=\\\"18\\\" font-family=\\\"Helvetica\\\" font-weight=\\\"normal\\\" font-style=\\\"normal\\\" text-anchor=\\\"start\\\" text-decoration=\\\"none\\\" x-width=\\\"47\\\" x-height=\\\"18\\\" x-left=\\\"274.1\\\" x-top=\\\"186\\\"><rect class=\\\"s-text-box\\\" stroke=\\\"none\\\" fill=\\\"#000000\\\" fill-opacity=\\\"0.001\\\" width=\\\"47\\\" height=\\\"18\\\" x=\\\"274.1\\\" y=\\\"186\\\"></rect><text class=\\\"s-text-l0\\\" xml:space=\\\"preserve\\\" stroke=\\\"none\\\" fill=\\\"inherit\\\" fill-opacity=\\\"1\\\" text-decoration=\\\"none\\\" x=\\\"274.1\\\" y=\\\"203\\\">Detail</text></g>\"},\"translate\":{\"x\":0,\"y\":-150}},\"header\":{},\"header-enabled\":\"false\",\"svg\":{\"tag\":\"g\",\"attrs\":{}},\"content-height\":322.1,\"page-break\":\"true\"}SHAPE--><!--LAYOUT<g class=\"s-list\" x-id=\"default\" x-header-enabled=\"false\" x-page-footer-enabled=\"true\" x-footer-enabled=\"true\" x-changing-page=\"true\" x-display=\"true\" width=\"555.2\" height=\"322.1\" x=\"20\" y=\"20\"><g class=\"s-list-header\" transform=\"translate(0,-76) rotate(0 0 0)\" x-top=\"20\" x-height=\"0\" display=\"none\"></g><g class=\"s-list-detail\" transform=\"translate(0,-150) rotate(0 0 0)\" x-top=\"20\" x-height=\"50\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"47\" x-height=\"18\" x-left=\"274.1\" x-top=\"186\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"47\" height=\"18\" x=\"274.1\" y=\"186\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"274.1\" y=\"203\">Detail</text></g></g><g class=\"s-list-page-footer\" transform=\"translate(0,-174) rotate(0 0 0)\" x-top=\"70\" x-height=\"55.5\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" stroke=\"none\" font-weight=\"normal\" font-style=\"normal\" font-family=\"Helvetica\" font-size=\"18\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"99\" x-height=\"18\" x-left=\"248.1\" x-top=\"262.8\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"99\" height=\"18\" x=\"248.1\" y=\"262.8\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"248.1\" y=\"279.8\">Page Footer</text></g></g><g class=\"s-list-footer\" transform=\"translate(0,-174) rotate(0 0 0)\" x-top=\"125.5\" x-height=\"55.5\"><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" stroke=\"none\" font-weight=\"normal\" font-style=\"normal\" font-family=\"Helvetica\" font-size=\"18\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"53\" x-height=\"18\" x-left=\"271.1\" x-top=\"318.3\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"53\" height=\"18\" x=\"271.1\" y=\"318.3\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"271.1\" y=\"335.3\">Footer</text></g></g><text class=\"s-list-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"22\" y=\"30.8\">default</text><rect stroke-dasharray=\"5\" stroke=\"#BBBBBB\" stroke-width=\"1\" fill=\"#FFFFFF\" fill-opacity=\"0\" class=\"s-list-face\" width=\"555.2\" height=\"322.1\" x=\"20\" y=\"20\"></rect></g>LAYOUT--></g></svg>"}
|
data/test/unit/helper.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'minitest/spec'
|
5
|
-
require 'minitest/unit'
|
6
|
-
require 'turn/autorun'
|
7
|
-
require 'flexmock'
|
8
|
-
|
9
|
-
if ENV['COVERAGE']
|
10
|
-
require 'simplecov'
|
11
|
-
SimpleCov.start do
|
12
|
-
add_filter 'test/'
|
13
|
-
add_group 'Core', 'lib/thinreports/core'
|
14
|
-
add_group 'Generator', 'lib/thinreports/generator'
|
15
|
-
add_group 'Layout', 'lib/thinreports/layout'
|
16
|
-
add_group 'Report', 'lib/thinreports/report'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
# Load ThinReports.
|
21
|
-
require 'thinreports'
|
22
|
-
|
23
|
-
# Load misc.
|
24
|
-
require 'fileutils'
|
25
|
-
require 'digest/sha1'
|
26
|
-
|
27
|
-
# Run the test.
|
28
|
-
MiniTest::Unit.autorun
|
29
|
-
|
30
|
-
module ThinReports::TestHelpers
|
31
|
-
include FlexMock::TestCase
|
32
|
-
|
33
|
-
ROOT_DIR = File.expand_path(File.dirname(__FILE__))
|
34
|
-
TEMP_DIR = ROOT_DIR + '/tmp'
|
35
|
-
|
36
|
-
def self.included(klass)
|
37
|
-
klass.class_eval do
|
38
|
-
alias_method :_teardown, :teardown
|
39
|
-
def teardown
|
40
|
-
_teardown
|
41
|
-
clear_outputs
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def clear_outputs
|
47
|
-
FileUtils.rm Dir.glob(TEMP_DIR + '/*')
|
48
|
-
end
|
49
|
-
|
50
|
-
def clean_whitespaces(str)
|
51
|
-
str.gsub(/^\s*|\n\s*/, '')
|
52
|
-
end
|
53
|
-
|
54
|
-
def skip_if_ruby19
|
55
|
-
if RUBY_VERSION > '1.9'
|
56
|
-
skip('This test is not required more than Ruby 1.9.')
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def skip_if_ruby18
|
61
|
-
if RUBY_VERSION < '1.9'
|
62
|
-
skip('This test is not required Ruby 1.8 below.')
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def create_basic_report(file, &block)
|
67
|
-
report = ThinReports::Report.new :layout => data_file(file)
|
68
|
-
block.call(report) if block_given?
|
69
|
-
report
|
70
|
-
end
|
71
|
-
|
72
|
-
def create_basic_layout(file)
|
73
|
-
ThinReports::Layout.new(data_file(file))
|
74
|
-
end
|
75
|
-
|
76
|
-
def create_basic_layout_format(file)
|
77
|
-
ThinReports::Layout::Format.build(data_file(file))
|
78
|
-
end
|
79
|
-
|
80
|
-
def data_file(filename)
|
81
|
-
File.join(File.dirname(__FILE__), 'data', filename)
|
82
|
-
end
|
83
|
-
|
84
|
-
def temp_file(extname = 'pdf')
|
85
|
-
File.join(TEMP_DIR, (('a'..'z').to_a + (0..9).to_a).shuffle[0, 8].join + ".#{extname}")
|
86
|
-
end
|
87
|
-
end
|