thinreports 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +22 -6
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +1 -1
  6. data/README.md +5 -6
  7. data/Rakefile +11 -25
  8. data/lib/thinreports/generator/pdf/document/draw_shape.rb +1 -1
  9. data/lib/thinreports/generator/pdf/document/draw_template_items.rb +1 -1
  10. data/lib/thinreports/layout/legacy_schema.rb +1 -0
  11. data/lib/thinreports/version.rb +1 -1
  12. data/test/features/dynamic_style/expect.pdf +3714 -0
  13. data/{examples → test/features}/dynamic_style/image.png +0 -0
  14. data/{examples/dynamic_style/dynamic_style.tlf → test/features/dynamic_style/templates/styles.tlf} +0 -0
  15. data/{examples/dynamic_style/dynamic_style_in_list.tlf → test/features/dynamic_style/templates/styles_in_list.tlf} +0 -0
  16. data/test/features/dynamic_style/test_dynamic_style.rb +152 -0
  17. data/{examples → test/features}/eudc/eudc.ttf +0 -0
  18. data/test/features/eudc/expect.pdf +0 -0
  19. data/{examples/eudc/eudc.tlf → test/features/eudc/template.tlf} +0 -0
  20. data/test/features/eudc/test_eudc.rb +27 -0
  21. data/test/features/feature_test.rb +58 -0
  22. data/test/features/graphics/expect.pdf +475 -0
  23. data/test/features/graphics/template.tlf +309 -0
  24. data/test/features/graphics/test_graphics.rb +12 -0
  25. data/test/features/hidden_item/expect.pdf +0 -0
  26. data/{examples/hidden_shapes/hidden_shapes.tlf → test/features/hidden_item/template.tlf} +0 -0
  27. data/test/features/hidden_item/test_hidden_item.rb +12 -0
  28. data/test/features/image_block/expect.pdf +0 -0
  29. data/{examples/dynamic_image → test/features/image_block}/img200x100.png +0 -0
  30. data/{examples/dynamic_image → test/features/image_block}/img50x50.png +0 -0
  31. data/{examples/dynamic_image/dynamic_image.tlf → test/features/image_block/template.tlf} +0 -0
  32. data/test/features/image_block/test_image_block.rb +35 -0
  33. data/test/features/list_events/expect.pdf +659 -0
  34. data/{examples/list_events/list_events.tlf → test/features/list_events/template.tlf} +0 -0
  35. data/{examples/list_events/list_events.rb → test/features/list_events/test_list_events.rb} +7 -3
  36. data/test/features/list_manually/expect.pdf +599 -0
  37. data/{examples/list_manual_generation/list_manual_generation.tlf → test/features/list_manually/template.tlf} +0 -0
  38. data/test/features/list_manually/test_list_manually.rb +25 -0
  39. data/test/features/page_number/expect.pdf +400 -0
  40. data/{examples/page_number/page_number.tlf → test/features/page_number/template.tlf} +0 -0
  41. data/test/features/page_number/test_page_number.rb +24 -0
  42. data/test/features/page_number_with_list/expect.pdf +721 -0
  43. data/{examples/list_page_number/list_page_number.tlf → test/features/page_number_with_list/template.tlf} +0 -0
  44. data/test/features/page_number_with_list/test_page_number_with_list.rb +21 -0
  45. data/test/features/palleted_png/expect.pdf +0 -0
  46. data/{examples → test/features}/palleted_png/palleted_png.png +0 -0
  47. data/{examples/palleted_png/palleted_png.tlf → test/features/palleted_png/template.tlf} +0 -0
  48. data/test/features/palleted_png/test_palleted_png.rb +14 -0
  49. data/test/features/report_callbacks/expect.pdf +169 -0
  50. data/{examples/report_callbacks/report_callbacks.tlf → test/features/report_callbacks/template.tlf} +0 -0
  51. data/test/features/report_callbacks/test_report_callbacks.rb +18 -0
  52. data/test/features/text_align/expect.pdf +0 -0
  53. data/{examples/text_align/text_align.tlf → test/features/text_align/template.tlf} +0 -0
  54. data/test/features/text_align/test_text_align.rb +12 -0
  55. data/test/features/text_block_overflow/expect.pdf +0 -0
  56. data/{examples/tblock_overflow/tblock_overflow.tlf → test/features/text_block_overflow/template.tlf} +0 -0
  57. data/test/features/text_block_overflow/test_text_block_overflow.rb +25 -0
  58. data/test/features/text_block_singleline/expect.pdf +0 -0
  59. data/{examples/single_line_tblock/single_line_tblock.tlf → test/features/text_block_singleline/template.tlf} +0 -0
  60. data/test/features/text_block_singleline/test_text_block_singleline.rb +15 -0
  61. data/test/features/text_block_style/expect.pdf +1390 -1
  62. data/{examples/tblock_styles/tblock_styles.tlf → test/features/text_block_style/templates/basic_styles.tlf} +0 -0
  63. data/{examples/tblock_styles → test/features/text_block_style/templates}/font_size.tlf +0 -0
  64. data/{examples/tblock_styles/tblock_styles.rb → test/features/text_block_style/test_text_block_style.rb} +9 -5
  65. data/test/features/text_character_spacing/expect.pdf +0 -0
  66. data/{examples/character_spacing/character_spacing.tlf → test/features/text_character_spacing/template.tlf} +0 -0
  67. data/test/features/text_character_spacing/test_text_character_spacing.rb +12 -0
  68. data/test/features/text_word_wrap/expect.pdf +0 -0
  69. data/{examples/word_wrap/word_wrap.tlf → test/features/text_word_wrap/template.tlf} +0 -0
  70. data/test/features/text_word_wrap/test_text_word_wrap.rb +30 -0
  71. data/test/test_helper.rb +1 -10
  72. data/test/{unit → units}/core/format/test_base.rb +0 -0
  73. data/test/{unit → units}/core/shape/base/test_internal.rb +0 -0
  74. data/test/{unit → units}/core/shape/basic/test_block_format.rb +0 -0
  75. data/test/{unit → units}/core/shape/basic/test_block_interface.rb +0 -0
  76. data/test/{unit → units}/core/shape/basic/test_block_internal.rb +0 -0
  77. data/test/{unit → units}/core/shape/basic/test_format.rb +0 -0
  78. data/test/{unit → units}/core/shape/basic/test_interface.rb +0 -0
  79. data/test/{unit → units}/core/shape/basic/test_internal.rb +0 -0
  80. data/test/{unit → units}/core/shape/image_block/test_interface.rb +0 -0
  81. data/test/{unit → units}/core/shape/image_block/test_internal.rb +0 -0
  82. data/test/{unit → units}/core/shape/list/test_format.rb +0 -0
  83. data/test/{unit → units}/core/shape/list/test_manager.rb +0 -0
  84. data/test/{unit → units}/core/shape/list/test_page.rb +0 -0
  85. data/test/{unit → units}/core/shape/list/test_page_state.rb +0 -0
  86. data/test/{unit → units}/core/shape/list/test_section_format.rb +0 -0
  87. data/test/{unit → units}/core/shape/list/test_section_interface.rb +0 -0
  88. data/test/{unit → units}/core/shape/list/test_section_internal.rb +0 -0
  89. data/test/{unit → units}/core/shape/manager/test_format.rb +0 -0
  90. data/test/{unit → units}/core/shape/manager/test_internal.rb +0 -0
  91. data/test/{unit → units}/core/shape/manager/test_target.rb +0 -0
  92. data/test/{unit → units}/core/shape/page_number/test_format.rb +0 -0
  93. data/test/{unit → units}/core/shape/page_number/test_interface.rb +0 -0
  94. data/test/{unit → units}/core/shape/page_number/test_internal.rb +0 -0
  95. data/test/{unit → units}/core/shape/styles/test_base.rb +0 -0
  96. data/test/{unit → units}/core/shape/styles/test_basic.rb +0 -0
  97. data/test/{unit → units}/core/shape/styles/test_graphic.rb +0 -0
  98. data/test/{unit → units}/core/shape/styles/test_text.rb +0 -0
  99. data/test/{unit → units}/core/shape/text/test_format.rb +0 -0
  100. data/test/{unit → units}/core/shape/text/test_internal.rb +0 -0
  101. data/test/{unit → units}/core/shape/text_block/formatter/test_basic.rb +0 -0
  102. data/test/{unit → units}/core/shape/text_block/formatter/test_datetime.rb +0 -0
  103. data/test/{unit → units}/core/shape/text_block/formatter/test_number.rb +0 -0
  104. data/test/{unit → units}/core/shape/text_block/formatter/test_padding.rb +0 -0
  105. data/test/{unit → units}/core/shape/text_block/test_format.rb +0 -0
  106. data/test/{unit → units}/core/shape/text_block/test_formatter.rb +0 -0
  107. data/test/{unit → units}/core/shape/text_block/test_interface.rb +0 -0
  108. data/test/{unit → units}/core/shape/text_block/test_internal.rb +0 -0
  109. data/test/{unit → units}/core/test_shape.rb +0 -0
  110. data/test/{unit → units}/core/test_utils.rb +0 -0
  111. data/test/{unit → units}/generator/pdf/document/graphics/test_attributes.rb +0 -0
  112. data/test/{unit → units}/generator/pdf/document/graphics/test_basic.rb +0 -0
  113. data/test/{unit → units}/generator/pdf/document/graphics/test_image.rb +0 -0
  114. data/test/{unit → units}/generator/pdf/document/graphics/test_text.rb +0 -0
  115. data/test/{unit → units}/generator/pdf/document/test_font.rb +0 -0
  116. data/test/{unit → units}/generator/pdf/document/test_graphics.rb +0 -0
  117. data/test/{unit → units}/generator/pdf/document/test_page.rb +0 -0
  118. data/test/{unit → units}/generator/pdf/document/test_parse_color.rb +0 -0
  119. data/test/{unit → units}/generator/pdf/prawn_ext/test_calc_image_dimensions.rb +0 -0
  120. data/test/{unit → units}/generator/pdf/prawn_ext/test_width_of.rb +0 -0
  121. data/test/{unit → units}/generator/pdf/test_document.rb +0 -0
  122. data/test/{unit → units}/generator/test_pdf.rb +0 -0
  123. data/test/{unit → units}/layout/test_base.rb +0 -0
  124. data/test/{unit → units}/layout/test_format.rb +0 -0
  125. data/test/{unit → units}/layout/test_legacy_schema.rb +3 -1
  126. data/test/{unit → units}/layout/test_version.rb +0 -0
  127. data/test/{unit → units}/report/test_base.rb +0 -0
  128. data/test/{unit → units}/report/test_internal.rb +0 -0
  129. data/test/{unit → units}/test_config.rb +0 -0
  130. data/test/{unit → units}/test_layout.rb +0 -0
  131. data/test/{unit → units}/test_report.rb +0 -0
  132. data/thinreports.gemspec +0 -1
  133. metadata +122 -123
  134. data/examples/character_spacing/character_spacing.rb +0 -8
  135. data/examples/dynamic_image/dynamic_image.rb +0 -31
  136. data/examples/dynamic_style/dynamic_style.rb +0 -150
  137. data/examples/eudc/eudc.rb +0 -20
  138. data/examples/helper.rb +0 -50
  139. data/examples/hidden_shapes/hidden_shapes.rb +0 -9
  140. data/examples/list_manual_generation/list_manual_generation.rb +0 -22
  141. data/examples/list_page_number/list_page_number.rb +0 -17
  142. data/examples/page_number/page_number.rb +0 -33
  143. data/examples/palleted_png/palleted_png.rb +0 -9
  144. data/examples/password_setting/password_setting.rb +0 -10
  145. data/examples/password_setting/password_setting.tlf +0 -45
  146. data/examples/report_callbacks/report_callbacks.rb +0 -14
  147. data/examples/single_line_tblock/single_line_tblock.rb +0 -13
  148. data/examples/tblock_overflow/tblock_overflow.rb +0 -20
  149. data/examples/text_align/text_align.rb +0 -8
  150. data/examples/typeB_page_size/B4_ISO.tlf +0 -45
  151. data/examples/typeB_page_size/B4_JIS.tlf +0 -45
  152. data/examples/typeB_page_size/typeB_page_size.rb +0 -17
  153. data/examples/word_wrap/word_wrap.rb +0 -26
  154. data/test/tmp/.gitkeep +0 -0
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :tblock_overflow, 'Control overflowing the Tblock' do
4
- report = Thinreports::Report.new layout: layout_filename
5
- report.start_new_page do |page|
6
- page.values(truncate: 'The string overflowing from the area will be truncated',
7
- truncate_ja: '領域から溢れたテキストは切り捨てられます。',
8
- truncate_m: 'The string overflowing from the area will be truncated')
9
-
10
- page.values(fit: 'The string overflowing from the area will be reduced',
11
- fit_ja: '領域から溢れたテキストは縮小されます。',
12
- fit_m: '複数行モードでも、領域から溢れたテキストは自動的に縮小され折り返して表示されます。')
13
-
14
- page.values(expand: 'If a string was overflowed, a box will be expanded automatically',
15
- expand_ja: 'テキストが溢れた場合、ボックスが自動的に拡張されます。',
16
- expand_m: 'If a string was overflowed, a box will be expanded automatically')
17
- end
18
-
19
- report.generate filename: output_filename
20
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :text_align, 'Sets the text-align style to Text' do |t|
4
- Thinreports::Report.generate filename: t.output_filename do
5
- use_layout t.layout_filename
6
- start_new_page
7
- end
8
- end
@@ -1,45 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "",
6
- "type": "text",
7
- "display": true,
8
- "description": "",
9
- "x": 255,
10
- "y": 20,
11
- "width": 200,
12
- "height": 100,
13
- "style": {
14
- "font-family": [
15
- "Helvetica"
16
- ],
17
- "font-size": 26,
18
- "color": "#000000",
19
- "text-align": "center",
20
- "vertical-align": "middle",
21
- "line-height": "",
22
- "line-height-ratio": "",
23
- "letter-spacing": "",
24
- "font-style": []
25
- },
26
- "texts": [
27
- "B4 ISO"
28
- ]
29
- }
30
- ],
31
- "state": {
32
- "layout-guides": []
33
- },
34
- "title": "B4 ISO",
35
- "report": {
36
- "paper-type": "B4_ISO",
37
- "orientation": "portrait",
38
- "margin": [
39
- 20,
40
- 20,
41
- 20,
42
- 20
43
- ]
44
- }
45
- }
@@ -1,45 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "",
6
- "type": "text",
7
- "display": true,
8
- "description": "",
9
- "x": 260,
10
- "y": 20,
11
- "width": 200,
12
- "height": 100,
13
- "style": {
14
- "font-family": [
15
- "Helvetica"
16
- ],
17
- "font-size": 28,
18
- "color": "#000000",
19
- "text-align": "center",
20
- "vertical-align": "middle",
21
- "line-height": "",
22
- "line-height-ratio": "",
23
- "letter-spacing": "",
24
- "font-style": []
25
- },
26
- "texts": [
27
- "B4 JIS"
28
- ]
29
- }
30
- ],
31
- "state": {
32
- "layout-guides": []
33
- },
34
- "title": "B4 JIS",
35
- "report": {
36
- "paper-type": "B4",
37
- "orientation": "portrait",
38
- "margin": [
39
- 20,
40
- 20,
41
- 20,
42
- 20
43
- ]
44
- }
45
- }
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pdf/inspector'
4
-
5
- example :typeB_page_size, 'Generate type B(JIS/ISO) size pages' do |t|
6
- report = Thinreports::Report.new layout: t.resource('B4_ISO.tlf')
7
- report.start_new_page
8
-
9
- inspector = PDF::Inspector::Page.analyze(report.generate)
10
- raise 'Invalid B4 ISO size' unless inspector.pages.first[:size] == [708.66, 1000.63]
11
-
12
- report = Thinreports::Report.new layout: t.resource('B4_JIS.tlf')
13
- report.start_new_page
14
-
15
- inspector = PDF::Inspector::Page.analyze(report.generate)
16
- raise 'Invalid B4 JIS size' unless inspector.pages.first[:size] == [728.5, 1031.8]
17
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :word_wrap, 'Word-wrap property of TextBlock' do |t|
4
- Thinreports::Report.generate filename: t.output_filename do
5
- use_layout t.layout_filename
6
- start_new_page
7
-
8
- page.item(:locale).value('ja')
9
-
10
- text = 'Thinreports は Ruby 向けのオープンソース帳票・PDF ツールです。'
11
- page.values single_none: text,
12
- single_break_word: text,
13
- multiple_none: text,
14
- multiple_break_word: text
15
-
16
- start_new_page
17
-
18
- page.item(:locale).value('en')
19
-
20
- text = 'Thinreports is the OSS reporting tool for Ruby-lang.'
21
- page.values single_none: text,
22
- single_break_word: text,
23
- multiple_none: text,
24
- multiple_break_word: text
25
- end
26
- end
File without changes