thinreports 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +22 -6
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/README.md +5 -6
- data/Rakefile +11 -25
- data/lib/thinreports/generator/pdf/document/draw_shape.rb +1 -1
- data/lib/thinreports/generator/pdf/document/draw_template_items.rb +1 -1
- data/lib/thinreports/layout/legacy_schema.rb +1 -0
- data/lib/thinreports/version.rb +1 -1
- data/test/features/dynamic_style/expect.pdf +3714 -0
- data/{examples → test/features}/dynamic_style/image.png +0 -0
- data/{examples/dynamic_style/dynamic_style.tlf → test/features/dynamic_style/templates/styles.tlf} +0 -0
- data/{examples/dynamic_style/dynamic_style_in_list.tlf → test/features/dynamic_style/templates/styles_in_list.tlf} +0 -0
- data/test/features/dynamic_style/test_dynamic_style.rb +152 -0
- data/{examples → test/features}/eudc/eudc.ttf +0 -0
- data/test/features/eudc/expect.pdf +0 -0
- data/{examples/eudc/eudc.tlf → test/features/eudc/template.tlf} +0 -0
- data/test/features/eudc/test_eudc.rb +27 -0
- data/test/features/feature_test.rb +58 -0
- data/test/features/graphics/expect.pdf +475 -0
- data/test/features/graphics/template.tlf +309 -0
- data/test/features/graphics/test_graphics.rb +12 -0
- data/test/features/hidden_item/expect.pdf +0 -0
- data/{examples/hidden_shapes/hidden_shapes.tlf → test/features/hidden_item/template.tlf} +0 -0
- data/test/features/hidden_item/test_hidden_item.rb +12 -0
- data/test/features/image_block/expect.pdf +0 -0
- data/{examples/dynamic_image → test/features/image_block}/img200x100.png +0 -0
- data/{examples/dynamic_image → test/features/image_block}/img50x50.png +0 -0
- data/{examples/dynamic_image/dynamic_image.tlf → test/features/image_block/template.tlf} +0 -0
- data/test/features/image_block/test_image_block.rb +35 -0
- data/test/features/list_events/expect.pdf +659 -0
- data/{examples/list_events/list_events.tlf → test/features/list_events/template.tlf} +0 -0
- data/{examples/list_events/list_events.rb → test/features/list_events/test_list_events.rb} +7 -3
- data/test/features/list_manually/expect.pdf +599 -0
- data/{examples/list_manual_generation/list_manual_generation.tlf → test/features/list_manually/template.tlf} +0 -0
- data/test/features/list_manually/test_list_manually.rb +25 -0
- data/test/features/page_number/expect.pdf +400 -0
- data/{examples/page_number/page_number.tlf → test/features/page_number/template.tlf} +0 -0
- data/test/features/page_number/test_page_number.rb +24 -0
- data/test/features/page_number_with_list/expect.pdf +721 -0
- data/{examples/list_page_number/list_page_number.tlf → test/features/page_number_with_list/template.tlf} +0 -0
- data/test/features/page_number_with_list/test_page_number_with_list.rb +21 -0
- data/test/features/palleted_png/expect.pdf +0 -0
- data/{examples → test/features}/palleted_png/palleted_png.png +0 -0
- data/{examples/palleted_png/palleted_png.tlf → test/features/palleted_png/template.tlf} +0 -0
- data/test/features/palleted_png/test_palleted_png.rb +14 -0
- data/test/features/report_callbacks/expect.pdf +169 -0
- data/{examples/report_callbacks/report_callbacks.tlf → test/features/report_callbacks/template.tlf} +0 -0
- data/test/features/report_callbacks/test_report_callbacks.rb +18 -0
- data/test/features/text_align/expect.pdf +0 -0
- data/{examples/text_align/text_align.tlf → test/features/text_align/template.tlf} +0 -0
- data/test/features/text_align/test_text_align.rb +12 -0
- data/test/features/text_block_overflow/expect.pdf +0 -0
- data/{examples/tblock_overflow/tblock_overflow.tlf → test/features/text_block_overflow/template.tlf} +0 -0
- data/test/features/text_block_overflow/test_text_block_overflow.rb +25 -0
- data/test/features/text_block_singleline/expect.pdf +0 -0
- data/{examples/single_line_tblock/single_line_tblock.tlf → test/features/text_block_singleline/template.tlf} +0 -0
- data/test/features/text_block_singleline/test_text_block_singleline.rb +15 -0
- data/test/features/text_block_style/expect.pdf +1390 -1
- data/{examples/tblock_styles/tblock_styles.tlf → test/features/text_block_style/templates/basic_styles.tlf} +0 -0
- data/{examples/tblock_styles → test/features/text_block_style/templates}/font_size.tlf +0 -0
- data/{examples/tblock_styles/tblock_styles.rb → test/features/text_block_style/test_text_block_style.rb} +9 -5
- data/test/features/text_character_spacing/expect.pdf +0 -0
- data/{examples/character_spacing/character_spacing.tlf → test/features/text_character_spacing/template.tlf} +0 -0
- data/test/features/text_character_spacing/test_text_character_spacing.rb +12 -0
- data/test/features/text_word_wrap/expect.pdf +0 -0
- data/{examples/word_wrap/word_wrap.tlf → test/features/text_word_wrap/template.tlf} +0 -0
- data/test/features/text_word_wrap/test_text_word_wrap.rb +30 -0
- data/test/test_helper.rb +1 -10
- data/test/{unit → units}/core/format/test_base.rb +0 -0
- data/test/{unit → units}/core/shape/base/test_internal.rb +0 -0
- data/test/{unit → units}/core/shape/basic/test_block_format.rb +0 -0
- data/test/{unit → units}/core/shape/basic/test_block_interface.rb +0 -0
- data/test/{unit → units}/core/shape/basic/test_block_internal.rb +0 -0
- data/test/{unit → units}/core/shape/basic/test_format.rb +0 -0
- data/test/{unit → units}/core/shape/basic/test_interface.rb +0 -0
- data/test/{unit → units}/core/shape/basic/test_internal.rb +0 -0
- data/test/{unit → units}/core/shape/image_block/test_interface.rb +0 -0
- data/test/{unit → units}/core/shape/image_block/test_internal.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_format.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_manager.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_page.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_page_state.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_section_format.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_section_interface.rb +0 -0
- data/test/{unit → units}/core/shape/list/test_section_internal.rb +0 -0
- data/test/{unit → units}/core/shape/manager/test_format.rb +0 -0
- data/test/{unit → units}/core/shape/manager/test_internal.rb +0 -0
- data/test/{unit → units}/core/shape/manager/test_target.rb +0 -0
- data/test/{unit → units}/core/shape/page_number/test_format.rb +0 -0
- data/test/{unit → units}/core/shape/page_number/test_interface.rb +0 -0
- data/test/{unit → units}/core/shape/page_number/test_internal.rb +0 -0
- data/test/{unit → units}/core/shape/styles/test_base.rb +0 -0
- data/test/{unit → units}/core/shape/styles/test_basic.rb +0 -0
- data/test/{unit → units}/core/shape/styles/test_graphic.rb +0 -0
- data/test/{unit → units}/core/shape/styles/test_text.rb +0 -0
- data/test/{unit → units}/core/shape/text/test_format.rb +0 -0
- data/test/{unit → units}/core/shape/text/test_internal.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/formatter/test_basic.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/formatter/test_datetime.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/formatter/test_number.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/formatter/test_padding.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/test_format.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/test_formatter.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/test_interface.rb +0 -0
- data/test/{unit → units}/core/shape/text_block/test_internal.rb +0 -0
- data/test/{unit → units}/core/test_shape.rb +0 -0
- data/test/{unit → units}/core/test_utils.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/graphics/test_attributes.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/graphics/test_basic.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/graphics/test_image.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/graphics/test_text.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/test_font.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/test_graphics.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/test_page.rb +0 -0
- data/test/{unit → units}/generator/pdf/document/test_parse_color.rb +0 -0
- data/test/{unit → units}/generator/pdf/prawn_ext/test_calc_image_dimensions.rb +0 -0
- data/test/{unit → units}/generator/pdf/prawn_ext/test_width_of.rb +0 -0
- data/test/{unit → units}/generator/pdf/test_document.rb +0 -0
- data/test/{unit → units}/generator/test_pdf.rb +0 -0
- data/test/{unit → units}/layout/test_base.rb +0 -0
- data/test/{unit → units}/layout/test_format.rb +0 -0
- data/test/{unit → units}/layout/test_legacy_schema.rb +3 -1
- data/test/{unit → units}/layout/test_version.rb +0 -0
- data/test/{unit → units}/report/test_base.rb +0 -0
- data/test/{unit → units}/report/test_internal.rb +0 -0
- data/test/{unit → units}/test_config.rb +0 -0
- data/test/{unit → units}/test_layout.rb +0 -0
- data/test/{unit → units}/test_report.rb +0 -0
- data/thinreports.gemspec +0 -1
- metadata +122 -123
- data/examples/character_spacing/character_spacing.rb +0 -8
- data/examples/dynamic_image/dynamic_image.rb +0 -31
- data/examples/dynamic_style/dynamic_style.rb +0 -150
- data/examples/eudc/eudc.rb +0 -20
- data/examples/helper.rb +0 -50
- data/examples/hidden_shapes/hidden_shapes.rb +0 -9
- data/examples/list_manual_generation/list_manual_generation.rb +0 -22
- data/examples/list_page_number/list_page_number.rb +0 -17
- data/examples/page_number/page_number.rb +0 -33
- data/examples/palleted_png/palleted_png.rb +0 -9
- data/examples/password_setting/password_setting.rb +0 -10
- data/examples/password_setting/password_setting.tlf +0 -45
- data/examples/report_callbacks/report_callbacks.rb +0 -14
- data/examples/single_line_tblock/single_line_tblock.rb +0 -13
- data/examples/tblock_overflow/tblock_overflow.rb +0 -20
- data/examples/text_align/text_align.rb +0 -8
- data/examples/typeB_page_size/B4_ISO.tlf +0 -45
- data/examples/typeB_page_size/B4_JIS.tlf +0 -45
- data/examples/typeB_page_size/typeB_page_size.rb +0 -17
- data/examples/word_wrap/word_wrap.rb +0 -26
- 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,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
|
data/test/tmp/.gitkeep
DELETED
File without changes
|