thinreports 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +11 -0
  3. data/.github/workflows/test.yml +31 -40
  4. data/.gitignore +1 -1
  5. data/CHANGELOG.md +25 -1
  6. data/Gemfile +11 -0
  7. data/{MIT-LICENSE → LICENSE.txt} +2 -0
  8. data/README.md +50 -66
  9. data/Rakefile +17 -11
  10. data/lib/thinreports/basic_report/core/errors.rb +62 -0
  11. data/lib/thinreports/basic_report/core/format/base.rb +91 -0
  12. data/lib/thinreports/basic_report/core/shape/base/interface.rb +42 -0
  13. data/lib/thinreports/basic_report/core/shape/base/internal.rb +53 -0
  14. data/lib/thinreports/basic_report/core/shape/basic/block_format.rb +15 -0
  15. data/lib/thinreports/basic_report/core/shape/basic/block_interface.rb +34 -0
  16. data/lib/thinreports/basic_report/core/shape/basic/block_internal.rb +36 -0
  17. data/lib/thinreports/basic_report/core/shape/basic/format.rb +24 -0
  18. data/lib/thinreports/basic_report/core/shape/basic/interface.rb +87 -0
  19. data/lib/thinreports/basic_report/core/shape/basic/internal.rb +28 -0
  20. data/lib/thinreports/{core → basic_report/core}/shape/basic.rb +6 -4
  21. data/lib/thinreports/basic_report/core/shape/image_block/format.rb +14 -0
  22. data/lib/thinreports/basic_report/core/shape/image_block/interface.rb +25 -0
  23. data/lib/thinreports/basic_report/core/shape/image_block/internal.rb +19 -0
  24. data/lib/thinreports/{core → basic_report/core}/shape/image_block.rb +6 -4
  25. data/lib/thinreports/basic_report/core/shape/list/format.rb +92 -0
  26. data/lib/thinreports/basic_report/core/shape/list/manager.rb +231 -0
  27. data/lib/thinreports/basic_report/core/shape/list/page.rb +112 -0
  28. data/lib/thinreports/basic_report/core/shape/list/page_state.rb +50 -0
  29. data/lib/thinreports/basic_report/core/shape/list/section_format.rb +37 -0
  30. data/lib/thinreports/basic_report/core/shape/list/section_interface.rb +51 -0
  31. data/lib/thinreports/basic_report/core/shape/list/section_internal.rb +33 -0
  32. data/lib/thinreports/{core → basic_report/core}/shape/list.rb +6 -4
  33. data/lib/thinreports/basic_report/core/shape/manager/format.rb +33 -0
  34. data/lib/thinreports/basic_report/core/shape/manager/internal.rb +109 -0
  35. data/lib/thinreports/basic_report/core/shape/manager/target.rb +114 -0
  36. data/lib/thinreports/basic_report/core/shape/page_number/format.rb +32 -0
  37. data/lib/thinreports/basic_report/core/shape/page_number/interface.rb +31 -0
  38. data/lib/thinreports/basic_report/core/shape/page_number/internal.rb +57 -0
  39. data/lib/thinreports/{core → basic_report/core}/shape/page_number.rb +6 -4
  40. data/lib/thinreports/basic_report/core/shape/stack_view/format.rb +29 -0
  41. data/lib/thinreports/basic_report/core/shape/stack_view/interface.rb +19 -0
  42. data/lib/thinreports/basic_report/core/shape/stack_view/internal.rb +24 -0
  43. data/lib/thinreports/basic_report/core/shape/stack_view/row_format.rb +41 -0
  44. data/lib/thinreports/{core → basic_report/core}/shape/stack_view.rb +6 -4
  45. data/lib/thinreports/basic_report/core/shape/style/base.rb +149 -0
  46. data/lib/thinreports/basic_report/core/shape/style/basic.rb +24 -0
  47. data/lib/thinreports/basic_report/core/shape/style/graphic.rb +43 -0
  48. data/lib/thinreports/basic_report/core/shape/style/text.rb +122 -0
  49. data/lib/thinreports/basic_report/core/shape/text/format.rb +17 -0
  50. data/lib/thinreports/basic_report/core/shape/text/interface.rb +20 -0
  51. data/lib/thinreports/basic_report/core/shape/text/internal.rb +24 -0
  52. data/lib/thinreports/{core → basic_report/core}/shape/text.rb +6 -4
  53. data/lib/thinreports/basic_report/core/shape/text_block/format.rb +43 -0
  54. data/lib/thinreports/basic_report/core/shape/text_block/formatter/basic.rb +41 -0
  55. data/lib/thinreports/basic_report/core/shape/text_block/formatter/datetime.rb +25 -0
  56. data/lib/thinreports/basic_report/core/shape/text_block/formatter/number.rb +69 -0
  57. data/lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb +27 -0
  58. data/lib/thinreports/basic_report/core/shape/text_block/formatter.rb +38 -0
  59. data/lib/thinreports/basic_report/core/shape/text_block/interface.rb +37 -0
  60. data/lib/thinreports/basic_report/core/shape/text_block/internal.rb +75 -0
  61. data/lib/thinreports/{core → basic_report/core}/shape/text_block.rb +6 -4
  62. data/lib/thinreports/basic_report/core/shape.rb +44 -0
  63. data/lib/thinreports/basic_report/core/utils.rb +47 -0
  64. data/lib/thinreports/basic_report/generator/pdf/document/draw_shape.rb +108 -0
  65. data/lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb +71 -0
  66. data/lib/thinreports/basic_report/generator/pdf/document/font.rb +90 -0
  67. data/lib/thinreports/basic_report/generator/pdf/document/graphics/attributes.rb +149 -0
  68. data/lib/thinreports/basic_report/generator/pdf/document/graphics/basic.rb +137 -0
  69. data/lib/thinreports/basic_report/generator/pdf/document/graphics/image.rb +99 -0
  70. data/lib/thinreports/basic_report/generator/pdf/document/graphics/text.rb +180 -0
  71. data/lib/thinreports/basic_report/generator/pdf/document/graphics.rb +42 -0
  72. data/lib/thinreports/basic_report/generator/pdf/document/page.rb +96 -0
  73. data/lib/thinreports/basic_report/generator/pdf/document/parse_color.rb +51 -0
  74. data/lib/thinreports/basic_report/generator/pdf/document.rb +132 -0
  75. data/lib/thinreports/basic_report/generator/pdf/drawer/base.rb +50 -0
  76. data/lib/thinreports/basic_report/generator/pdf/drawer/list.rb +65 -0
  77. data/lib/thinreports/basic_report/generator/pdf/drawer/list_section.rb +51 -0
  78. data/lib/thinreports/basic_report/generator/pdf/drawer/page.rb +127 -0
  79. data/lib/thinreports/basic_report/generator/pdf/prawn_ext/calc_image_dimensions.rb +34 -0
  80. data/lib/thinreports/basic_report/generator/pdf/prawn_ext/width_of.rb +31 -0
  81. data/lib/thinreports/basic_report/generator/pdf.rb +66 -0
  82. data/lib/thinreports/basic_report/layout/base.rb +48 -0
  83. data/lib/thinreports/basic_report/layout/format.rb +67 -0
  84. data/lib/thinreports/basic_report/layout/legacy_schema.rb +383 -0
  85. data/lib/thinreports/basic_report/layout/version.rb +41 -0
  86. data/lib/thinreports/{layout.rb → basic_report/layout.rb} +6 -4
  87. data/lib/thinreports/basic_report/report/base.rb +173 -0
  88. data/lib/thinreports/basic_report/report/internal.rb +107 -0
  89. data/lib/thinreports/basic_report/report/page.rb +97 -0
  90. data/lib/thinreports/basic_report/report.rb +26 -0
  91. data/lib/thinreports/basic_report.rb +15 -0
  92. data/lib/thinreports/config.rb +1 -1
  93. data/lib/thinreports/section_report/builder/stack_view_builder.rb +0 -2
  94. data/lib/thinreports/section_report.rb +12 -0
  95. data/lib/thinreports/version.rb +1 -1
  96. data/lib/thinreports.rb +2 -13
  97. data/thinreports.gemspec +3 -7
  98. metadata +99 -157
  99. data/Dockerfile +0 -12
  100. data/gemfiles/prawn-2.2.gemfile +0 -5
  101. data/gemfiles/prawn-2.3.gemfile +0 -5
  102. data/gemfiles/prawn-2.4.gemfile +0 -5
  103. data/lib/thinreports/core/errors.rb +0 -60
  104. data/lib/thinreports/core/format/base.rb +0 -89
  105. data/lib/thinreports/core/shape/base/interface.rb +0 -40
  106. data/lib/thinreports/core/shape/base/internal.rb +0 -51
  107. data/lib/thinreports/core/shape/basic/block_format.rb +0 -13
  108. data/lib/thinreports/core/shape/basic/block_interface.rb +0 -32
  109. data/lib/thinreports/core/shape/basic/block_internal.rb +0 -34
  110. data/lib/thinreports/core/shape/basic/format.rb +0 -22
  111. data/lib/thinreports/core/shape/basic/interface.rb +0 -85
  112. data/lib/thinreports/core/shape/basic/internal.rb +0 -26
  113. data/lib/thinreports/core/shape/image_block/format.rb +0 -12
  114. data/lib/thinreports/core/shape/image_block/interface.rb +0 -23
  115. data/lib/thinreports/core/shape/image_block/internal.rb +0 -17
  116. data/lib/thinreports/core/shape/list/format.rb +0 -90
  117. data/lib/thinreports/core/shape/list/manager.rb +0 -229
  118. data/lib/thinreports/core/shape/list/page.rb +0 -110
  119. data/lib/thinreports/core/shape/list/page_state.rb +0 -48
  120. data/lib/thinreports/core/shape/list/section_format.rb +0 -35
  121. data/lib/thinreports/core/shape/list/section_interface.rb +0 -49
  122. data/lib/thinreports/core/shape/list/section_internal.rb +0 -31
  123. data/lib/thinreports/core/shape/manager/format.rb +0 -31
  124. data/lib/thinreports/core/shape/manager/internal.rb +0 -107
  125. data/lib/thinreports/core/shape/manager/target.rb +0 -112
  126. data/lib/thinreports/core/shape/page_number/format.rb +0 -30
  127. data/lib/thinreports/core/shape/page_number/interface.rb +0 -29
  128. data/lib/thinreports/core/shape/page_number/internal.rb +0 -55
  129. data/lib/thinreports/core/shape/stack_view/format.rb +0 -27
  130. data/lib/thinreports/core/shape/stack_view/interface.rb +0 -17
  131. data/lib/thinreports/core/shape/stack_view/internal.rb +0 -22
  132. data/lib/thinreports/core/shape/stack_view/row_format.rb +0 -39
  133. data/lib/thinreports/core/shape/style/base.rb +0 -146
  134. data/lib/thinreports/core/shape/style/basic.rb +0 -22
  135. data/lib/thinreports/core/shape/style/graphic.rb +0 -41
  136. data/lib/thinreports/core/shape/style/text.rb +0 -120
  137. data/lib/thinreports/core/shape/text/format.rb +0 -15
  138. data/lib/thinreports/core/shape/text/interface.rb +0 -18
  139. data/lib/thinreports/core/shape/text/internal.rb +0 -22
  140. data/lib/thinreports/core/shape/text_block/format.rb +0 -41
  141. data/lib/thinreports/core/shape/text_block/formatter/basic.rb +0 -39
  142. data/lib/thinreports/core/shape/text_block/formatter/datetime.rb +0 -23
  143. data/lib/thinreports/core/shape/text_block/formatter/number.rb +0 -67
  144. data/lib/thinreports/core/shape/text_block/formatter/padding.rb +0 -25
  145. data/lib/thinreports/core/shape/text_block/formatter.rb +0 -34
  146. data/lib/thinreports/core/shape/text_block/interface.rb +0 -35
  147. data/lib/thinreports/core/shape/text_block/internal.rb +0 -73
  148. data/lib/thinreports/core/shape.rb +0 -42
  149. data/lib/thinreports/core/utils.rb +0 -45
  150. data/lib/thinreports/generate.rb +0 -11
  151. data/lib/thinreports/generator/pdf/document/draw_shape.rb +0 -106
  152. data/lib/thinreports/generator/pdf/document/draw_template_items.rb +0 -69
  153. data/lib/thinreports/generator/pdf/document/font.rb +0 -88
  154. data/lib/thinreports/generator/pdf/document/graphics/attributes.rb +0 -147
  155. data/lib/thinreports/generator/pdf/document/graphics/basic.rb +0 -135
  156. data/lib/thinreports/generator/pdf/document/graphics/image.rb +0 -98
  157. data/lib/thinreports/generator/pdf/document/graphics/text.rb +0 -178
  158. data/lib/thinreports/generator/pdf/document/graphics.rb +0 -40
  159. data/lib/thinreports/generator/pdf/document/page.rb +0 -94
  160. data/lib/thinreports/generator/pdf/document/parse_color.rb +0 -49
  161. data/lib/thinreports/generator/pdf/document.rb +0 -130
  162. data/lib/thinreports/generator/pdf/drawer/base.rb +0 -48
  163. data/lib/thinreports/generator/pdf/drawer/list.rb +0 -63
  164. data/lib/thinreports/generator/pdf/drawer/list_section.rb +0 -49
  165. data/lib/thinreports/generator/pdf/drawer/page.rb +0 -125
  166. data/lib/thinreports/generator/pdf/prawn_ext/calc_image_dimensions.rb +0 -32
  167. data/lib/thinreports/generator/pdf/prawn_ext/width_of.rb +0 -29
  168. data/lib/thinreports/generator/pdf.rb +0 -63
  169. data/lib/thinreports/layout/base.rb +0 -46
  170. data/lib/thinreports/layout/format.rb +0 -65
  171. data/lib/thinreports/layout/legacy_schema.rb +0 -381
  172. data/lib/thinreports/layout/version.rb +0 -39
  173. data/lib/thinreports/report/base.rb +0 -169
  174. data/lib/thinreports/report/internal.rb +0 -105
  175. data/lib/thinreports/report/page.rb +0 -95
  176. data/lib/thinreports/report.rb +0 -24
  177. data/lib/thinreports/section_report/pdf/renderer/headers_renderer.rb +0 -24
  178. /data/lib/thinreports/{core → basic_report/core}/shape/base.rb +0 -0
  179. /data/lib/thinreports/{core → basic_report/core}/shape/manager.rb +0 -0
  180. /data/lib/thinreports/{core → basic_report/core}/shape/style.rb +0 -0
  181. /data/lib/thinreports/{generator → basic_report/generator}/pdf/prawn_ext.rb +0 -0
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Thinreports
4
+ module BasicReport
5
+ module Report
6
+ class Internal
7
+ attr_reader :pages
8
+ attr_reader :page
9
+ attr_reader :page_count
10
+ attr_reader :default_layout
11
+ attr_reader :layout_registry
12
+
13
+ attr_accessor :page_create_handler
14
+
15
+ # @param [Thinreports::BasicReport::Report::Base] report
16
+ # @param options (see Thinreports::BasicReport::Report::Base#initialize)
17
+ def initialize(report, options)
18
+ @report = report
19
+ @default_layout = options[:layout] ? init_layout(options[:layout]) : nil
20
+
21
+ @layout_registry = {}
22
+ @finalized = false
23
+ @pages = []
24
+ @page = nil
25
+ @page_count = 0
26
+
27
+ @page_create_handler = nil
28
+ end
29
+
30
+ # @see Thinreports::BasicReport::Report::Base#use_layout
31
+ def register_layout(layout, options = {})
32
+ if options.empty? || options[:default]
33
+ @default_layout = init_layout(layout)
34
+ else
35
+ id = options[:id].to_sym
36
+
37
+ raise ArgumentError, "Id :#{id} is already in use." if layout_registry.key?(id)
38
+ layout_registry[id] = init_layout(layout, id)
39
+ end
40
+ end
41
+
42
+ def add_page(new_page)
43
+ finalize_current_page
44
+ insert_page(new_page)
45
+ end
46
+
47
+ def copy_page
48
+ finalize_current_page(at: :copy)
49
+ insert_page(page.copy)
50
+ end
51
+
52
+ def finalize
53
+ return if finalized?
54
+
55
+ finalize_current_page
56
+ @finalized = true
57
+ end
58
+
59
+ def finalized?
60
+ @finalized
61
+ end
62
+
63
+ def load_layout(id_or_filename)
64
+ return @default_layout if id_or_filename.nil?
65
+
66
+ layout =
67
+ case id_or_filename
68
+ when Symbol
69
+ layout_registry[id_or_filename]
70
+ when String
71
+ init_layout(id_or_filename)
72
+ else
73
+ raise ArgumentError, 'Invalid argument for layout.'
74
+ end
75
+
76
+ @default_layout ||= layout
77
+ layout
78
+ end
79
+
80
+ private
81
+
82
+ def insert_page(new_page)
83
+ @pages << new_page
84
+
85
+ if new_page.count?
86
+ @page_count += 1
87
+ new_page.no = @page_count
88
+ end
89
+
90
+ @page_create_handler.call(new_page) if !new_page.blank? && @page_create_handler
91
+ @page = new_page
92
+ end
93
+
94
+ # @param (see Thinreports::BasicReport::Report::Page#finalize)
95
+ def finalize_current_page(options = {})
96
+ page.finalize(options) unless page.nil? || page.blank?
97
+ end
98
+
99
+ def init_layout(filename, id = nil)
100
+ filename = filename.to_path if filename.is_a?(Pathname)
101
+
102
+ Thinreports::BasicReport::Layout.new(filename, id: id)
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Thinreports
4
+ module BasicReport
5
+ module Report
6
+ class BlankPage
7
+ # @example
8
+ # 3.times do
9
+ # page = report.start_new_page
10
+ # puts page.no
11
+ # end
12
+ # # => 1, 2, 3
13
+ # @return [Integer]
14
+ attr_accessor :no
15
+
16
+ # @param [Boolean] count (nil)
17
+ def initialize(count = nil)
18
+ @count = count.nil? ? true : count
19
+ end
20
+
21
+ # @example
22
+ # page = report.start_new_page
23
+ # page.count? # => true
24
+ #
25
+ # page = report.start_new_page count: false
26
+ # page.count? # => false
27
+ # @return [Boolean]
28
+ def count?
29
+ @count
30
+ end
31
+
32
+ # @return [Boolean] (true)
33
+ def blank?
34
+ true
35
+ end
36
+ end
37
+
38
+ class Page < BlankPage
39
+ include Core::Shape::Manager::Target
40
+
41
+ # @return [Thinreports::BasicReport::Report::Base]
42
+ attr_reader :report
43
+
44
+ # @return [Thinreports::BasicReport::Layout::Base]
45
+ attr_reader :layout
46
+
47
+ # @param [Thinreports::BasicReport::Report::Base] report
48
+ # @param [Thinreports::BasicReport::Layout::Base] layout
49
+ # @param [Hash] options ({})
50
+ # @option options [Boolean] :count (true)
51
+ def initialize(report, layout, options = {})
52
+ super(options.key?(:count) ? options[:count] : true)
53
+
54
+ @report = report
55
+ @layout = layout
56
+ @finalized = false
57
+
58
+ initialize_manager(layout.format) do |f|
59
+ Core::Shape::Interface(self, f)
60
+ end
61
+ end
62
+
63
+ # @return [Boolean] (false)
64
+ def blank?
65
+ false
66
+ end
67
+
68
+ def copy
69
+ new_page = self.class.new(report, layout, count: count?)
70
+
71
+ manager.shapes.each do |id, shape|
72
+ new_shape = shape.copy(new_page)
73
+ new_page.manager.shapes[id] = new_shape
74
+
75
+ new_page.manager.lists[id] = new_shape if new_shape.internal.type_of?(Core::Shape::List::TYPE_NAME)
76
+ end
77
+ new_page
78
+ end
79
+
80
+ # @param [Hash] options
81
+ # @option options [:create, :copy] :at (:create)
82
+ def finalize(options = {})
83
+ at = options[:at] || :create
84
+
85
+ # For list shapes.
86
+ manager.lists.each_value { |list| list.manager.finalize } if at == :create
87
+
88
+ @finalized = true
89
+ end
90
+
91
+ def finalized?
92
+ @finalized
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Thinreports
4
+ module BasicReport
5
+ module Report
6
+ # @see Thinreports::BasicReport::Report::Base#initialize
7
+ def self.new(*args)
8
+ Base.new(*args)
9
+ end
10
+
11
+ # @see Thinreports::BasicReport::Report::Base#create
12
+ def self.create(*args, &block)
13
+ Base.create(*args, &block)
14
+ end
15
+
16
+ # @see Thinreports::BasicReport::Report::Base#generate
17
+ def self.generate(**args, &block)
18
+ Base.generate(**args, &block)
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ require_relative 'report/base'
25
+ require_relative 'report/internal'
26
+ require_relative 'report/page'
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'basic_report/core/utils'
4
+ require_relative 'basic_report/core/errors'
5
+ require_relative 'basic_report/core/format/base'
6
+ require_relative 'basic_report/core/shape'
7
+ require_relative 'basic_report/core/utils'
8
+ require_relative 'basic_report/report'
9
+ require_relative 'basic_report/layout'
10
+ require_relative 'basic_report/generator/pdf'
11
+
12
+ module Thinreports
13
+ Report = BasicReport::Report
14
+ Layout = BasicReport::Layout
15
+ end
@@ -4,7 +4,7 @@ module Thinreports
4
4
  # @yield [config]
5
5
  # @yieldparam [Thinreports::Configuration] config
6
6
  def self.configure(&block)
7
- Thinreports.call_block_in(config, &block)
7
+ block.call(config)
8
8
  end
9
9
 
10
10
  # @return [Thinreports::Configuration]
@@ -14,8 +14,6 @@ module Thinreports
14
14
  rows_params = params[:rows] || {}
15
15
  rows_schema = item.internal.format.rows
16
16
 
17
- schema_row_ids = rows_schema.map {|row_schema| row_schema.id.to_sym}.to_set
18
-
19
17
  rows = []
20
18
  rows_schema.each do |row_schema|
21
19
  row_params = rows_params[row_schema.id.to_sym] || {}
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Thinreports
4
+ Core = BasicReport::Core
5
+ Generator = BasicReport::Generator
6
+
7
+ def self.generate(report_params, filename: nil)
8
+ SectionReport::Generate.new.call(report_params, filename: filename)
9
+ end
10
+ end
11
+
12
+ require_relative 'section_report/generate'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thinreports
4
- VERSION = '0.12.0'
4
+ VERSION = '0.13.0'
5
5
  end
data/lib/thinreports.rb CHANGED
@@ -6,20 +6,9 @@ module Thinreports
6
6
  def self.root
7
7
  @root ||= Pathname.new(__FILE__).join('..', '..')
8
8
  end
9
-
10
- def self.generate(report_params, filename: nil)
11
- Generate.new.call(report_params, filename: filename)
12
- end
13
9
  end
14
10
 
15
11
  require_relative 'thinreports/version'
16
12
  require_relative 'thinreports/config'
17
- require_relative 'thinreports/core/utils'
18
- require_relative 'thinreports/core/errors'
19
- require_relative 'thinreports/core/format/base'
20
- require_relative 'thinreports/core/shape'
21
- require_relative 'thinreports/core/utils'
22
- require_relative 'thinreports/report'
23
- require_relative 'thinreports/layout'
24
- require_relative 'thinreports/generator/pdf'
25
- require_relative 'thinreports/generate'
13
+ require_relative 'thinreports/basic_report'
14
+ require_relative 'thinreports/section_report'
data/thinreports.gemspec CHANGED
@@ -13,19 +13,15 @@ Gem::Specification.new do |s|
13
13
  s.description = 'Thinreports is an open source report generation tool for Ruby.'
14
14
  s.homepage = 'http://www.thinreports.org'
15
15
  s.license = 'MIT'
16
+ s.metadata = { 'rubygems_mfa_required' => 'true' }
16
17
 
17
- s.required_ruby_version = '>= 2.5.0'
18
+ s.required_ruby_version = '>= 2.7.0'
18
19
 
19
20
  s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
21
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
21
22
  end
22
23
  s.require_paths = ['lib']
23
24
 
24
- s.add_dependency 'prawn', '~> 2.2'
25
+ s.add_dependency 'prawn', '>= 2.4.0'
25
26
  s.add_dependency 'rexml'
26
-
27
- s.add_development_dependency 'minitest', '>= 5.14.1'
28
- s.add_development_dependency 'mocha', '>= 1.11.2'
29
- s.add_development_dependency 'pdf-inspector', '>= 1.3.0'
30
- s.add_development_dependency 'rake', '>= 13.0.1'
31
27
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinreports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matsukei Co.,Ltd.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-16 00:00:00.000000000 Z
11
+ date: 2023-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.2'
19
+ version: 2.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.2'
26
+ version: 2.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rexml
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,62 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 5.14.1
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 5.14.1
55
- - !ruby/object:Gem::Dependency
56
- name: mocha
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 1.11.2
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 1.11.2
69
- - !ruby/object:Gem::Dependency
70
- name: pdf-inspector
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 1.3.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 1.3.0
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: 13.0.1
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: 13.0.1
97
41
  description: Thinreports is an open source report generation tool for Ruby.
98
42
  email: thinreports@gmail.com
99
43
  executables: []
@@ -101,12 +45,12 @@ extensions: []
101
45
  extra_rdoc_files: []
102
46
  files:
103
47
  - ".github/CONTRIBUTING.md"
48
+ - ".github/dependabot.yml"
104
49
  - ".github/workflows/test.yml"
105
50
  - ".gitignore"
106
51
  - CHANGELOG.md
107
- - Dockerfile
108
52
  - Gemfile
109
- - MIT-LICENSE
53
+ - LICENSE.txt
110
54
  - README.md
111
55
  - Rakefile
112
56
  - fonts/IPA_Font_License_Agreement_v1.0.txt
@@ -114,97 +58,95 @@ files:
114
58
  - fonts/ipagp.ttf
115
59
  - fonts/ipam.ttf
116
60
  - fonts/ipamp.ttf
117
- - gemfiles/prawn-2.2.gemfile
118
- - gemfiles/prawn-2.3.gemfile
119
- - gemfiles/prawn-2.4.gemfile
120
61
  - lib/thinreports.rb
62
+ - lib/thinreports/basic_report.rb
63
+ - lib/thinreports/basic_report/core/errors.rb
64
+ - lib/thinreports/basic_report/core/format/base.rb
65
+ - lib/thinreports/basic_report/core/shape.rb
66
+ - lib/thinreports/basic_report/core/shape/base.rb
67
+ - lib/thinreports/basic_report/core/shape/base/interface.rb
68
+ - lib/thinreports/basic_report/core/shape/base/internal.rb
69
+ - lib/thinreports/basic_report/core/shape/basic.rb
70
+ - lib/thinreports/basic_report/core/shape/basic/block_format.rb
71
+ - lib/thinreports/basic_report/core/shape/basic/block_interface.rb
72
+ - lib/thinreports/basic_report/core/shape/basic/block_internal.rb
73
+ - lib/thinreports/basic_report/core/shape/basic/format.rb
74
+ - lib/thinreports/basic_report/core/shape/basic/interface.rb
75
+ - lib/thinreports/basic_report/core/shape/basic/internal.rb
76
+ - lib/thinreports/basic_report/core/shape/image_block.rb
77
+ - lib/thinreports/basic_report/core/shape/image_block/format.rb
78
+ - lib/thinreports/basic_report/core/shape/image_block/interface.rb
79
+ - lib/thinreports/basic_report/core/shape/image_block/internal.rb
80
+ - lib/thinreports/basic_report/core/shape/list.rb
81
+ - lib/thinreports/basic_report/core/shape/list/format.rb
82
+ - lib/thinreports/basic_report/core/shape/list/manager.rb
83
+ - lib/thinreports/basic_report/core/shape/list/page.rb
84
+ - lib/thinreports/basic_report/core/shape/list/page_state.rb
85
+ - lib/thinreports/basic_report/core/shape/list/section_format.rb
86
+ - lib/thinreports/basic_report/core/shape/list/section_interface.rb
87
+ - lib/thinreports/basic_report/core/shape/list/section_internal.rb
88
+ - lib/thinreports/basic_report/core/shape/manager.rb
89
+ - lib/thinreports/basic_report/core/shape/manager/format.rb
90
+ - lib/thinreports/basic_report/core/shape/manager/internal.rb
91
+ - lib/thinreports/basic_report/core/shape/manager/target.rb
92
+ - lib/thinreports/basic_report/core/shape/page_number.rb
93
+ - lib/thinreports/basic_report/core/shape/page_number/format.rb
94
+ - lib/thinreports/basic_report/core/shape/page_number/interface.rb
95
+ - lib/thinreports/basic_report/core/shape/page_number/internal.rb
96
+ - lib/thinreports/basic_report/core/shape/stack_view.rb
97
+ - lib/thinreports/basic_report/core/shape/stack_view/format.rb
98
+ - lib/thinreports/basic_report/core/shape/stack_view/interface.rb
99
+ - lib/thinreports/basic_report/core/shape/stack_view/internal.rb
100
+ - lib/thinreports/basic_report/core/shape/stack_view/row_format.rb
101
+ - lib/thinreports/basic_report/core/shape/style.rb
102
+ - lib/thinreports/basic_report/core/shape/style/base.rb
103
+ - lib/thinreports/basic_report/core/shape/style/basic.rb
104
+ - lib/thinreports/basic_report/core/shape/style/graphic.rb
105
+ - lib/thinreports/basic_report/core/shape/style/text.rb
106
+ - lib/thinreports/basic_report/core/shape/text.rb
107
+ - lib/thinreports/basic_report/core/shape/text/format.rb
108
+ - lib/thinreports/basic_report/core/shape/text/interface.rb
109
+ - lib/thinreports/basic_report/core/shape/text/internal.rb
110
+ - lib/thinreports/basic_report/core/shape/text_block.rb
111
+ - lib/thinreports/basic_report/core/shape/text_block/format.rb
112
+ - lib/thinreports/basic_report/core/shape/text_block/formatter.rb
113
+ - lib/thinreports/basic_report/core/shape/text_block/formatter/basic.rb
114
+ - lib/thinreports/basic_report/core/shape/text_block/formatter/datetime.rb
115
+ - lib/thinreports/basic_report/core/shape/text_block/formatter/number.rb
116
+ - lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
117
+ - lib/thinreports/basic_report/core/shape/text_block/interface.rb
118
+ - lib/thinreports/basic_report/core/shape/text_block/internal.rb
119
+ - lib/thinreports/basic_report/core/utils.rb
120
+ - lib/thinreports/basic_report/generator/pdf.rb
121
+ - lib/thinreports/basic_report/generator/pdf/document.rb
122
+ - lib/thinreports/basic_report/generator/pdf/document/draw_shape.rb
123
+ - lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb
124
+ - lib/thinreports/basic_report/generator/pdf/document/font.rb
125
+ - lib/thinreports/basic_report/generator/pdf/document/graphics.rb
126
+ - lib/thinreports/basic_report/generator/pdf/document/graphics/attributes.rb
127
+ - lib/thinreports/basic_report/generator/pdf/document/graphics/basic.rb
128
+ - lib/thinreports/basic_report/generator/pdf/document/graphics/image.rb
129
+ - lib/thinreports/basic_report/generator/pdf/document/graphics/text.rb
130
+ - lib/thinreports/basic_report/generator/pdf/document/page.rb
131
+ - lib/thinreports/basic_report/generator/pdf/document/parse_color.rb
132
+ - lib/thinreports/basic_report/generator/pdf/drawer/base.rb
133
+ - lib/thinreports/basic_report/generator/pdf/drawer/list.rb
134
+ - lib/thinreports/basic_report/generator/pdf/drawer/list_section.rb
135
+ - lib/thinreports/basic_report/generator/pdf/drawer/page.rb
136
+ - lib/thinreports/basic_report/generator/pdf/prawn_ext.rb
137
+ - lib/thinreports/basic_report/generator/pdf/prawn_ext/calc_image_dimensions.rb
138
+ - lib/thinreports/basic_report/generator/pdf/prawn_ext/width_of.rb
139
+ - lib/thinreports/basic_report/layout.rb
140
+ - lib/thinreports/basic_report/layout/base.rb
141
+ - lib/thinreports/basic_report/layout/format.rb
142
+ - lib/thinreports/basic_report/layout/legacy_schema.rb
143
+ - lib/thinreports/basic_report/layout/version.rb
144
+ - lib/thinreports/basic_report/report.rb
145
+ - lib/thinreports/basic_report/report/base.rb
146
+ - lib/thinreports/basic_report/report/internal.rb
147
+ - lib/thinreports/basic_report/report/page.rb
121
148
  - lib/thinreports/config.rb
122
- - lib/thinreports/core/errors.rb
123
- - lib/thinreports/core/format/base.rb
124
- - lib/thinreports/core/shape.rb
125
- - lib/thinreports/core/shape/base.rb
126
- - lib/thinreports/core/shape/base/interface.rb
127
- - lib/thinreports/core/shape/base/internal.rb
128
- - lib/thinreports/core/shape/basic.rb
129
- - lib/thinreports/core/shape/basic/block_format.rb
130
- - lib/thinreports/core/shape/basic/block_interface.rb
131
- - lib/thinreports/core/shape/basic/block_internal.rb
132
- - lib/thinreports/core/shape/basic/format.rb
133
- - lib/thinreports/core/shape/basic/interface.rb
134
- - lib/thinreports/core/shape/basic/internal.rb
135
- - lib/thinreports/core/shape/image_block.rb
136
- - lib/thinreports/core/shape/image_block/format.rb
137
- - lib/thinreports/core/shape/image_block/interface.rb
138
- - lib/thinreports/core/shape/image_block/internal.rb
139
- - lib/thinreports/core/shape/list.rb
140
- - lib/thinreports/core/shape/list/format.rb
141
- - lib/thinreports/core/shape/list/manager.rb
142
- - lib/thinreports/core/shape/list/page.rb
143
- - lib/thinreports/core/shape/list/page_state.rb
144
- - lib/thinreports/core/shape/list/section_format.rb
145
- - lib/thinreports/core/shape/list/section_interface.rb
146
- - lib/thinreports/core/shape/list/section_internal.rb
147
- - lib/thinreports/core/shape/manager.rb
148
- - lib/thinreports/core/shape/manager/format.rb
149
- - lib/thinreports/core/shape/manager/internal.rb
150
- - lib/thinreports/core/shape/manager/target.rb
151
- - lib/thinreports/core/shape/page_number.rb
152
- - lib/thinreports/core/shape/page_number/format.rb
153
- - lib/thinreports/core/shape/page_number/interface.rb
154
- - lib/thinreports/core/shape/page_number/internal.rb
155
- - lib/thinreports/core/shape/stack_view.rb
156
- - lib/thinreports/core/shape/stack_view/format.rb
157
- - lib/thinreports/core/shape/stack_view/interface.rb
158
- - lib/thinreports/core/shape/stack_view/internal.rb
159
- - lib/thinreports/core/shape/stack_view/row_format.rb
160
- - lib/thinreports/core/shape/style.rb
161
- - lib/thinreports/core/shape/style/base.rb
162
- - lib/thinreports/core/shape/style/basic.rb
163
- - lib/thinreports/core/shape/style/graphic.rb
164
- - lib/thinreports/core/shape/style/text.rb
165
- - lib/thinreports/core/shape/text.rb
166
- - lib/thinreports/core/shape/text/format.rb
167
- - lib/thinreports/core/shape/text/interface.rb
168
- - lib/thinreports/core/shape/text/internal.rb
169
- - lib/thinreports/core/shape/text_block.rb
170
- - lib/thinreports/core/shape/text_block/format.rb
171
- - lib/thinreports/core/shape/text_block/formatter.rb
172
- - lib/thinreports/core/shape/text_block/formatter/basic.rb
173
- - lib/thinreports/core/shape/text_block/formatter/datetime.rb
174
- - lib/thinreports/core/shape/text_block/formatter/number.rb
175
- - lib/thinreports/core/shape/text_block/formatter/padding.rb
176
- - lib/thinreports/core/shape/text_block/interface.rb
177
- - lib/thinreports/core/shape/text_block/internal.rb
178
- - lib/thinreports/core/utils.rb
179
- - lib/thinreports/generate.rb
180
- - lib/thinreports/generator/pdf.rb
181
- - lib/thinreports/generator/pdf/document.rb
182
- - lib/thinreports/generator/pdf/document/draw_shape.rb
183
- - lib/thinreports/generator/pdf/document/draw_template_items.rb
184
- - lib/thinreports/generator/pdf/document/font.rb
185
- - lib/thinreports/generator/pdf/document/graphics.rb
186
- - lib/thinreports/generator/pdf/document/graphics/attributes.rb
187
- - lib/thinreports/generator/pdf/document/graphics/basic.rb
188
- - lib/thinreports/generator/pdf/document/graphics/image.rb
189
- - lib/thinreports/generator/pdf/document/graphics/text.rb
190
- - lib/thinreports/generator/pdf/document/page.rb
191
- - lib/thinreports/generator/pdf/document/parse_color.rb
192
- - lib/thinreports/generator/pdf/drawer/base.rb
193
- - lib/thinreports/generator/pdf/drawer/list.rb
194
- - lib/thinreports/generator/pdf/drawer/list_section.rb
195
- - lib/thinreports/generator/pdf/drawer/page.rb
196
- - lib/thinreports/generator/pdf/prawn_ext.rb
197
- - lib/thinreports/generator/pdf/prawn_ext/calc_image_dimensions.rb
198
- - lib/thinreports/generator/pdf/prawn_ext/width_of.rb
199
- - lib/thinreports/layout.rb
200
- - lib/thinreports/layout/base.rb
201
- - lib/thinreports/layout/format.rb
202
- - lib/thinreports/layout/legacy_schema.rb
203
- - lib/thinreports/layout/version.rb
204
- - lib/thinreports/report.rb
205
- - lib/thinreports/report/base.rb
206
- - lib/thinreports/report/internal.rb
207
- - lib/thinreports/report/page.rb
149
+ - lib/thinreports/section_report.rb
208
150
  - lib/thinreports/section_report/build.rb
209
151
  - lib/thinreports/section_report/builder/item_builder.rb
210
152
  - lib/thinreports/section_report/builder/report_builder.rb
@@ -215,7 +157,6 @@ files:
215
157
  - lib/thinreports/section_report/pdf/render.rb
216
158
  - lib/thinreports/section_report/pdf/renderer/draw_item.rb
217
159
  - lib/thinreports/section_report/pdf/renderer/group_renderer.rb
218
- - lib/thinreports/section_report/pdf/renderer/headers_renderer.rb
219
160
  - lib/thinreports/section_report/pdf/renderer/section_height.rb
220
161
  - lib/thinreports/section_report/pdf/renderer/section_renderer.rb
221
162
  - lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb
@@ -229,7 +170,8 @@ files:
229
170
  homepage: http://www.thinreports.org
230
171
  licenses:
231
172
  - MIT
232
- metadata: {}
173
+ metadata:
174
+ rubygems_mfa_required: 'true'
233
175
  post_install_message:
234
176
  rdoc_options: []
235
177
  require_paths:
@@ -238,14 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
180
  requirements:
239
181
  - - ">="
240
182
  - !ruby/object:Gem::Version
241
- version: 2.5.0
183
+ version: 2.7.0
242
184
  required_rubygems_version: !ruby/object:Gem::Requirement
243
185
  requirements:
244
186
  - - ">="
245
187
  - !ruby/object:Gem::Version
246
188
  version: '0'
247
189
  requirements: []
248
- rubygems_version: 3.1.2
190
+ rubygems_version: 3.4.6
249
191
  signing_key:
250
192
  specification_version: 4
251
193
  summary: An open source report generation tool for Ruby.
data/Dockerfile DELETED
@@ -1,12 +0,0 @@
1
- FROM ruby:3.0.0
2
-
3
- RUN apt-get update -qq && apt-get install -y build-essential xvfb
4
-
5
- # Install diff-pdf
6
- WORKDIR /tmp
7
- RUN apt-get install -y libpoppler-glib-dev poppler-utils libwxgtk3.0-dev && curl -L https://github.com/vslavik/diff-pdf/archive/master.tar.gz -o diff-pdf-master.tar.gz && tar zxf diff-pdf-master.tar.gz && cd diff-pdf-master && ./bootstrap && ./configure && make && make install
8
-
9
- RUN mkdir /thinreports
10
-
11
- WORKDIR /thinreports
12
- VOLUME /thinreports