thinreports 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/test.yml +7 -8
- data/CHANGELOG.md +6 -0
- data/{MIT-LICENSE → LICENSE.txt} +2 -0
- data/README.md +44 -55
- data/lib/thinreports/report.rb +2 -2
- data/lib/thinreports/section_report/builder/stack_view_builder.rb +0 -2
- data/lib/thinreports/version.rb +1 -1
- metadata +5 -6
- data/Dockerfile +0 -12
- data/lib/thinreports/section_report/pdf/renderer/headers_renderer.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3abf53b7bac12b336d4ef9b4af7dd4400081eeb632f8ece362e60f6cca47c2b4
|
4
|
+
data.tar.gz: 4461aca74ccae200d234715a06bbc60e753a7694053116c58ef2d031b8f01047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ebae61bcd5ce2524bc8c09eff3f2fa047de632a250dfce9390a4db78b806d945ed32ea563c1063836d938e139b433b53c595592ec741a3a0c719bb74d7ffb1b
|
7
|
+
data.tar.gz: ef7d77b8edaf345b546cc42bb4f2ac98d23e2e74fe62921a181976ff38f11c6f4a6ef875ede3bcb40dfd0fa02ddc42cfe532df7c7bad633efe4f8cfd056a32ca
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "daily"
|
data/.github/workflows/test.yml
CHANGED
@@ -6,6 +6,9 @@ jobs:
|
|
6
6
|
test:
|
7
7
|
name: Test against ruby ${{ matrix.ruby }} and prawn ${{ matrix.prawn }}
|
8
8
|
runs-on: ubuntu-latest
|
9
|
+
# Run this build only on either pull request or push.
|
10
|
+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
11
|
+
|
9
12
|
strategy:
|
10
13
|
matrix:
|
11
14
|
ruby:
|
@@ -25,15 +28,11 @@ jobs:
|
|
25
28
|
prawn: 2.3
|
26
29
|
|
27
30
|
steps:
|
28
|
-
- uses: actions/checkout@
|
31
|
+
- uses: actions/checkout@v2
|
29
32
|
|
30
|
-
-
|
31
|
-
|
32
|
-
|
33
|
-
sudo apt-get install make automake g++ libpoppler-glib-dev poppler-utils libwxgtk3.0-dev
|
34
|
-
git clone https://github.com/vslavik/diff-pdf.git -b v0.4.1 --depth 1 /tmp/diff-pdf-src
|
35
|
-
cd /tmp/diff-pdf-src
|
36
|
-
./bootstrap && ./configure && make && sudo make install
|
33
|
+
- uses: hidakatsuya/setup-diff-pdf@v1
|
34
|
+
with:
|
35
|
+
diff-pdf-version: 0.5
|
37
36
|
|
38
37
|
- name: Set up Ruby ${{ matrix.ruby }}
|
39
38
|
uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
data/{MIT-LICENSE → LICENSE.txt}
RENAMED
data/README.md
CHANGED
@@ -2,33 +2,45 @@
|
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/thinreports)
|
4
4
|
[](https://github.com/thinreports/thinreports-generator/actions)
|
5
|
-
[](https://codeclimate.com/github/thinreports/thinreports-generator/maintainability)
|
6
5
|
|
7
|
-
[Thinreports](
|
6
|
+
A Ruby library for [Thinreports](https://github.com/thinreports/thinreports).
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
## Prerequisites
|
9
|
+
|
10
|
+
### Supported Versions
|
11
|
+
|
12
|
+
- Ruby 2.5, 2.6, 2.7, 3.0
|
13
|
+
- JRuby 9.2
|
14
|
+
- Prawn 2.2, 2.3, 2.4
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'thinreports'
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle install
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install thinreports
|
11
31
|
|
12
|
-
## Getting Started
|
13
32
|
|
14
|
-
|
15
|
-
* [Quick Start Guide](http://www.thinreports.org/documentation/getting-started/quickstart.html)
|
16
|
-
* [Examples](https://github.com/thinreports/thinreports-examples)
|
17
|
-
* [Changelog](https://github.com/thinreports/thinreports-generator/blob/master/CHANGELOG.md)
|
18
|
-
* [Discussion Group (GitHub Discussions)](https://github.com/thinreports/thinreports/discussions)
|
19
|
-
* [Discussion Group (Google Groups)](https://groups.google.com/forum/#!forum/thinreports)
|
33
|
+
## Getting Started
|
20
34
|
|
21
|
-
|
35
|
+
First of all, check out [the README](https://github.com/thinreports/thinreports#getting-started) for an overview of Thinreports, its features, the two template formats available, and a complete example with template files and Ruby code.
|
22
36
|
|
23
|
-
|
24
|
-
* Prawn 2.2, 2.3, 2.4
|
25
|
-
* JRuby 9.2
|
37
|
+
## Usage
|
26
38
|
|
27
|
-
|
39
|
+
See [the README](https://github.com/thinreports/thinreports) for usage of the Section Format.
|
28
40
|
|
29
|
-
|
41
|
+
### Basic Format
|
30
42
|
|
31
|
-
|
43
|
+
The template file (`.tlf`) must be created in [the Basic Editor of the Thinreports Editor](https://github.com/thinreports/thinreports-editor/tree/master/basic-editor).
|
32
44
|
|
33
45
|
```ruby
|
34
46
|
require 'thinreports'
|
@@ -103,7 +115,7 @@ Thinreports::Report.generate(filename: 'report.pdf', layout: 'report.tlf') do |r
|
|
103
115
|
end
|
104
116
|
```
|
105
117
|
|
106
|
-
|
118
|
+
#### Report and Page
|
107
119
|
|
108
120
|
```ruby
|
109
121
|
report = Thinreports::Report.new layout: 'foo.tlf'
|
@@ -121,7 +133,7 @@ report.add_blank_page
|
|
121
133
|
report.pages.last # => Report::BlankPage
|
122
134
|
```
|
123
135
|
|
124
|
-
|
136
|
+
#### Using multiple layouts
|
125
137
|
|
126
138
|
```ruby
|
127
139
|
report = Thinreports::Report.new
|
@@ -142,7 +154,7 @@ report.start_new_page layout: '/path/to/other2.tlf' do |page|
|
|
142
154
|
end
|
143
155
|
```
|
144
156
|
|
145
|
-
|
157
|
+
#### Callbacks
|
146
158
|
|
147
159
|
```ruby
|
148
160
|
report = Thinreports::Report.new layout: 'foo.tlf'
|
@@ -155,7 +167,7 @@ end
|
|
155
167
|
|
156
168
|
See also [features/report_callbacks](https://github.com/thinreports/thinreports-generator/tree/master/test/features/report_callbacks).
|
157
169
|
|
158
|
-
|
170
|
+
#### List
|
159
171
|
|
160
172
|
```ruby
|
161
173
|
report = Thinreports::Report.new layout: 'list.tlf'
|
@@ -204,7 +216,7 @@ end
|
|
204
216
|
|
205
217
|
See also [features/list_events](https://github.com/thinreports/thinreports-generator/tree/master/test/features/list_events).
|
206
218
|
|
207
|
-
|
219
|
+
#### Page Number
|
208
220
|
|
209
221
|
```ruby
|
210
222
|
# Setting starting number of page
|
@@ -225,7 +237,7 @@ end
|
|
225
237
|
|
226
238
|
See also [features/page_number](https://github.com/thinreports/thinreports-generator/blob/master/test/features/page_number) and [features/page_number_with_list](https://github.com/thinreports/thinreports-generator/blob/master/test/features/page_number_with_list).
|
227
239
|
|
228
|
-
|
240
|
+
#### Configuring fallback fonts
|
229
241
|
|
230
242
|
```ruby
|
231
243
|
Thinreports.configure do |config|
|
@@ -237,32 +249,9 @@ Thinreports.config.fallback_fonts = ['/path/to/font_a.ttf', '/path/to/font_b.ttf
|
|
237
249
|
|
238
250
|
See also [features/eudc](https://github.com/thinreports/thinreports-generator/blob/master/test/features/eudc).
|
239
251
|
|
240
|
-
## Features
|
241
|
-
|
242
|
-
Features of Editor is [here](http://www.thinreports.org/features/editor/).
|
243
|
-
|
244
|
-
### Easy to generate PDF
|
245
|
-
|
246
|
-
Design layout using Editor, then embed values to text field in layout.
|
247
|
-
|
248
|
-
### Simple runtime environment
|
249
|
-
|
250
|
-
Ruby, RubyGems, Prawn and Generator.
|
251
|
-
|
252
|
-
### Dynamic operation
|
253
|
-
|
254
|
-
Generator can dynamically:
|
255
|
-
|
256
|
-
* change value of TextBlock and ImageBlock
|
257
|
-
* change style (border, fill, visibility, position, color, font) of Shape
|
258
|
-
|
259
|
-
### Others
|
260
|
-
|
261
|
-
* External characters (Gaiji) for Japanese
|
262
|
-
|
263
252
|
## Contributing
|
264
253
|
|
265
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/thinreports/thinreports-generator.
|
254
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/thinreports/thinreports-generator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/thinreports/thinreports/blob/master/CODE_OF_CONDUCT.md).
|
266
255
|
|
267
256
|
## Development
|
268
257
|
|
@@ -279,17 +268,17 @@ In order to run `test:features`, you need to install [diff-pdf](https://github.c
|
|
279
268
|
You can use the Docker container for development. This container contains the libraries required for testing, such as diff-pdf.
|
280
269
|
|
281
270
|
```
|
282
|
-
$ docker
|
283
|
-
$ docker run -v $PWD:/
|
271
|
+
$ docker pull ghcr.io/hidakatsuya/ruby-with-diff-pdf:latest
|
272
|
+
$ docker run -v $PWD:/src:cached -it ghcr.io/hidakatsuya/ruby-with-diff-pdf bash
|
284
273
|
|
285
|
-
> /
|
274
|
+
> /src#
|
286
275
|
```
|
287
276
|
|
288
277
|
You can run test:
|
289
278
|
|
290
279
|
```
|
291
|
-
> /
|
292
|
-
> /
|
280
|
+
> /src# bundle install
|
281
|
+
> /src# bundle exec rake test:features
|
293
282
|
```
|
294
283
|
|
295
284
|
## Releasing Generator
|
@@ -303,8 +292,8 @@ You can run test:
|
|
303
292
|
|
304
293
|
## License
|
305
294
|
|
306
|
-
|
295
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
307
296
|
|
308
297
|
## Copyright
|
309
298
|
|
310
|
-
|
299
|
+
(c) 2021 [Matsukei Co.,Ltd](http://www.matsukei.co.jp).
|
data/lib/thinreports/report.rb
CHANGED
@@ -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] || {}
|
data/lib/thinreports/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thinreports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
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-
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prawn
|
@@ -101,12 +101,12 @@ extensions: []
|
|
101
101
|
extra_rdoc_files: []
|
102
102
|
files:
|
103
103
|
- ".github/CONTRIBUTING.md"
|
104
|
+
- ".github/dependabot.yml"
|
104
105
|
- ".github/workflows/test.yml"
|
105
106
|
- ".gitignore"
|
106
107
|
- CHANGELOG.md
|
107
|
-
- Dockerfile
|
108
108
|
- Gemfile
|
109
|
-
-
|
109
|
+
- LICENSE.txt
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
112
|
- fonts/IPA_Font_License_Agreement_v1.0.txt
|
@@ -215,7 +215,6 @@ files:
|
|
215
215
|
- lib/thinreports/section_report/pdf/render.rb
|
216
216
|
- lib/thinreports/section_report/pdf/renderer/draw_item.rb
|
217
217
|
- lib/thinreports/section_report/pdf/renderer/group_renderer.rb
|
218
|
-
- lib/thinreports/section_report/pdf/renderer/headers_renderer.rb
|
219
218
|
- lib/thinreports/section_report/pdf/renderer/section_height.rb
|
220
219
|
- lib/thinreports/section_report/pdf/renderer/section_renderer.rb
|
221
220
|
- lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb
|
@@ -245,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
244
|
- !ruby/object:Gem::Version
|
246
245
|
version: '0'
|
247
246
|
requirements: []
|
248
|
-
rubygems_version: 3.1.
|
247
|
+
rubygems_version: 3.1.6
|
249
248
|
signing_key:
|
250
249
|
specification_version: 4
|
251
250
|
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
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Thinreports
|
4
|
-
module SectionReport
|
5
|
-
module Renderer
|
6
|
-
class HeadersRenderer
|
7
|
-
def initialize(pdf)
|
8
|
-
@pdf = pdf
|
9
|
-
@section_renderer = Renderer::SectionRenderer.new(pdf)
|
10
|
-
end
|
11
|
-
|
12
|
-
def render(headers)
|
13
|
-
headers.each do |header|
|
14
|
-
section_renderer.render(header)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
attr_reader :pdf, :section_renderer
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|