thinreports 0.6.0.pre3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. data/README.rdoc +37 -32
  2. data/doc/yardoc_templates/default/layout/html/footer.erb +1 -1
  3. data/lib/thinreports.rb +2 -1
  4. data/lib/thinreports/config.rb +21 -0
  5. data/lib/thinreports/core/errors.rb +14 -1
  6. data/lib/thinreports/core/format/builder.rb +6 -1
  7. data/lib/thinreports/core/page.rb +6 -6
  8. data/lib/thinreports/core/shape.rb +8 -9
  9. data/lib/thinreports/core/shape/base/internal.rb +6 -12
  10. data/lib/thinreports/core/shape/basic.rb +3 -0
  11. data/lib/thinreports/core/shape/basic/block_format.rb +12 -0
  12. data/lib/thinreports/core/shape/basic/block_interface.rb +25 -0
  13. data/lib/thinreports/core/shape/basic/block_internal.rb +33 -0
  14. data/lib/thinreports/core/shape/basic/interface.rb +37 -11
  15. data/lib/thinreports/core/shape/basic/internal.rb +3 -12
  16. data/lib/thinreports/core/shape/image_block.rb +15 -0
  17. data/lib/thinreports/core/shape/image_block/format.rb +13 -0
  18. data/lib/thinreports/core/shape/image_block/interface.rb +19 -0
  19. data/lib/thinreports/core/shape/image_block/internal.rb +16 -0
  20. data/lib/thinreports/core/shape/list/events.rb +19 -2
  21. data/lib/thinreports/core/shape/list/manager.rb +17 -4
  22. data/lib/thinreports/core/shape/list/page.rb +2 -2
  23. data/lib/thinreports/core/shape/list/page_state.rb +4 -0
  24. data/lib/thinreports/core/shape/list/section_internal.rb +4 -0
  25. data/lib/thinreports/core/shape/manager/format.rb +1 -1
  26. data/lib/thinreports/core/shape/manager/internal.rb +24 -11
  27. data/lib/thinreports/core/shape/manager/target.rb +2 -2
  28. data/lib/thinreports/core/shape/style.rb +15 -0
  29. data/lib/thinreports/core/shape/style/base.rb +149 -0
  30. data/lib/thinreports/core/shape/style/basic.rb +17 -0
  31. data/lib/thinreports/core/shape/style/graphic.rb +60 -0
  32. data/lib/thinreports/core/shape/style/text.rb +138 -0
  33. data/lib/thinreports/core/shape/text/internal.rb +4 -0
  34. data/lib/thinreports/core/shape/text_block.rb +16 -0
  35. data/lib/thinreports/core/shape/{tblock → text_block}/format.rb +3 -3
  36. data/lib/thinreports/core/shape/{tblock → text_block}/formatter.rb +7 -7
  37. data/lib/thinreports/core/shape/{tblock → text_block}/formatter/basic.rb +1 -1
  38. data/lib/thinreports/core/shape/{tblock → text_block}/formatter/datetime.rb +1 -1
  39. data/lib/thinreports/core/shape/{tblock → text_block}/formatter/number.rb +1 -1
  40. data/lib/thinreports/core/shape/{tblock → text_block}/formatter/padding.rb +10 -8
  41. data/lib/thinreports/core/shape/{tblock → text_block}/interface.rb +2 -21
  42. data/lib/thinreports/core/shape/{tblock → text_block}/internal.rb +16 -10
  43. data/lib/thinreports/core/utils.rb +0 -8
  44. data/lib/thinreports/generator.rb +2 -2
  45. data/lib/thinreports/generator/configuration.rb +30 -0
  46. data/lib/thinreports/generator/pdf.rb +13 -10
  47. data/lib/thinreports/generator/pdf/configuration.rb +28 -0
  48. data/lib/thinreports/generator/pdf/document.rb +16 -56
  49. data/lib/thinreports/generator/pdf/document/draw_shape.rb +35 -17
  50. data/lib/thinreports/generator/pdf/document/font.rb +25 -9
  51. data/lib/thinreports/generator/pdf/document/graphics.rb +1 -1
  52. data/lib/thinreports/generator/pdf/document/graphics/attributes.rb +18 -4
  53. data/lib/thinreports/generator/pdf/document/graphics/basic.rb +1 -1
  54. data/lib/thinreports/generator/pdf/document/graphics/image.rb +18 -1
  55. data/lib/thinreports/generator/pdf/document/graphics/text.rb +29 -6
  56. data/lib/thinreports/generator/pdf/document/page.rb +70 -0
  57. data/lib/thinreports/generator/pdf/document/parse_color.rb +1 -1
  58. data/lib/thinreports/generator/pdf/document/parse_svg.rb +1 -1
  59. data/lib/thinreports/generator/pdf/drawer.rb +1 -1
  60. data/lib/thinreports/generator/pdf/drawer/base.rb +5 -7
  61. data/lib/thinreports/generator/pdf/drawer/list.rb +4 -4
  62. data/lib/thinreports/generator/pdf/drawer/list_section.rb +8 -3
  63. data/lib/thinreports/generator/pdf/drawer/page.rb +10 -3
  64. data/lib/thinreports/generator/pdf/prawn_ext.rb +16 -21
  65. data/lib/thinreports/layout/format.rb +2 -2
  66. data/lib/thinreports/layout/version.rb +2 -2
  67. data/lib/thinreports/report/base.rb +68 -31
  68. data/tasks/test.rake +48 -4
  69. data/test/benchmark/basic_estimate.tlf +1 -0
  70. data/test/benchmark/bench_basic_estimate.rb +95 -0
  71. data/test/case/character_spacing/character_spacing.rb +7 -0
  72. data/test/case/character_spacing/character_spacing.tlf +1 -0
  73. data/test/case/dynamic_image/dynamic_image.rb +41 -0
  74. data/test/case/dynamic_image/dynamic_image.tlf +1 -0
  75. data/test/case/dynamic_image/img200x100.png +0 -0
  76. data/test/case/dynamic_image/img50x50.png +0 -0
  77. data/test/case/dynamic_style/dynamic_style.rb +154 -0
  78. data/test/case/dynamic_style/dynamic_style.tlf +1 -0
  79. data/test/case/dynamic_style/dynamic_style_in_list.tlf +1 -0
  80. data/test/case/dynamic_style/image.png +0 -0
  81. data/test/case/eudc/eudc.rb +20 -0
  82. data/test/case/eudc/eudc.tlf +1 -0
  83. data/test/case/eudc/eudc.ttf +0 -0
  84. data/test/case/helper.rb +27 -0
  85. data/test/case/hidden_shapes/hidden_shapes.rb +13 -0
  86. data/test/case/hidden_shapes/hidden_shapes.tlf +1 -0
  87. data/test/case/list_events/list_events.rb +32 -0
  88. data/test/case/list_events/list_events.tlf +1 -0
  89. data/test/case/list_header_inheriting/list_header_inheriting.rb +19 -0
  90. data/test/case/list_header_inheriting/list_header_inheriting.tlf +1 -0
  91. data/test/case/list_manual_generation/list_manual_generation.rb +24 -0
  92. data/test/case/list_manual_generation/list_manual_generation.tlf +1 -0
  93. data/test/case/single_line_tblock/single_line_tblock.rb +15 -0
  94. data/test/case/single_line_tblock/single_line_tblock.tlf +1 -0
  95. data/test/case/tblock_styles/tblock_styles.rb +27 -0
  96. data/test/case/tblock_styles/tblock_styles.tlf +1 -0
  97. data/test/case/text_align/text_align.rb +9 -0
  98. data/test/case/text_align/text_align.tlf +1 -0
  99. data/test/unit/core/shape/base/test_internal.rb +65 -85
  100. data/test/unit/core/shape/basic/test_basic_format.rb +30 -0
  101. data/test/unit/core/shape/basic/test_basic_interface.rb +27 -0
  102. data/test/unit/core/shape/basic/test_basic_internal.rb +55 -0
  103. data/test/unit/core/shape/basic/test_interface.rb +84 -36
  104. data/test/unit/core/shape/basic/test_internal.rb +32 -24
  105. data/test/unit/core/shape/image_block/test_format.rb +58 -0
  106. data/test/unit/core/shape/image_block/test_interface.rb +23 -0
  107. data/test/unit/core/shape/image_block/test_internal.rb +28 -0
  108. data/test/unit/core/shape/list/test_events.rb +19 -11
  109. data/test/unit/core/shape/list/test_manager.rb +112 -0
  110. data/test/unit/core/shape/list/test_page.rb +57 -0
  111. data/test/unit/core/shape/list/test_section_format.rb +1 -1
  112. data/test/unit/core/shape/list/test_section_interface.rb +37 -30
  113. data/test/unit/core/shape/list/test_section_internal.rb +39 -14
  114. data/test/unit/core/shape/manager/test_format.rb +12 -18
  115. data/test/unit/core/shape/manager/test_internal.rb +127 -93
  116. data/test/unit/core/shape/manager/test_target.rb +63 -56
  117. data/test/unit/core/shape/styles/test_base.rb +219 -0
  118. data/test/unit/core/shape/styles/test_basic.rb +24 -0
  119. data/test/unit/core/shape/styles/test_graphic.rb +69 -0
  120. data/test/unit/core/shape/styles/test_text.rb +318 -0
  121. data/test/unit/core/shape/{tblock → text_block}/formatter/test_basic.rb +2 -2
  122. data/test/unit/core/shape/{tblock → text_block}/formatter/test_datetime.rb +2 -2
  123. data/test/unit/core/shape/{tblock → text_block}/formatter/test_number.rb +2 -2
  124. data/test/unit/core/shape/{tblock → text_block}/formatter/test_padding.rb +11 -6
  125. data/test/unit/core/shape/text_block/test_format.rb +160 -0
  126. data/test/unit/core/shape/{tblock → text_block}/test_formatter.rb +2 -2
  127. data/test/unit/core/shape/text_block/test_interface.rb +46 -0
  128. data/test/unit/core/shape/text_block/test_internal.rb +128 -0
  129. data/test/unit/core/test_shape.rb +31 -6
  130. data/test/unit/data/basic_layout1.tlf +1 -0
  131. data/test/unit/data/basic_layout2.tlf +1 -0
  132. data/test/unit/data/basic_list_layout.tlf +1 -0
  133. data/test/unit/generator/pdf/document/graphics/test_attributes.rb +81 -52
  134. data/test/unit/generator/pdf/document/graphics/test_text.rb +159 -0
  135. data/test/unit/generator/pdf/document/test_font.rb +21 -6
  136. data/test/unit/generator/pdf/document/test_graphics.rb +2 -2
  137. data/test/unit/generator/pdf/document/test_page.rb +95 -0
  138. data/test/unit/generator/pdf/document/test_parse_color.rb +2 -2
  139. data/test/unit/generator/pdf/test_configuration.rb +24 -0
  140. data/test/unit/generator/pdf/test_document.rb +28 -0
  141. data/test/unit/generator/test_configuration.rb +25 -0
  142. data/test/unit/generator/test_pdf.rb +19 -0
  143. data/test/unit/helper.rb +18 -0
  144. data/test/unit/layout/test_format.rb +24 -7
  145. data/test/unit/layout/test_version.rb +61 -27
  146. data/test/unit/report/test_base.rb +185 -89
  147. data/test/unit/test_config.rb +22 -0
  148. data/test/unit/test_report.rb +4 -4
  149. metadata +94 -43
  150. data/lib/thinreports/core/shape/tblock.rb +0 -16
  151. data/lib/thinreports/generator/pxd.rb +0 -75
  152. data/lib/thinreports/generator/pxd/helper.rb +0 -33
  153. data/lib/thinreports/generator/pxd/list_renderer.rb +0 -58
  154. data/lib/thinreports/generator/pxd/page_renderer.rb +0 -75
  155. data/tasks/clean.rake +0 -6
  156. data/test/unit/core/shape/tblock/test_format.rb +0 -125
  157. data/test/unit/core/shape/tblock/test_interface.rb +0 -40
  158. data/test/unit/core/shape/tblock/test_internal.rb +0 -139
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+
3
+ require 'test/unit/helper'
4
+
5
+ class ThinReports::TestConfig < MiniTest::Unit::TestCase
6
+ include ThinReports::TestHelpers
7
+
8
+ def test_generator_of_Configuration_should_return_configuration_of_generator
9
+ config = ThinReports::Configuration.new
10
+ assert_instance_of ThinReports::Generator::Configuration, config.generator
11
+ end
12
+
13
+ def test_config_should_return_configuration_of_thinreports
14
+ assert_instance_of ThinReports::Configuration, ThinReports.config
15
+ end
16
+
17
+ def test_configure_should_exec_an_given_block_with_config_which_instance_of_Configuration
18
+ ThinReports.configure do |config|
19
+ assert_instance_of ThinReports::Configuration, config
20
+ end
21
+ end
22
+ end
@@ -8,22 +8,22 @@ class ThinReports::TestReport < MiniTest::Unit::TestCase
8
8
  # Alias
9
9
  Report = ThinReports::Report
10
10
 
11
- def test_new
11
+ def test_new_should_delegate_to_Base_new
12
12
  flexmock(Report::Base).should_receive(:new).once
13
13
  Report.new
14
14
  end
15
15
 
16
- def test_create
16
+ def test_create_should_delegate_to_Base_create
17
17
  flexmock(Report::Base).should_receive(:create).once
18
18
  Report.create
19
19
  end
20
20
 
21
- def test_generate
21
+ def test_generate_should_delegate_to_Base_generate
22
22
  flexmock(Report::Base).should_receive(:generate).once
23
23
  Report.generate
24
24
  end
25
25
 
26
- def test_generate_file
26
+ def test_generate_file_should_delegate_to_Base_generate_file
27
27
  flexmock(Report::Base).should_receive(:generate_file).once
28
28
  Report.generate_file
29
29
  end
metadata CHANGED
@@ -1,49 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinreports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.pre3
5
- prerelease: 6
4
+ version: 0.7.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matsukei Co.,Ltd.
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-29 00:00:00.000000000Z
12
+ date: 2011-10-31 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: prawn
16
- requirement: &26908596 !ruby/object:Gem::Requirement
16
+ requirement: &30624636 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.11.1
21
+ version: 0.12.0
22
22
  - - <=
23
23
  - !ruby/object:Gem::Version
24
- version: 0.11.1
24
+ version: 0.12.0
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *26908596
28
- - !ruby/object:Gem::Dependency
29
- name: json
30
- requirement: &26908116 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ! '>='
34
- - !ruby/object:Gem::Version
35
- version: 1.4.6
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: *26908116
39
- description: ThinReports is Open Source Reporting Solution. ThinReports provide a
40
- special "GUI Layout Editor" and a special "Generator" for Ruby.
27
+ version_requirements: *30624636
28
+ description: ThinReports is Open Source Reporting Solution for Ruby. It provides a
29
+ GUI Designer and a Library for Ruby.
41
30
  email: thinreports@matsukei.co.jp
42
31
  executables: []
43
32
  extensions: []
44
33
  extra_rdoc_files:
45
34
  - README.rdoc
46
35
  files:
36
+ - lib/thinreports/config.rb
47
37
  - lib/thinreports/core/errors.rb
48
38
  - lib/thinreports/core/events.rb
49
39
  - lib/thinreports/core/ext/array.rb
@@ -58,10 +48,17 @@ files:
58
48
  - lib/thinreports/core/shape/base/interface.rb
59
49
  - lib/thinreports/core/shape/base/internal.rb
60
50
  - lib/thinreports/core/shape/base.rb
51
+ - lib/thinreports/core/shape/basic/block_format.rb
52
+ - lib/thinreports/core/shape/basic/block_interface.rb
53
+ - lib/thinreports/core/shape/basic/block_internal.rb
61
54
  - lib/thinreports/core/shape/basic/format.rb
62
55
  - lib/thinreports/core/shape/basic/interface.rb
63
56
  - lib/thinreports/core/shape/basic/internal.rb
64
57
  - lib/thinreports/core/shape/basic.rb
58
+ - lib/thinreports/core/shape/image_block/format.rb
59
+ - lib/thinreports/core/shape/image_block/interface.rb
60
+ - lib/thinreports/core/shape/image_block/internal.rb
61
+ - lib/thinreports/core/shape/image_block.rb
65
62
  - lib/thinreports/core/shape/list/configuration.rb
66
63
  - lib/thinreports/core/shape/list/events.rb
67
64
  - lib/thinreports/core/shape/list/format.rb
@@ -77,23 +74,30 @@ files:
77
74
  - lib/thinreports/core/shape/manager/internal.rb
78
75
  - lib/thinreports/core/shape/manager/target.rb
79
76
  - lib/thinreports/core/shape/manager.rb
80
- - lib/thinreports/core/shape/tblock/format.rb
81
- - lib/thinreports/core/shape/tblock/formatter/basic.rb
82
- - lib/thinreports/core/shape/tblock/formatter/datetime.rb
83
- - lib/thinreports/core/shape/tblock/formatter/number.rb
84
- - lib/thinreports/core/shape/tblock/formatter/padding.rb
85
- - lib/thinreports/core/shape/tblock/formatter.rb
86
- - lib/thinreports/core/shape/tblock/interface.rb
87
- - lib/thinreports/core/shape/tblock/internal.rb
88
- - lib/thinreports/core/shape/tblock.rb
77
+ - lib/thinreports/core/shape/style/base.rb
78
+ - lib/thinreports/core/shape/style/basic.rb
79
+ - lib/thinreports/core/shape/style/graphic.rb
80
+ - lib/thinreports/core/shape/style/text.rb
81
+ - lib/thinreports/core/shape/style.rb
89
82
  - lib/thinreports/core/shape/text/format.rb
90
83
  - lib/thinreports/core/shape/text/interface.rb
91
84
  - lib/thinreports/core/shape/text/internal.rb
92
85
  - lib/thinreports/core/shape/text.rb
86
+ - lib/thinreports/core/shape/text_block/format.rb
87
+ - lib/thinreports/core/shape/text_block/formatter/basic.rb
88
+ - lib/thinreports/core/shape/text_block/formatter/datetime.rb
89
+ - lib/thinreports/core/shape/text_block/formatter/number.rb
90
+ - lib/thinreports/core/shape/text_block/formatter/padding.rb
91
+ - lib/thinreports/core/shape/text_block/formatter.rb
92
+ - lib/thinreports/core/shape/text_block/interface.rb
93
+ - lib/thinreports/core/shape/text_block/internal.rb
94
+ - lib/thinreports/core/shape/text_block.rb
93
95
  - lib/thinreports/core/shape.rb
94
96
  - lib/thinreports/core/utils.rb
95
97
  - lib/thinreports/core.rb
96
98
  - lib/thinreports/generator/base.rb
99
+ - lib/thinreports/generator/configuration.rb
100
+ - lib/thinreports/generator/pdf/configuration.rb
97
101
  - lib/thinreports/generator/pdf/document/draw_shape.rb
98
102
  - lib/thinreports/generator/pdf/document/font.rb
99
103
  - lib/thinreports/generator/pdf/document/graphics/attributes.rb
@@ -101,6 +105,7 @@ files:
101
105
  - lib/thinreports/generator/pdf/document/graphics/image.rb
102
106
  - lib/thinreports/generator/pdf/document/graphics/text.rb
103
107
  - lib/thinreports/generator/pdf/document/graphics.rb
108
+ - lib/thinreports/generator/pdf/document/page.rb
104
109
  - lib/thinreports/generator/pdf/document/parse_color.rb
105
110
  - lib/thinreports/generator/pdf/document/parse_svg.rb
106
111
  - lib/thinreports/generator/pdf/document.rb
@@ -111,10 +116,6 @@ files:
111
116
  - lib/thinreports/generator/pdf/drawer.rb
112
117
  - lib/thinreports/generator/pdf/prawn_ext.rb
113
118
  - lib/thinreports/generator/pdf.rb
114
- - lib/thinreports/generator/pxd/helper.rb
115
- - lib/thinreports/generator/pxd/list_renderer.rb
116
- - lib/thinreports/generator/pxd/page_renderer.rb
117
- - lib/thinreports/generator/pxd.rb
118
119
  - lib/thinreports/generator.rb
119
120
  - lib/thinreports/layout/base.rb
120
121
  - lib/thinreports/layout/configuration.rb
@@ -126,7 +127,6 @@ files:
126
127
  - lib/thinreports/report/internal.rb
127
128
  - lib/thinreports/report.rb
128
129
  - lib/thinreports.rb
129
- - tasks/clean.rake
130
130
  - tasks/doc.rake
131
131
  - tasks/test.rake
132
132
  - resources/fonts/ipag.ttf
@@ -143,12 +143,19 @@ files:
143
143
  - test/unit/core/ordered_hash_spec.rb
144
144
  - test/unit/core/shape/base/test_interface.rb
145
145
  - test/unit/core/shape/base/test_internal.rb
146
+ - test/unit/core/shape/basic/test_basic_format.rb
147
+ - test/unit/core/shape/basic/test_basic_interface.rb
148
+ - test/unit/core/shape/basic/test_basic_internal.rb
146
149
  - test/unit/core/shape/basic/test_format.rb
147
150
  - test/unit/core/shape/basic/test_interface.rb
148
151
  - test/unit/core/shape/basic/test_internal.rb
152
+ - test/unit/core/shape/image_block/test_format.rb
153
+ - test/unit/core/shape/image_block/test_interface.rb
154
+ - test/unit/core/shape/image_block/test_internal.rb
149
155
  - test/unit/core/shape/list/test_configuration.rb
150
156
  - test/unit/core/shape/list/test_events.rb
151
157
  - test/unit/core/shape/list/test_format.rb
158
+ - test/unit/core/shape/list/test_manager.rb
152
159
  - test/unit/core/shape/list/test_page.rb
153
160
  - test/unit/core/shape/list/test_page_state.rb
154
161
  - test/unit/core/shape/list/test_section_format.rb
@@ -158,24 +165,37 @@ files:
158
165
  - test/unit/core/shape/manager/test_format.rb
159
166
  - test/unit/core/shape/manager/test_internal.rb
160
167
  - test/unit/core/shape/manager/test_target.rb
161
- - test/unit/core/shape/tblock/formatter/test_basic.rb
162
- - test/unit/core/shape/tblock/formatter/test_datetime.rb
163
- - test/unit/core/shape/tblock/formatter/test_number.rb
164
- - test/unit/core/shape/tblock/formatter/test_padding.rb
165
- - test/unit/core/shape/tblock/test_format.rb
166
- - test/unit/core/shape/tblock/test_formatter.rb
167
- - test/unit/core/shape/tblock/test_interface.rb
168
- - test/unit/core/shape/tblock/test_internal.rb
168
+ - test/unit/core/shape/styles/test_base.rb
169
+ - test/unit/core/shape/styles/test_basic.rb
170
+ - test/unit/core/shape/styles/test_graphic.rb
171
+ - test/unit/core/shape/styles/test_text.rb
169
172
  - test/unit/core/shape/text/test_format.rb
170
173
  - test/unit/core/shape/text/test_internal.rb
174
+ - test/unit/core/shape/text_block/formatter/test_basic.rb
175
+ - test/unit/core/shape/text_block/formatter/test_datetime.rb
176
+ - test/unit/core/shape/text_block/formatter/test_number.rb
177
+ - test/unit/core/shape/text_block/formatter/test_padding.rb
178
+ - test/unit/core/shape/text_block/test_format.rb
179
+ - test/unit/core/shape/text_block/test_formatter.rb
180
+ - test/unit/core/shape/text_block/test_interface.rb
181
+ - test/unit/core/shape/text_block/test_internal.rb
171
182
  - test/unit/core/test_events.rb
172
183
  - test/unit/core/test_shape.rb
173
184
  - test/unit/core/utils_spec.rb
185
+ - test/unit/data/basic_layout1.tlf
186
+ - test/unit/data/basic_layout2.tlf
187
+ - test/unit/data/basic_list_layout.tlf
174
188
  - test/unit/generator/pdf/document/graphics/test_attributes.rb
189
+ - test/unit/generator/pdf/document/graphics/test_text.rb
175
190
  - test/unit/generator/pdf/document/test_font.rb
176
191
  - test/unit/generator/pdf/document/test_graphics.rb
192
+ - test/unit/generator/pdf/document/test_page.rb
177
193
  - test/unit/generator/pdf/document/test_parse_color.rb
194
+ - test/unit/generator/pdf/test_configuration.rb
195
+ - test/unit/generator/pdf/test_document.rb
178
196
  - test/unit/generator/test_base.rb
197
+ - test/unit/generator/test_configuration.rb
198
+ - test/unit/generator/test_pdf.rb
179
199
  - test/unit/helper.rb
180
200
  - test/unit/layout/test_base.rb
181
201
  - test/unit/layout/test_configuration.rb
@@ -184,8 +204,39 @@ files:
184
204
  - test/unit/report/test_base.rb
185
205
  - test/unit/report/test_events.rb
186
206
  - test/unit/report/test_internal.rb
207
+ - test/unit/test_config.rb
187
208
  - test/unit/test_layout.rb
188
209
  - test/unit/test_report.rb
210
+ - test/case/character_spacing/character_spacing.rb
211
+ - test/case/character_spacing/character_spacing.tlf
212
+ - test/case/dynamic_image/dynamic_image.rb
213
+ - test/case/dynamic_image/dynamic_image.tlf
214
+ - test/case/dynamic_image/img200x100.png
215
+ - test/case/dynamic_image/img50x50.png
216
+ - test/case/dynamic_style/dynamic_style.rb
217
+ - test/case/dynamic_style/dynamic_style.tlf
218
+ - test/case/dynamic_style/dynamic_style_in_list.tlf
219
+ - test/case/dynamic_style/image.png
220
+ - test/case/eudc/eudc.rb
221
+ - test/case/eudc/eudc.tlf
222
+ - test/case/eudc/eudc.ttf
223
+ - test/case/helper.rb
224
+ - test/case/hidden_shapes/hidden_shapes.rb
225
+ - test/case/hidden_shapes/hidden_shapes.tlf
226
+ - test/case/list_events/list_events.rb
227
+ - test/case/list_events/list_events.tlf
228
+ - test/case/list_header_inheriting/list_header_inheriting.rb
229
+ - test/case/list_header_inheriting/list_header_inheriting.tlf
230
+ - test/case/list_manual_generation/list_manual_generation.rb
231
+ - test/case/list_manual_generation/list_manual_generation.tlf
232
+ - test/case/single_line_tblock/single_line_tblock.rb
233
+ - test/case/single_line_tblock/single_line_tblock.tlf
234
+ - test/case/tblock_styles/tblock_styles.rb
235
+ - test/case/tblock_styles/tblock_styles.tlf
236
+ - test/case/text_align/text_align.rb
237
+ - test/case/text_align/text_align.tlf
238
+ - test/benchmark/basic_estimate.tlf
239
+ - test/benchmark/bench_basic_estimate.rb
189
240
  - Rakefile
190
241
  - README.rdoc
191
242
  - .yardopts
@@ -214,5 +265,5 @@ rubyforge_project:
214
265
  rubygems_version: 1.8.5
215
266
  signing_key:
216
267
  specification_version: 3
217
- summary: Reporting solution for Ruby and Web Applications, and Enterprise.
268
+ summary: Reporting solution for Ruby and Rails.
218
269
  test_files: []
@@ -1,16 +0,0 @@
1
- # coding: utf-8
2
-
3
- module ThinReports
4
- module Core::Shape
5
-
6
- module Tblock
7
- TYPE_NAME = 's-tblock'
8
- end
9
-
10
- end
11
- end
12
-
13
- require 'thinreports/core/shape/tblock/format'
14
- require 'thinreports/core/shape/tblock/internal'
15
- require 'thinreports/core/shape/tblock/interface'
16
- require 'thinreports/core/shape/tblock/formatter'
@@ -1,75 +0,0 @@
1
- # coding: utf-8
2
-
3
- require 'stringio'
4
- require 'tempfile'
5
-
6
- module ThinReports
7
- module Generator
8
-
9
- class Pxd < Base
10
- require 'thinreports/generator/pxd/helper'
11
-
12
- autoload :PageRenderer, 'thinreports/generator/pxd/page_renderer'
13
- autoload :ListRenderer, 'thinreports/generator/pxd/list_renderer'
14
-
15
- include Helper
16
-
17
- # @param report (see ThinReports::Generator::Base#initialize)
18
- # @param [Hash] options See http://www.pxdoc.com/tech/wiki.cgi?page=pxd
19
- def initialize(report, options)
20
- super
21
- @renderers = {}
22
- end
23
-
24
- # @see ThinReports::Generator::Base#generate
25
- def generate
26
- output = StringIO.new('', 'r+:UTF-8')
27
- render_start_pxd(output)
28
-
29
- report.pages.each do |page|
30
- render_page(output, page)
31
- end
32
-
33
- render_end_pxd(output)
34
- output.string
35
- end
36
-
37
- # @see ThinReports::Generator::Base#generate_file
38
- def generate_file(filename)
39
- File.open(filename, 'w') {|f| f << generate }
40
- end
41
-
42
- private
43
-
44
- def renderer(page)
45
- @renderers[page.layout.format.identifier] ||=
46
- PageRenderer.new(page.layout.format)
47
- end
48
-
49
- def render_page(output, page)
50
- output << unless page.blank?
51
- content_tag(:page, renderer(page).render(page.manager), nil,
52
- :escape => false)
53
- else
54
- tag(:page)
55
- end
56
- end
57
-
58
- def render_start_pxd(output)
59
- format = default_layout.format
60
- attrs = @options.merge('title' => format.report_title,
61
- 'paper-type' => format.page_paper_type,
62
- 'orientation' => format.page_orientation,
63
- 'width' => format.page_width,
64
- 'height' => format.page_height,
65
- 'dpi' => '72')
66
- output << tag(:pxd, attrs, true)
67
- end
68
-
69
- def render_end_pxd(output)
70
- output << '</pxd>'
71
- end
72
- end
73
-
74
- end
75
- end
@@ -1,33 +0,0 @@
1
- # coding: utf-8
2
-
3
- require 'erb'
4
-
5
- module ThinReports
6
- module Generator
7
-
8
- # @private
9
- module Pxd::Helper
10
- private
11
-
12
- def content_tag(tag_name, content = nil, attrs = nil, options = {})
13
- content = h(content) unless options[:escape] == false
14
- tag(tag_name, attrs, true) << content.to_s << "</#{h(tag_name)}>"
15
- end
16
-
17
- def tag(tag_name, attrs = nil, open = false)
18
- attrs = tag_attributes(attrs)
19
- attrs = ' ' + attrs unless attrs.blank?
20
- "<#{h(tag_name)}#{attrs}#{open ? '' : ' /'}>"
21
- end
22
-
23
- def tag_attributes(attrs)
24
- attrs && attrs.map{|k, v| "#{h(k)}=\"#{h(v)}\"" }.join(' ')
25
- end
26
-
27
- def h(s)
28
- ERB::Util.html_escape(s)
29
- end
30
- end
31
-
32
- end
33
- end
@@ -1,58 +0,0 @@
1
- # coding: utf-8
2
-
3
- module ThinReports
4
- module Generator
5
-
6
- # @private
7
- class Pxd::ListRenderer
8
- include Pxd::Helper
9
-
10
- def initialize
11
- @renderers = {}
12
- @list = nil
13
- end
14
-
15
- # @param [ThinReports::Core::Shape::List::PageState] list
16
- def render(list)
17
- @list = list
18
-
19
- result = String.new
20
- render_section(result, list.header) if list.header
21
-
22
- list.rows.each do |row|
23
- render_section(result, row)
24
- end
25
- result
26
- end
27
-
28
- private
29
-
30
- # @param [String] result
31
- # @param [ThinReports::Core::Shape::List::SectionInterface] section
32
- def render_section(result, section)
33
- internal = section.internal
34
- attributes = internal.attributes
35
- contents = renderer(internal.section_name).render(section.manager)
36
-
37
- # Only for when older than Ver 0.6.0.pre2.
38
- # Since 0.6.0.pre3, ignore this.
39
- if internal.relative_top
40
- attributes['transform'] =
41
- "translate(#{internal.relative_position.join(',')})"
42
- end
43
-
44
- result << content_tag(internal.svg_tag, contents, attributes,
45
- :escape => false)
46
- end
47
-
48
- # @param [Symbol] section_name
49
- # @return [ThinReports::Generator::Pxd::PageRenderer]
50
- def renderer(section_name)
51
- @renderers[section_name] ||=
52
- Pxd::PageRenderer.new(@list.format.sections[section_name])
53
- end
54
-
55
- end
56
-
57
- end
58
- end