Showing preview only (952K chars total). Download the full file or copy to clipboard to get everything.
Repository: thinreports/thinreports-generator
Branch: main
Commit: fbdad1818082
Files: 271
Total size: 857.7 KB
Directory structure:
gitextract_0zurrwy2/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── dependabot.yml
│ └── workflows/
│ └── test.yml
├── .gitignore
├── CHANGELOG.md
├── Gemfile
├── LICENSE.txt
├── README.md
├── Rakefile
├── fonts/
│ └── IPA_Font_License_Agreement_v1.0.txt
├── gemfiles/
│ ├── prawn-2.4.gemfile
│ └── prawn-2.5.gemfile
├── lib/
│ ├── thinreports/
│ │ ├── basic_report/
│ │ │ ├── core/
│ │ │ │ ├── errors.rb
│ │ │ │ ├── format/
│ │ │ │ │ └── base.rb
│ │ │ │ ├── shape/
│ │ │ │ │ ├── base/
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ └── internal.rb
│ │ │ │ │ ├── base.rb
│ │ │ │ │ ├── basic/
│ │ │ │ │ │ ├── block_format.rb
│ │ │ │ │ │ ├── block_interface.rb
│ │ │ │ │ │ ├── block_internal.rb
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ └── internal.rb
│ │ │ │ │ ├── basic.rb
│ │ │ │ │ ├── image_block/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ └── internal.rb
│ │ │ │ │ ├── image_block.rb
│ │ │ │ │ ├── list/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── manager.rb
│ │ │ │ │ │ ├── page.rb
│ │ │ │ │ │ ├── page_state.rb
│ │ │ │ │ │ ├── section_format.rb
│ │ │ │ │ │ ├── section_interface.rb
│ │ │ │ │ │ └── section_internal.rb
│ │ │ │ │ ├── list.rb
│ │ │ │ │ ├── manager/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── internal.rb
│ │ │ │ │ │ └── target.rb
│ │ │ │ │ ├── manager.rb
│ │ │ │ │ ├── page_number/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ └── internal.rb
│ │ │ │ │ ├── page_number.rb
│ │ │ │ │ ├── stack_view/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ ├── internal.rb
│ │ │ │ │ │ └── row_format.rb
│ │ │ │ │ ├── stack_view.rb
│ │ │ │ │ ├── style/
│ │ │ │ │ │ ├── base.rb
│ │ │ │ │ │ ├── basic.rb
│ │ │ │ │ │ ├── graphic.rb
│ │ │ │ │ │ └── text.rb
│ │ │ │ │ ├── style.rb
│ │ │ │ │ ├── text/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ └── internal.rb
│ │ │ │ │ ├── text.rb
│ │ │ │ │ ├── text_block/
│ │ │ │ │ │ ├── format.rb
│ │ │ │ │ │ ├── formatter/
│ │ │ │ │ │ │ ├── basic.rb
│ │ │ │ │ │ │ ├── datetime.rb
│ │ │ │ │ │ │ ├── number.rb
│ │ │ │ │ │ │ └── padding.rb
│ │ │ │ │ │ ├── formatter.rb
│ │ │ │ │ │ ├── interface.rb
│ │ │ │ │ │ └── internal.rb
│ │ │ │ │ └── text_block.rb
│ │ │ │ ├── shape.rb
│ │ │ │ └── utils.rb
│ │ │ ├── generator/
│ │ │ │ ├── pdf/
│ │ │ │ │ ├── document/
│ │ │ │ │ │ ├── draw_shape.rb
│ │ │ │ │ │ ├── draw_template_items.rb
│ │ │ │ │ │ ├── font.rb
│ │ │ │ │ │ ├── graphics/
│ │ │ │ │ │ │ ├── attributes.rb
│ │ │ │ │ │ │ ├── basic.rb
│ │ │ │ │ │ │ ├── image.rb
│ │ │ │ │ │ │ └── text.rb
│ │ │ │ │ │ ├── graphics.rb
│ │ │ │ │ │ ├── page.rb
│ │ │ │ │ │ └── parse_color.rb
│ │ │ │ │ ├── document.rb
│ │ │ │ │ ├── drawer/
│ │ │ │ │ │ ├── base.rb
│ │ │ │ │ │ ├── list.rb
│ │ │ │ │ │ ├── list_section.rb
│ │ │ │ │ │ └── page.rb
│ │ │ │ │ ├── prawn_ext/
│ │ │ │ │ │ ├── calc_image_dimensions.rb
│ │ │ │ │ │ └── width_of.rb
│ │ │ │ │ └── prawn_ext.rb
│ │ │ │ └── pdf.rb
│ │ │ ├── layout/
│ │ │ │ ├── base.rb
│ │ │ │ ├── format.rb
│ │ │ │ ├── legacy_schema.rb
│ │ │ │ └── version.rb
│ │ │ ├── layout.rb
│ │ │ ├── report/
│ │ │ │ ├── base.rb
│ │ │ │ ├── internal.rb
│ │ │ │ └── page.rb
│ │ │ └── report.rb
│ │ ├── basic_report.rb
│ │ ├── config.rb
│ │ ├── section_report/
│ │ │ ├── build.rb
│ │ │ ├── builder/
│ │ │ │ ├── item_builder.rb
│ │ │ │ ├── report_builder.rb
│ │ │ │ ├── report_data.rb
│ │ │ │ ├── stack_view_builder.rb
│ │ │ │ └── stack_view_data.rb
│ │ │ ├── generate.rb
│ │ │ ├── pdf/
│ │ │ │ ├── render.rb
│ │ │ │ └── renderer/
│ │ │ │ ├── draw_item.rb
│ │ │ │ ├── group_renderer.rb
│ │ │ │ ├── section_height.rb
│ │ │ │ ├── section_renderer.rb
│ │ │ │ ├── stack_view_renderer.rb
│ │ │ │ └── stack_view_row_renderer.rb
│ │ │ └── schema/
│ │ │ ├── loader.rb
│ │ │ ├── parser.rb
│ │ │ ├── report.rb
│ │ │ └── section.rb
│ │ ├── section_report.rb
│ │ └── version.rb
│ └── thinreports.rb
├── test/
│ ├── basic_report/
│ │ ├── data/
│ │ │ ├── image_normal_jpg_noext
│ │ │ ├── image_normal_png_noext
│ │ │ └── legacy_layout/
│ │ │ └── all-items.tlf
│ │ ├── features/
│ │ │ ├── dynamic_style/
│ │ │ │ ├── templates/
│ │ │ │ │ ├── styles.tlf
│ │ │ │ │ └── styles_in_list.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── eudc/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── graphics/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── hidden_item/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── image_block/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── list_events/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── list_manually/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── page_number/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── page_number_with_list/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── palleted_png/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── report_callbacks/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_align/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_block_formatting/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_block_overflow/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_block_singleline/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_block_style/
│ │ │ │ ├── templates/
│ │ │ │ │ ├── basic_styles.tlf
│ │ │ │ │ └── font_size.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_character_spacing/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ ├── text_overflow_wrap/
│ │ │ │ ├── template.tlf
│ │ │ │ └── test_feature.rb
│ │ │ └── text_word_wrap/
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── schema_helper.rb
│ │ ├── test_helper.rb
│ │ └── units/
│ │ ├── core/
│ │ │ ├── format/
│ │ │ │ └── test_base.rb
│ │ │ ├── shape/
│ │ │ │ ├── base/
│ │ │ │ │ └── test_internal.rb
│ │ │ │ ├── basic/
│ │ │ │ │ ├── test_block_format.rb
│ │ │ │ │ ├── test_block_interface.rb
│ │ │ │ │ ├── test_block_internal.rb
│ │ │ │ │ ├── test_format.rb
│ │ │ │ │ ├── test_interface.rb
│ │ │ │ │ └── test_internal.rb
│ │ │ │ ├── image_block/
│ │ │ │ │ ├── test_interface.rb
│ │ │ │ │ └── test_internal.rb
│ │ │ │ ├── list/
│ │ │ │ │ ├── test_format.rb
│ │ │ │ │ ├── test_manager.rb
│ │ │ │ │ ├── test_page.rb
│ │ │ │ │ ├── test_page_state.rb
│ │ │ │ │ ├── test_section_format.rb
│ │ │ │ │ ├── test_section_interface.rb
│ │ │ │ │ └── test_section_internal.rb
│ │ │ │ ├── manager/
│ │ │ │ │ ├── test_format.rb
│ │ │ │ │ ├── test_internal.rb
│ │ │ │ │ └── test_target.rb
│ │ │ │ ├── page_number/
│ │ │ │ │ ├── test_format.rb
│ │ │ │ │ ├── test_interface.rb
│ │ │ │ │ └── test_internal.rb
│ │ │ │ ├── styles/
│ │ │ │ │ ├── test_base.rb
│ │ │ │ │ ├── test_basic.rb
│ │ │ │ │ ├── test_graphic.rb
│ │ │ │ │ └── test_text.rb
│ │ │ │ ├── text/
│ │ │ │ │ ├── test_format.rb
│ │ │ │ │ └── test_internal.rb
│ │ │ │ └── text_block/
│ │ │ │ ├── formatter/
│ │ │ │ │ ├── test_basic.rb
│ │ │ │ │ ├── test_datetime.rb
│ │ │ │ │ ├── test_number.rb
│ │ │ │ │ └── test_padding.rb
│ │ │ │ ├── test_format.rb
│ │ │ │ ├── test_formatter.rb
│ │ │ │ ├── test_interface.rb
│ │ │ │ └── test_internal.rb
│ │ │ ├── test_shape.rb
│ │ │ └── test_utils.rb
│ │ ├── generator/
│ │ │ ├── pdf/
│ │ │ │ ├── document/
│ │ │ │ │ ├── graphics/
│ │ │ │ │ │ ├── test_attributes.rb
│ │ │ │ │ │ ├── test_basic.rb
│ │ │ │ │ │ ├── test_image.rb
│ │ │ │ │ │ └── test_text.rb
│ │ │ │ │ ├── test_font.rb
│ │ │ │ │ ├── test_graphics.rb
│ │ │ │ │ ├── test_page.rb
│ │ │ │ │ └── test_parse_color.rb
│ │ │ │ ├── prawn_ext/
│ │ │ │ │ ├── test_calc_image_dimensions.rb
│ │ │ │ │ └── test_width_of.rb
│ │ │ │ └── test_document.rb
│ │ │ └── test_pdf.rb
│ │ ├── layout/
│ │ │ ├── test_base.rb
│ │ │ ├── test_format.rb
│ │ │ ├── test_legacy_schema.rb
│ │ │ └── test_version.rb
│ │ ├── report/
│ │ │ ├── test_base.rb
│ │ │ └── test_internal.rb
│ │ ├── test_layout.rb
│ │ └── test_report.rb
│ ├── feature_test.rb
│ ├── main/
│ │ ├── test_config.rb
│ │ └── test_helper.rb
│ └── section_report/
│ ├── features/
│ │ ├── basic/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── item_follow_stretch/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── item_parameters/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── multiple_groups/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── nonexistent_id/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── section_auto_stretch/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── section_bottom_margin/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── section_parameters/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── stack_view/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── stack_view_row_auto_stretch/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── stack_view_row_bottom_margin/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── stack_view_row_parameters/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ ├── stack_view_with_floating_item/
│ │ │ ├── README.md
│ │ │ ├── template.tlf
│ │ │ └── test_feature.rb
│ │ └── text_block_vertical_align/
│ │ ├── README.md
│ │ ├── template.tlf
│ │ └── test_feature.rb
│ └── test_helper.rb
└── thinreports.gemspec
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CONTRIBUTING.md
================================================
We only accept bug reports and pull requests in GitHub.
If you have a support question about how to use thinreports, please [ask on GitHub Discussions](https://github.com/thinreports/thinreports/discussions).
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on:
push:
branches:
- main
- "dev**"
pull_request:
jobs:
setup:
name: Ruby ${{ matrix.ruby }} with prawn ${{ matrix.prawn }}
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
prawn:
- "2.4"
- "2.5"
steps:
- uses: actions/checkout@v4
- uses: hidakatsuya/action-setup-diff-pdf@v1
with:
diff-pdf-version: "0.5"
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: bundle install --gemfile gemfiles/prawn-${{ matrix.prawn }}.gemfile --jobs 4 --retry 3
- name: Run tests for main
run: bundle exec rake test:main
- name: Run tests for basic report
run: xvfb-run -a bundle exec rake test:basic_report
- name: Run tests for section report
run: xvfb-run -a bundle exec rake test:section_report
================================================
FILE: .gitignore
================================================
Gemfile.lock
*.gem
*.pdf
.bundle
.yardoc
doc
!/test/**/*/expect.pdf
================================================
FILE: CHANGELOG.md
================================================
## main (Unreleased)
## 0.14.2
Changes:
* Add base64 and bigdecimal to the gemspec #133
* Remove matrix gem version constraint
## 0.14.1
Enhancements:
* Add overflow-wrap option #129
## 0.14.0
Breaking Changes:
* Drop Ruby 2.7 support
Bug Fixes:
* Fix LoadError: cannot load such file -- matrix #131
## 0.13.1
Bug Fixes:
* allow title argument to be specified in Report.generate method #127
## 0.13.0
Breaking Changes:
* Drop Ruby 2.5,2.6,JRuby support
* Drop Prawn 2.2, 2.3 support
* Moved Basic Format implementation to `Thinreports::BasicReport` namespace
* `Thinreports::Report` and `Thinreports::Layout` are defined as aliases for `Thinreports::BasicReport::Report` and `Thinreports::BasicReport::Layout` respectively, but other than those can be a destructive change if you rely on internal implementations
Enhancements:
* Allow any string to be set to the title attribute of the PDF document metadata #125
* Add Ruby 3.1, 3.2 support
Notes:
* thinreports gem has opted in to the ["MFA required to publish" setting](https://guides.rubygems.org/mfa-requirement-opt-in/) on Rubygems.org
## 0.12.1
Bug Fixes:
* Fix argument of Thinreports::Report.generate in Ruby 3.0 #116 [@sada]
## 0.12.0
Breaking Changes:
* Drop Ruby 2.4 support #108, #109
Enhancements:
* Ruby 3.0 support #108, #109
* Prawn 2.4 support #108, #109
## 0.11.0
Breaking Changes:
* Dropped Ruby 2.1 support
* Dropped Ruby 2.2 support
* Dropped Ruby 2.3 support
* Formatter of a text-block works even with multiple-line (#95)
Enhancements:
* Ruby 2.7.0 support
* Support Pathname layout option on `Thinreports::Report` #99 [@meganemura]
Bug Fixes:
* Fixed: thousands separation is applied to decimal part #95
## 0.10.3
Bug Fixes:
* Fixed: corner-radius of Rect is not applied correctly #93
## 0.10.2
Bug Fixes:
* Fixed: Prawn::Errors::UnknownFont error occured: "is not a known font" #89
## 0.10.1
Bug Fixes:
* Fixed a bug that an error occurred on page break in other list when there is a list with page-break disabled #87 [@meganemura]
## 0.10.0
* Thinreports requires Prawn 2.2
* Dropped Ruby 1.9.3 and 2.0.0 support
* Fixed a bug line-height of a text line-wrapped is broken #36 [@tkobayashi0330]
* Remove deprecated top-module `ThinReports`
* Remove `config.convert_palleted_transparency_png` option
* Remove `config.generator.default` option
* Deprecate `:report` and `:generator` argument of `Thinreports::Report.generate`
### Remove config.convert_palleted_transparency_png option
PNG image with indexed transparency has been supported since Prawn version 2.0. And now, thinreports requires Prawn 2.2+, so the unique support in thinreports is no longer needed.
### Remove deprecated top-module ThinReports
Please use `Thinreports` instead.
## 0.9.1
* Fixed bug that line-height of text-block is always set to 0 #68
* Fixed a referenced text-block not rendered #68
* Fixed #66 an error occurred when render list #68
## 0.9.0
* Drop support for layout file saved with Editor v0.7 or lower #62
* New format for layout file and deprecate old format #35
* Fixed fail in rendering a static image #61
* Make possible to set an image-data to image-block item #65
* Remove old way to define callback of list #54
* Remove `config.eudc_fonts=` option #53
* Deprecate `config.convert_palleted_transparency_png` option #49
### Drop support for layout file saved with Editor v0.7 or lower
Generator v0.9 or higher can't load the layout file saved with Editor v0.7 or lower.
### New format for layout file and deprecate old format
This is a BIG internal change.
Thinreports has two format types for layout file now:
1. Old format generated by Thinreports Editor 0.8.x or lower
2. New format generated by Thinreports Editor 0.9.x or higher
thinreports-generator will supports as below:
| Generator | Format type(1) | Format type(2) |
| ---------- | :------------: | :------------: |
| =< 0.8 | o | x |
| 0.9, 1.0 | o | o |
| >= 1.1 | x | o |
See https://github.com/thinreports/thinreports/issues/4 for further details.
### Make possible to set an image-data to image-block item
The following code works fine now.
```ruby
png_image = StringIO.new(png_data)
page.item(:image_block).src(png_image)
require 'open-uri'
open('http://example.com/image.png') do |image_data|
page.item(:image_block).src(image_data)
end
```
### Remove old way to define callback of list
The block of `Report::Base#use_layout` never performed:
```ruby
report.use_layout 'foo.tlf' do |config|
config.events.on(:page_create) { ... }
config.list.events.on(:footer_insert) { ... }
end
```
`List#store` and `List#events` has been removed:
```ruby
report.list.store.foo += 1 # => NoMethodError
report.list.events.on(:footer_insert) { ... } # => NoMethodError
```
`Layout::Base#config` has been removed:
```ruby
report.default_layout.config { ... } # => NoMethodError
```
You can use the following method instead:
* `Report::Base#on_page_create`
* `List#on_page_finalize`
* `List#on_footer_insert`
* `List#on_page_footer_insert`
See https://github.com/thinreports/thinreports-generator/tree/master/examples/list_events.
### Remove config.eudc_fonts= option
```ruby
Thinreports.config.eudc_fonts = true # => NoMethodError
```
You can use `config.fallback_fonts` instead.
### Deprecate config.convert_palleted_transparency_png option
```ruby
Thinreports.config.convert_palleted_transparency_png = true # => warn "[DEPRECATION]"
```
This is option to enable palette-based transparency PNG support.
The option will be removed in version 1.0, but thinreports will support the feature by default.
Please see [PR#32](https://github.com/thinreports/thinreports-generator/pull/32) for detailed the feature.
## 0.8.2
* Fixed: some Ruby warnings (#40, #41, #43) [Akira Matsuda, Katsuya Hidaka]
* Some code improvements
## 0.8.1
### Add OPTIONAL feature for converting a palette-based PNG w. transparency
This feature is **DISABLED** by default. Please see [PR#32](https://github.com/thinreports/thinreports-generator/pull/32) for further details.
## 0.8.0
This release is a stepping stone to next major version 1.0.0 release.
* Upgrade to Prawn 1.3 and drop support for Ruby 1.8.7 (#11)
* Change name of root module to Thinreports from ThinReports (#15)
* Implement `Item#value=` method (#20)
* Implement new list callbacks (#17)
* Implement `page[:item_id]=` as alias for `page.item(:item_id).value=` (#22)
* Support font-size style for Text and TextBlock (#23)
* Support for setting the default fallback font (#7)
* Remove `Report#generate_file` method (#13)
* Deprecate `Report#events`, and implement new callbacks (#18)
* Deprecate `List#events`, recommend to use `List#on_page_finalize` callback or create manually (#9)
### Upgrade to Prawn 1.3 and drop support for Ruby 1.8.7
We have dropped support for MRI 1.8.7 and 1.8 mode JRuby by upgrading to Prawn 1.3.
Currently supported versions are MRI 1.9.3 and 2.0.0 or higher, JRuby(1.9 mode) 1.7 or higher.
### Change name of root module to Thinreports from ThinReports
We have changed name of root module to `Thinreports` from `ThinReports`.
Old name `ThinReports` has been enabling as alias, but it will be removed
in the next major release.
### Deprecate `List#events` and `List#store`
`List#events` and `List#store` have been deprecated.
```ruby
report.layout.config.list do |list|
list.events.on :page_footer_insert do |e|
# ...
end
# => warn: "[DEPRECATION] ..."
list.events.on :footer_insert do |e|
# ...
end
# => warn: "[DEPRECATION] ..."
list.events.on :page_finalize do |e|
# ...
end
# => warn: "[DEPRECATION] ..."
end
list.store.price += 0 # => warn: "[DEPRECATION] ..."
```
Please use new callbacks instead:
```ruby
report.list do |list|
price = 0
list.on_page_footer_insert do |footer|
footer.item(:price).value = price
end
list.on_footer_insert do |footer|
# ...
end
list.on_page_finalize do
# ...
end
end
```
See [Issue #17](https://github.com/thinreports/thinreports-generator/issues/17), [Issue #9](https://github.com/thinreports/thinreports-generator/issues/9) and [examples/list_events](https://github.com/thinreports/thinreports-generator/tree/master/examples/list_events) for further details.
### Deprecate `Report#events`, and implement new callbacks
`Report#events` has been deprecated:
```ruby
report.events.on :page_create do |e|
e.page.item(:text1).value('Text1')
end
# => warn: "[DEPRECATION] ..."
report.events.on :generate do |e|
e.pages.each do |page|
page.item(:text2).value('Text2')
end
end
# => warn: "[DEPRECATION] ..."
```
Please use `Report#on_page_create` callback instead.
However `Report#on_generate` callback has not been implemented,
but you can do the same things using `Report#pages` method.
```ruby
report.on_page_create do |page|
page.item(:text1).value('Text1')
end
report.pages.each do |page|
page.item(:text2).value('Text2')
end
report.generate filename: 'foo.pdf'
```
See [Issue #18](https://github.com/thinreports/thinreports-generator/issues/18) for further details.
### Implement `page[:item_id]=` as alias for `page.item(:item_id).value=` (#22)
```ruby
# New setter, same as `page.item(:text_block).value = 'tblock value'`
page[:text_block] = 'tblock value'
# New getter, same as `page.item(:text_block).value`
page[:text_block] # => <Tblock>
page[:text_block].value # => "tblock value"
page.item(:text_block).value # => "tblock value"
page[:image_block] = '/path/to/image.png'
page[:image_block].src # => "/path/to/image.png"
page.item(:image_block).src # => "/path/to/image.png"
```
See [Issue #22](https://github.com/thinreports/thinreports-generator/issues/22) for further details.
### Implement `Item#value=` method
```ruby
page.item(:text_block).value('value')
page.item(:text_block).value = 'value'
page.item(:image_block).src('/path/to/image.tlf')
page.item(:image_block).src = '/path/to/image.tlf'
```
See [Issue #20](https://github.com/thinreports/thinreports-generator/issues/20) for further details.
### Support font-size style for Text and TextBlock
```ruby
page.item(:text).style(:font_size, 20)
page.item(:text_block).style(:font_size, 20)
page.item(:text_block).style(:font_size) # => 20
```
See [Issue #23](https://github.com/thinreports/thinreports-generator/issues/23) for further details.
### Support for setting the default fallback font
Please see [Issue #7](https://github.com/thinreports/thinreports-generator/issues/7) for further details.
## 0.7.7.1
* No release for generator
## 0.7.7
### Features
* ページ番号ツール [Katsuya Hidaka]
* New "Word-wrap" property of TextBlock [Katsuya Hidaka]
* B4/B5 の ISO サイズを追加 [Takumi FUJISE / Minoru Maeda / Katsuya Hidaka]
* generate filename: 'foo.pdf' を実装、#generate_file を非推奨へ [Katsuya Hidaka]
* start_new_page layout: 'file.tlf' でもデフォルトレイアウトが設定されるよう改善 [Eito Katagiri / Katsuya Hidaka]
### Bug fixes
* Report#use_layout で list の設定を行うとエラーが発生する [Katsuya Hidaka]
* Layout::Format#page_margin_right が不正な値を返す [Katsuya Hidaka]
* セキュリティを設定した PDF を印刷すると "このページにはエラーがあります..." メッセージが表示される [Katsuya Hidaka]
* B4 サイズで出力した PDF の用紙サイズが正しくない [Takumi FUJISE / Katsuya Hidaka]
## 0.7.6
### Features
* デフォルトレイアウトを書き換え可能へ変更 [Katsuya Hidaka]
### Bug fixes
* Fix raise NoMethodError when has no default layout [Katsuya Hidaka]
## 0.7.5
### Features
* テキストブロックのオーバフロープロパティ [Katsuya Hidaka]
* list メソッドのデフォルト id と Report#list の追加 [Katsuya Hidaka]
### Bug fixes
* gem install 時にRDoc生成時のエラーが表示される場合がある [Katsuya Hidaka]
* エディターにて一覧表ツールのヘッダーを使わない場合の動作について [吉田 和弘 / Katsuya Hidaka]
## 0.7.0
### Features
* Listに :page_finalize イベントを追加
* ダイナミックスタイルの拡充
* イメージブロックの実装
* Tblockで行間、横位置、縦位置、文字間隔の指定を可能に
* Prawn 0.12.0 を採用
* メタ情報のタイトルに反映
* Example Test環境の構築
* 外字の埋め込みサポート
* clean taskの削除
* YARD Docのテンプレート追加
* ロードするprawnのバージョンを固定
* .generate, .generate_fileメソッドのオプション指定をフラット化
* 単行モードテキストブロックがレイアウトで定義した「高さ」の影響を受けないように
* PXD形式の出力フォーマット廃止とデフォルトタイプの導入
* $KCODEによる文字カウント処理の改善
* List#headerの挙動を改善
* Errors::UnknownItemId 時のエラーメッセージを分かりやすく
* テスト漏れに対するテストコード作成とテスト
### Bug fixes
* フッターが挿入時、リスト領域をオーバフローしない場合でも改ページされる場合がある
* Tblockで基本書式のみ設定されている場合、その書式が反映されない
* Tblockがフォントサイズに対して小さすぎる場合にエラー
================================================
FILE: Gemfile
================================================
# frozen_string_literal: true
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gemspec
gem 'rake'
gem 'minitest'
gem 'mocha'
gem 'pdf-inspector'
gem 'pdf_matcher-testing'
# suppress warning: assigned but unused variable - y1
# https://github.com/yob/pdf-reader/pull/502
gem 'pdf-reader', github: 'yob/pdf-reader', ref: 'dc7e6e46e1d842486bd34288df087b590e8a7b38'
================================================
FILE: LICENSE.txt
================================================
The MIT License (MIT)
Copyright (c) 2015 Matsukei Co.,Ltd.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# Thinreports Generator
[](http://badge.fury.io/rb/thinreports)
[](https://github.com/thinreports/thinreports-generator/actions)
A Ruby library for [Thinreports](https://github.com/thinreports/thinreports).
## Prerequisites
### Supported Versions
- Ruby 3.0, 3.1, 3.2, 3.3
- Prawn 2.4+
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'thinreports'
```
And then execute:
$ bundle install
Or install it yourself as:
$ gem install thinreports
## Getting Started
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.
## Usage
See [the README](https://github.com/thinreports/thinreports) for usage of the Section Format.
### Basic Format
The template file (`.tlf`) must be created in the [Thinreports Basic Editor](https://github.com/thinreports/thinreports-basic-editor/).
```ruby
require 'thinreports'
report = Thinreports::Report.new layout: 'report.tlf'
report.start_new_page do
item(:title).value('Thinreports')
end
report.start_new_page do |page|
# Item Finder
page.item(:item_id) # => Item object
page[:item_id] # => Item object
# Text block
page.item(:text_block).value('Pure Ruby')
page.item(:text_block).value = 'Pure Ruby'
page[:text_block] = 'Pure Ruby'
page.item('text_block').set('value', color: '#0000ff')
page.item(:text_block).format_enabled(false)
# Image block
page.item(:image_block).src('/path/to/image.png')
page.item(:image_block).src = '/path/to/image.png'
page[:image_block] = '/path/to/image.png'
require 'open-uri'
page.item(:image_block).src(open('http://www.thinreports.org/assets/logos/thinreports-logo.png'))
# Attributes
page.item(:any).hide
page.item(:any).show
page.item(:any).visible(true)
page.item(:any).visible? # => true
page.item(:any).id # => "any"
# Styles
page.item(:text).style(:color, 'red')
page.item(:text).style(:bold, true)
page.item(:text).style(:italic, true)
page.item(:text).style(:linethrough, true)
page.item(:text).style(:underline, true)
page.item(:text).style(:font_size, 20)
page.item(:text).style(:align, :left or :center or :right)
page.item(:text).style(:valign, :top or :center or :bottom)
page.item(:rectangle).style(:border_color, '#ff0000')
.style(:border_width, 1)
.style(:fill_color, '#ffffff')
# Bulk setting of styles
page.item(:text).styles(color: '#00000', align: :right)
# Bulk setting of values
page.values text_block_a: 'value', text_block_b: 'value'
# Helpers
page.item_exists?(:existing_id) # => true
page.item_exists?('existing_id') # => true
page.item_exists?(:unknown_id) # => false
end
report.generate(filename: 'report.pdf')
```
```ruby
Thinreports::Report.generate(filename: 'report.pdf', layout: 'report.tlf') do |report|
report.start_new_page do |page|
# :
end
end
```
#### Report and Page
```ruby
report = Thinreports::Report.new layout: 'foo.tlf'
3.times { report.start_new_page }
# Returns all pages
report.pages # => [<Report::Page>, <Report::Page>, <Report::Page>]
# Returns number of pages
report.page_count # => 3
# Add a blank page
report.add_blank_page
report.pages.last # => Report::BlankPage
```
#### Using multiple layouts
```ruby
report = Thinreports::Report.new
report.use_layout '/path/to/default.tlf', default: true
report.use_layout '/path/to/other1.tlf', id: :other
report.start_new_page do |page|
# use '/path/to/default.tlf' layout
end
report.start_new_page layout: :other do |page|
# use '/path/to/other1.tlf' layout
end
report.start_new_page layout: '/path/to/other2.tlf' do |page|
# use '/path/to/other2.tlf' layout
end
```
#### Callbacks
```ruby
report = Thinreports::Report.new layout: 'foo.tlf'
# It will be called before finalizing each page
report.on_page_create do |page|
page.item(:text).value('Text for all pages')
end
```
See also [basic_report/features/report_callbacks](https://github.com/thinreports/thinreports-generator/tree/main/test/basic_report/features/report_callbacks).
#### List
```ruby
report = Thinreports::Report.new layout: 'list.tlf'
report.list.header do |header|
header.item(:text_block).value('Title')
end
10.times do |n|
report.list.add_row do |row|
row.item(:text_block).value(n)
end
end
report.generate(filename: 'list.pdf')
```
```ruby
report = Thinreports::Report.new layout: 'list_with_footer.tlf'
report.list do |list|
total_price = 0
price_per_page = 0
list.on_page_finalize do
total_price += price_per_page
price_per_page = 0
end
list.on_page_footer_insert do |footer|
footer.values price: price_per_page
end
list.on_footer_insert do |footer|
footer.item(:price).value(total_price)
end
[100, 200, 300].each do |price|
list.add_row do |row|
row[:price] = price
end
price_per_page += price
end
end
```
See also [basic_report/features/list_events](https://github.com/thinreports/thinreports-generator/tree/main/test/basic_report/features/list_events).
#### Page Number
```ruby
# Setting starting number of page
report.start_page_number_from 5
# Setting whether to count new page
report.start_new_page count: true # default
report.start_new_page count: false
# Change styles
report.start_new_page do |page|
page.item(:pageno).hide
page.item(:pageno).show
page.item(:pageno).visible(false)
page.item(:pageno).styles(color: 'red', bold: true)
end
```
See also [basic_report/features/page_number](https://github.com/thinreports/thinreports-generator/blob/main/test/basic_report/features/page_number) and [basic_report/features/page_number_with_list](https://github.com/thinreports/thinreports-generator/blob/main/test/basic_report/features/page_number_with_list).
#### Configuring fallback fonts
```ruby
Thinreports.configure do |config|
config.fallback_fonts = '/path/to/fallback.ttf'
end
Thinreports.config.fallback_fonts = ['/path/to/font_a.ttf', '/path/to/font_b.ttf']
```
See also [basic_report/features/eudc](https://github.com/thinreports/thinreports-generator/blob/main/test/basic_report/features/eudc).
## Contributing
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/main/CODE_OF_CONDUCT.md).
## Development
### Feature test requires diff-pdf command
In order to run feature test, you need to install [diff-pdf](https://github.com/vslavik/diff-pdf) in your environment, or you can run test in the docker container as below.
### How to develop in Docker container
You can use the Docker container for development. This container contains the libraries required for testing, such as diff-pdf.
```
$ docker pull ghcr.io/hidakatsuya/ruby-with-diff-pdf:latest
$ docker run -v $PWD:/src:cached -it ghcr.io/hidakatsuya/ruby-with-diff-pdf bash
> /src#
```
You can run test:
```
> /src# bundle install
> /src# bundle exec rake test
```
## Releasing Generator
1. Update the version number in `version.rb`
2. Update `CHANGELOG.md` and `README.md` (if needed)
3. Create the Release PR like #105
4. Merge the PR
5. Is the main CI green? If not, make it green
6. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to rubygems.org
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Copyright
(c) 2021 [Matsukei Co.,Ltd](http://www.matsukei.co.jp).
================================================
FILE: Rakefile
================================================
require 'bundler/gem_tasks'
require 'rake/testtask'
task default: :test
Rake::TestTask.new do |t|
t.name = 'test:main'
t.description = 'Run tests for main'
t.libs << 'test/main'
t.test_files = Dir['test/main/**/test_*.rb']
end
Rake::TestTask.new do |t|
t.name = 'test:basic_report'
t.description = 'Run tests for basic report'
t.libs << 'test' << 'test/basic_report'
t.test_files = Dir['test/basic_report/**/test_*.rb']
end
Rake::TestTask.new do |t|
t.name = 'test:section_report'
t.description = 'Run tests for section report'
t.libs << 'test' << 'test/section_report'
t.test_files = Dir['test/section_report/**/test_*.rb']
end
desc 'Run all tests'
task test: %i(test:main test:basic_report test:section_report)
================================================
FILE: fonts/IPA_Font_License_Agreement_v1.0.txt
================================================
--------------------------------------------------
IPA Font License Agreement v1.0 <Japanese/English>
--------------------------------------------------
IPAフォントライセンスv1.0
許諾者は、この使用許諾(以下「本契約」といいます。)に定める条件の下で、許諾プログラム(1条に定義するところによります。)を提供します。受領者(1条に定義するところによります。)が、許諾プログラムを使用し、複製し、または頒布する行為、その他、本契約に定める権利の利用を行った場合、受領者は本契約に同意したものと見なします。
第1条 用語の定義
本契約において、次の各号に掲げる用語は、当該各号に定めるところによります。
1.「デジタル・フォント・プログラム」とは、フォントを含み、レンダリングしまたは表示するために用いられるコンピュータ・プログラムをいいます。
2.「許諾プログラム」とは、許諾者が本契約の下で許諾するデジタル・フォント・プログラムをいいます。
3.「派生プログラム」とは、許諾プログラムの一部または全部を、改変し、加除修正等し、入れ替え、その他翻案したデジタル・フォント・プログラムをいい、許諾プログラムの一部もしくは全部から文字情報を取り出し、またはデジタル・ドキュメント・ファイルからエンベッドされたフォントを取り出し、取り出された文字情報をそのまま、または改変をなして新たなデジタル・フォント・プログラムとして製作されたものを含みます。
4.「デジタル・コンテンツ」とは、デジタル・データ形式によってエンド・ユーザに提供される制作物のことをいい、動画・静止画等の映像コンテンツおよびテレビ番組等の放送コンテンツ、ならびに文字テキスト、画像、図形等を含んで構成された制作物を含みます。
5.「デジタル・ドキュメント・ファイル」とは、PDFファイルその他、各種ソフトウェア・プログラムによって製作されたデジタル・コンテンツであって、その中にフォントを表示するために許諾プログラムの全部または一部が埋め込まれた(エンベッドされた)ものをいいます。フォントが「エンベッドされた」とは、当該フォントが埋め込まれた特定の「デジタル・ドキュメント・ファイル」においてのみ表示されるために使用されている状態を指し、その特定の「デジタル・ドキュメント・ファイル」以外でフォントを表示するために使用できるデジタル・フォント・プログラムに含まれている場合と区別されます。
6.「コンピュータ」とは、本契約においては、サーバを含みます。
7.「複製その他の利用」とは、複製、譲渡、頒布、貸与、公衆送信、上映、展示、翻案その他の利用をいいます。
8.「受領者」とは、許諾プログラムを本契約の下で受領した人をいい、受領者から許諾プログラムを受領した人を含みます。
第2条 使用許諾の付与
許諾者は受領者に対し、本契約の条項に従い、すべての国で、許諾プログラムを使用することを許諾します。ただし、許諾プログラムに存在する一切の権利はすべて許諾者が保有しています。本契約は、本契約で明示的に定められている場合を除き、いかなる意味においても、許諾者が保有する許諾プログラムに関する一切の権利および、いかなる商標、商号、もしくはサービス・マークに関する権利をも受領者に移転するものではありません。
1.受領者は本契約に定める条件に従い、許諾プログラムを任意の数のコンピュータにインストールし、当該コンピュータで使用することができます。
2.受領者はコンピュータにインストールされた許諾プログラムをそのまま、または改変を行ったうえで、印刷物およびデジタル・コンテンツにおいて、文字テキスト表現等として使用することができます。
3.受領者は前項の定めに従い作成した印刷物およびデジタル・コンテンツにつき、その商用・非商用の別、および放送、通信、各種記録メディアなどの媒体の形式を問わず、複製その他の利用をすることができます。
4.受領者がデジタル・ドキュメント・ファイルからエンベッドされたフォントを取り出して派生プログラムを作成した場合には、かかる派生プログラムは本契約に定める条件に従う必要があります。
5.許諾プログラムのエンベッドされたフォントがデジタル・ドキュメント・ファイル内のデジタル・コンテンツをレンダリングするためにのみ使用される場合において、受領者が当該デジタル・ドキュメント・ファイルを複製その他の利用をする場合には、受領者はかかる行為に関しては本契約の下ではいかなる義務をも負いません。
6.受領者は、3条2項の定めに従い、商用・非商用を問わず、許諾プログラムをそのままの状態で改変することなく複製して第三者への譲渡し、公衆送信し、その他の方法で再配布することができます(以下、「再配布」といいます。)。
7.受領者は、上記の許諾プログラムについて定められた条件と同様の条件に従って、派生プログラムを作成し、使用し、複製し、再配布することができます。ただし、受領者が派生プログラムを再配布する場合には、3条1項の定めに従うものとします。
第3条 制限
前条により付与された使用許諾は、以下の制限に服します。
1.派生プログラムが前条4項及び7項に基づき再配布される場合には、以下の全ての条件を満たさなければなりません。
(1)派生プログラムを再配布する際には、下記もまた、当該派生プログラムと一緒に再配布され、オンラインで提供され、または、郵送費・媒体及び取扱手数料の合計を超えない実費と引き換えに媒体を郵送する方法により提供されなければなりません。
(a)派生プログラムの写し; および
(b)派生プログラムを作成する過程でフォント開発プログラムによって作成された追加のファイルであって派生プログラムをさらに加工するにあたって利用できるファイルが存在すれば、当該ファイル
(2)派生プログラムの受領者が、派生プログラムを、このライセンスの下で最初にリリースされた許諾プログラム(以下、「オリジナル・プログラム」といいます。)に置き換えることができる方法を再配布するものとします。かかる方法は、オリジナル・ファイルからの差分ファイルの提供、または、派生プログラムをオリジナル・プログラムに置き換える方法を示す指示の提供などが考えられます。
(3)派生プログラムを、本契約書に定められた条件の下でライセンスしなければなりません。
(4)派生プログラムのプログラム名、フォント名またはファイル名として、許諾プログラムが用いているのと同一の名称、またはこれを含む名称を使用してはなりません。
(5)本項の要件を満たすためにオンラインで提供し、または媒体を郵送する方法で提供されるものは、その提供を希望するいかなる者によっても提供が可能です。
2.受領者が前条6項に基づき許諾プログラムを再配布する場合には、以下の全ての条件を満たさなければなりません。
(1)許諾プログラムの名称を変更してはなりません。
(2)許諾プログラムに加工その他の改変を加えてはなりません。
(3)本契約の写しを許諾プログラムに添付しなければなりません。
3.許諾プログラムは、現状有姿で提供されており、許諾プログラムまたは派生プログラムについて、許諾者は一切の明示または黙示の保証(権利の所在、非侵害、商品性、特定目的への適合性を含むがこれに限られません)を行いません。いかなる場合にも、その原因を問わず、契約上の責任か厳格責任か過失その他の不法行為責任かにかかわらず、また事前に通知されたか否かにかかわらず、許諾者は、許諾プログラムまたは派生プログラムのインストール、使用、複製その他の利用または本契約上の権利の行使によって生じた一切の損害(直接・間接・付随的・特別・拡大・懲罰的または結果的損害)(商品またはサービスの代替品の調達、システム障害から生じた損害、現存するデータまたはプログラムの紛失または破損、逸失利益を含むがこれに限られません)について責任を負いません。
4.許諾プログラムまたは派生プログラムのインストール、使用、複製その他の利用に関して、許諾者は技術的な質問や問い合わせ等に対する対応その他、いかなるユーザ・サポートをも行う義務を負いません。
第4条 契約の終了
1.本契約の有効期間は、受領者が許諾プログラムを受領した時に開始し、受領者が許諾プログラムを何らかの方法で保持する限り続くものとします。
2.前項の定めにかかわらず、受領者が本契約に定める各条項に違反したときは、本契約は、何らの催告を要することなく、自動的に終了し、当該受領者はそれ以後、許諾プログラムおよび派生プログラムを一切使用しまたは複製その他の利用をすることができないものとします。ただし、かかる契約の終了は、当該違反した受領者から許諾プログラムまたは派生プログラムの配布を受けた受領者の権利に影響を及ぼすものではありません。
第5条 準拠法
1.IPAは、本契約の変更バージョンまたは新しいバージョンを公表することができます。その場合には、受領者は、許諾プログラムまたは派生プログラムの使用、複製その他の利用または再配布にあたり、本契約または変更後の契約のいずれかを選択することができます。その他、上記に記載されていない条項に関しては日本の著作権法および関連法規に従うものとします。
2.本契約は、日本法に基づき解釈されます。
----------
IPA Font License Agreement v1.0
The Licensor provides the Licensed Program (as defined in Article 1 below) under the terms of this license agreement (“Agreement”). Any use, reproduction or distribution of the Licensed Program, or any exercise of rights under this Agreement by a Recipient (as defined in Article 1 below) constitutes the Recipient's acceptance of this Agreement.
Article 1 (Definitions)
1.“Digital Font Program” shall mean a computer program containing, or used to render or display fonts.
2.“Licensed Program” shall mean a Digital Font Program licensed by the Licensor under this Agreement.
3.“Derived Program” shall mean a Digital Font Program created as a result of a modification, addition, deletion, replacement or any other adaptation to or of a part or all of the Licensed Program, and includes a case where a Digital Font Program newly created by retrieving font information from a part or all of the Licensed Program or Embedded Fonts from a Digital Document File with or without modification of the retrieved font information.
4.“Digital Content” shall mean products provided to end users in the form of digital data, including video content, motion and/or still pictures, TV programs or other broadcasting content and products consisting of character text, pictures, photographic images, graphic symbols and/or the like.
5.“Digital Document File” shall mean a PDF file or other Digital Content created by various software programs in which a part or all of the Licensed Program becomes embedded or contained in the file for the display of the font (“Embedded Fonts”). Embedded Fonts are used only in the display of characters in the particular Digital Document File within which they are embedded, and shall be distinguished from those in any Digital Font Program, which may be used for display of characters outside that particular Digital Document File.
6.“Computer” shall include a server in this Agreement.
7.“Reproduction and Other Exploitation” shall mean reproduction, transfer, distribution, lease, public transmission, presentation, exhibition, adaptation and any other exploitation.
8.“Recipient” shall mean anyone who receives the Licensed Program under this Agreement, including one that receives the Licensed Program from a Recipient.
Article 2 (Grant of License)
The Licensor grants to the Recipient a license to use the Licensed Program in any and all countries in accordance with each of the provisions set forth in this Agreement. However, any and all rights underlying in the Licensed Program shall be held by the Licensor. In no sense is this Agreement intended to transfer any right relating to the Licensed Program held by the Licensor except as specifically set forth herein or any right relating to any trademark, trade name, or service mark to the Recipient.
1.The Recipient may install the Licensed Program on any number of Computers and use the same in accordance with the provisions set forth in this Agreement.
2.The Recipient may use the Licensed Program, with or without modification in printed materials or in Digital Content as an expression of character texts or the like.
3.The Recipient may conduct Reproduction and Other Exploitation of the printed materials and Digital Content created in accordance with the preceding Paragraph, for commercial or non-commercial purposes and in any form of media including but not limited to broadcasting, communication and various recording media.
4.If any Recipient extracts Embedded Fonts from a Digital Document File to create a Derived Program, such Derived Program shall be subject to the terms of this agreement.
5.If any Recipient performs Reproduction or Other Exploitation of a Digital Document File in which Embedded Fonts of the Licensed Program are used only for rendering the Digital Content within such Digital Document File then such Recipient shall have no further obligations under this Agreement in relation to such actions.
6.The Recipient may reproduce the Licensed Program as is without modification and transfer such copies, publicly transmit or otherwise redistribute the Licensed Program to a third party for commercial or non-commercial purposes (“Redistribute”), in accordance with the provisions set forth in Article 3 Paragraph 2.
7.The Recipient may create, use, reproduce and/or Redistribute a Derived Program under the terms stated above for the Licensed Program: provided, that the Recipient shall follow the provisions set forth in Article 3 Paragraph 1 when Redistributing the Derived Program.
Article 3 (Restriction)
The license granted in the preceding Article shall be subject to the following restrictions:
1.If a Derived Program is Redistributed pursuant to Paragraph 4 and 7 of the preceding Article, the following conditions must be met :
(1)The following must be also Redistributed together with the Derived Program, or be made available online or by means of mailing mechanisms in exchange for a cost which does not exceed the total costs of postage, storage medium and handling fees:
(a)a copy of the Derived Program; and
(b)any additional file created by the font developing program in the course of creating the Derived Program that can be used for further modification of the Derived Program, if any.
(2)It is required to also Redistribute means to enable recipients of the Derived Program to replace the Derived Program with the Licensed Program first released under this License (the “Original Program”). Such means may be to provide a difference file from the Original Program, or instructions setting out a method to replace the Derived Program with the Original Program.
(3)The Recipient must license the Derived Program under the terms and conditions of this Agreement.
(4)No one may use or include the name of the Licensed Program as a program name, font name or file name of the Derived Program.
(5)Any material to be made available online or by means of mailing a medium to satisfy the requirements of this paragraph may be provided, verbatim, by any party wishing to do so.
2.If the Recipient Redistributes the Licensed Program pursuant to Paragraph 6 of the preceding Article, the Recipient shall meet all of the following conditions:
(1)The Recipient may not change the name of the Licensed Program.
(2)The Recipient may not alter or otherwise modify the Licensed Program.
(3)The Recipient must attach a copy of this Agreement to the Licensed Program.
3.THIS LICENSED PROGRAM IS PROVIDED BY THE LICENSOR “AS IS” AND ANY EXPRESSED OR IMPLIED WARRANTY AS TO THE LICENSED PROGRAM OR ANY DERIVED PROGRAM, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXTENDED, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; PROCUREMENT OF SUBSTITUTED GOODS OR SERVICE; DAMAGES ARISING FROM SYSTEM FAILURE; LOSS OR CORRUPTION OF EXISTING DATA OR PROGRAM; LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE INSTALLATION, USE, THE REPRODUCTION OR OTHER EXPLOITATION OF THE LICENSED PROGRAM OR ANY DERIVED PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
4.The Licensor is under no obligation to respond to any technical questions or inquiries, or provide any other user support in connection with the installation, use or the Reproduction and Other Exploitation of the Licensed Program or Derived Programs thereof.
Article 4 (Termination of Agreement)
1.The term of this Agreement shall begin from the time of receipt of the Licensed Program by the Recipient and shall continue as long as the Recipient retains any such Licensed Program in any way.
2.Notwithstanding the provision set forth in the preceding Paragraph, in the event of the breach of any of the provisions set forth in this Agreement by the Recipient, this Agreement shall automatically terminate without any notice. In the case of such termination, the Recipient may not use or conduct Reproduction and Other Exploitation of the Licensed Program or a Derived Program: provided that such termination shall not affect any rights of any other Recipient receiving the Licensed Program or the Derived Program from such Recipient who breached this Agreement.
Article 5 (Governing Law)
1.IPA may publish revised and/or new versions of this License. In such an event, the Recipient may select either this Agreement or any subsequent version of the Agreement in using, conducting the Reproduction and Other Exploitation of, or Redistributing the Licensed Program or a Derived Program. Other matters not specified above shall be subject to the Copyright Law of Japan and other related laws and regulations of Japan.
2.This Agreement shall be construed under the laws of Japan.
================================================
FILE: gemfiles/prawn-2.4.gemfile
================================================
source 'https://rubygems.org'
gem 'prawn', '~> 2.4.0'
gemspec path: '../'
================================================
FILE: gemfiles/prawn-2.5.gemfile
================================================
source 'https://rubygems.org'
gem 'prawn', '~> 2.5.0'
gemspec path: '../'
================================================
FILE: lib/thinreports/basic_report/core/errors.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Errors
class Basic < ::StandardError
end
class UnknownShapeStyleName < Basic
def initialize(style, availables)
super("The specified style name, '#{style}', cannot be used. " \
"The available styles are #{availables.map { |s| ":#{s}" }.join(', ')}.")
end
end
class UnknownShapeType < Basic
end
class UnknownFormatterType < Basic
end
class LayoutFileNotFound < Basic
end
class FontFileNotFound < Basic
end
class NoRegisteredLayoutFound < Basic
end
class UnknownItemId < Basic
def initialize(id, item_type = 'Basic')
super("The layout does not have a #{item_type} Item with id '#{id}'.")
end
end
class DisabledListSection < Basic
def initialize(section)
super("The #{section} section is disabled.")
end
end
class UnknownLayoutId < Basic
end
class UnsupportedColorName < Basic
end
class InvalidLayoutFormat < Basic
end
class IncompatibleLayoutFormat < Basic
def initialize(filename, fileversion, required_rules)
super("Generator #{Thinreports::VERSION} can not be built this file, " \
"'#{File.basename(filename)}'. " \
"This file is updated in the Editor of version '#{fileversion}', " \
"but Generator requires version #{required_rules}.")
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/format/base.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Format
# @abstract
class Base
class << self
def config_reader(*configs, &block)
each_configs(*configs) do |m, location|
define_read_method(m, location, &block)
end
end
def config_checker(check, *configs)
checker = ->(val) { val == check }
each_configs(*configs) do |m, location|
define_read_method(:"#{m}?", location, &checker)
end
end
def config_writer(*configs)
each_configs(*configs) do |m, location|
define_write_method(m, location)
end
end
def config_accessor(*configs, &block)
config_reader(*configs, &block)
config_writer(*configs)
end
private
def define_read_method(m, location = nil, &block)
define_method(m) do
read(*location, &block)
end
end
def define_write_method(m, location = nil)
define_method(:"#{m}=") do |value|
write(value, *location)
end
end
def each_configs(*configs, &block)
c = configs.first.is_a?(::Hash) ? configs.first : (configs || [])
c.each do |m, location|
block.call(m, location || [m.to_s])
end
end
end
def initialize(config, &block)
@config = config
block.call(self) if ::Kernel.block_given?
end
def attributes
@config
end
private
def find(*keys)
if keys.empty?
@config
else
keys.inject(@config) do |c, k|
c.is_a?(::Hash) ? c[k] : (break c)
end
end
end
def write(value, *keys)
key = keys.pop
owner = find(*keys)
owner[key] = value
end
def read(*keys, &block)
value = find(*keys)
::Kernel.block_given? ? block.call(value) : value
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/base/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Base
# @abstract
class Interface
include Utils
extend Forwardable
def self.internal_delegators(*args)
def_delegators :internal, *args
end
private_class_method :internal_delegators
attr_reader :internal
def initialize(parent, format, internal = nil)
@internal = internal || init_internal(parent, format)
end
def copy(parent)
self.class.new(parent, internal.format, internal.copy(parent))
end
private
# @param [Thinreports::BasicReport::Report::Page, Thinreports::BasicReport::Core::Shape::List::SectionInterface] parent
# @param [Thinreports::BasicReport::Core::Shape::Basic::Format] format
# @return [Thinreports::BasicReport::Core::Shape::Basic::Internal]
# @abstract
def init_internal(parent, format)
raise NotImplementedError
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/base/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Base
# @abstract
class Internal
include Utils
extend Forwardable
def self.format_delegators(*args)
def_delegators :format, *args
end
private_class_method :format_delegators
attr_reader :parent
attr_reader :format
attr_writer :style
attr_accessor :states
def initialize(parent, format)
@parent = parent
@format = format
@states = {}
@style = nil
@finalized_attributes = nil
end
def style
raise NotImplementedError
end
def copy(new_parent, &block)
new_internal = self.class.new(new_parent, format)
new_internal.style = style.copy
new_internal.states = deep_copy(states)
block.call(new_internal) if block_given?
new_internal
end
def type_of?
raise NotImplementedError
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/base.rb
================================================
# frozen_string_literal: true
require 'forwardable'
require_relative 'base/internal'
require_relative 'base/interface'
================================================
FILE: lib/thinreports/basic_report/core/shape/basic/block_format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
class BlockFormat < Basic::Format
config_reader :value
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/basic/block_interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
class BlockInterface < Basic::Interface
# @overload value(val)
# Set a val
# @param [Object] val
# @return [self]
# @overload value
# Return the value
# @return [Object]
def value(*args)
if args.empty?
internal.read_value
else
internal.write_value(args.first)
self
end
end
# @param [Object] val
def value=(val)
value(val)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/basic/block_internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
class BlockInternal < Basic::Internal
format_delegators :box
def style
@style ||= Style::Basic.new(format)
end
def read_value
states.key?(:value) ? states[:value] : format.value.dup
end
alias value read_value
def write_value(val)
states[:value] = val
end
def real_value
read_value
end
def type_of?(type_name)
type_name == :block
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/basic/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
class Format < Core::Format::Base
include Utils
config_reader :type, :id
config_reader :style
config_checker true, :display
config_reader follow_stretch: %w[follow-stretch]
def affect_bottom_margin?
attributes.fetch('affect-bottom-margin', true)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/basic/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
class Interface < Base::Interface
internal_delegators :type
# @return [String]
def id
internal.id.dup
end
# @param [Boolean] visibility
# @return [self]
def visible(visibility)
internal.style.visible = visibility
self
end
# @return [Boolean]
def visible?
internal.style.visible
end
# @overload style(style_name)
# @param [Symbol] style_name
# @return [Object]
# @overload style(style_name, value)
# @param [Symbol] style_name
# @param [String, Symbol, Number, Array] value
# @return [self]
# @overload style(style_name, value1, value2)
# @param [Symbol] style_name
# @param [String, Number] value1
# @param [String, Number] value2
# @return [self]
def style(*args)
case args.length
when 1
internal.style[args.first]
when 2
internal.style[args.first] = args.last
self
when 3
internal.style[args.shift] = args
self
else
raise ArgumentError, '#style requires 1 or 2, 3 arguments'
end
end
# @param [Hash] settings style_name: value
# @return [self]
def styles(settings)
settings.each { |args| style(*args) }
self
end
# @see #visible
# @return [self]
def hide
visible(false)
self
end
# @see #visible
# @return [self]
def show
visible(true)
self
end
private
# @see Thinreports::BasicReport::Core::Shape::Base::Interface#init_internal
def init_internal(parent, format)
Basic::Internal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/basic/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
class Internal < Base::Internal
# Delegate to Format's methods
format_delegators :id, :type
def style
@style ||= Style::Graphic.new(format)
end
def type_of?(type_name)
[:basic, type].include?(type_name)
end
def identifier
"#{id}#{style.identifier}"
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/basic.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Basic
TYPE_NAMES = %w[line rect ellipse image].freeze
end
end
end
end
end
require_relative 'basic/format'
require_relative 'basic/internal'
require_relative 'basic/interface'
require_relative 'basic/block_format'
require_relative 'basic/block_internal'
require_relative 'basic/block_interface'
================================================
FILE: lib/thinreports/basic_report/core/shape/image_block/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module ImageBlock
class Format < Basic::BlockFormat
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/image_block/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module ImageBlock
class Interface < Basic::BlockInterface
# @see #value
alias src value
# @see #value=
alias src= value=
private
# @see Thinreports::BasicReport::Core::Shape::Base::Interface#init_internal
def init_internal(parent, format)
ImageBlock::Internal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/image_block/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module ImageBlock
class Internal < Basic::BlockInternal
alias src read_value
def type_of?(type_name)
type_name == ImageBlock::TYPE_NAME || super
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/image_block.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module ImageBlock
TYPE_NAME = 'image-block'
end
end
end
end
end
require_relative 'image_block/format'
require_relative 'image_block/internal'
require_relative 'image_block/interface'
================================================
FILE: lib/thinreports/basic_report/core/shape/list/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class Format < Basic::Format
config_reader height: %w[content-height]
config_checker true, auto_page_break: %w[auto-page-break]
# @deprecated
config_reader :header,
:detail,
:footer
# @deprecated
config_reader page_footer: %w[page-footer]
config_checker true, has_header: %w[header enabled]
config_checker true, has_footer: %w[footer enabled]
config_checker true, has_page_footer: %w[page-footer enabled]
config_reader page_footer_height: %w[page-footer height]
config_reader footer_height: %w[footer height]
config_reader header_height: %w[header height]
config_reader detail_height: %w[detail height]
attr_reader :sections
def initialize(*)
super
initialize_sections
end
# @param [Symbol] section_name
# @return [Hash]
# @deprecated
def section(section_name)
__send__(section_name)
end
# @param [Symbol] section_name
# @return [Boolean]
def has_section?(section_name)
section_name == :detail ? true : __send__(:"has_#{section_name}?")
end
# @param [Symbol] section_name
# @return [Numeric]
def section_height(section_name)
has_section?(section_name) ? __send__(:"#{section_name}_height") : 0
end
# @param [:detai, :header, :page_footer, :footer] section_name
# @return [Numeric]
def section_base_position_top(section_name)
section = @sections[section_name]
return 0 unless has_section?(section_name)
top = section.relative_top
case section_name
when :page_footer
top - section_height(:detail)
when :footer
top - section_height(:detail) - section_height(:page_footer)
else
top
end
end
private
def initialize_sections
@sections = {
detail: List::SectionFormat.new(attributes['detail'])
}
@sections[:header] = section_format('header') if has_section?(:header)
@sections[:page_footer] = section_format('page-footer') if has_section?(:page_footer)
@sections[:footer] = section_format('footer') if has_section?(:footer)
end
def section_format(section_name)
List::SectionFormat.new(attributes[section_name])
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list/manager.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class Manager
include Utils
# @return [Thinreports::BasicReport::Core::Shape:::List::Page]
attr_reader :current_page
# @return [Thinreports::BasicReport::Core::Shape::List::PageState]
attr_reader :current_page_state
# @return [Integer]
attr_accessor :page_count
# @return [Proc]
attr_accessor :page_finalize_handler
# @return [Proc]
attr_accessor :page_footer_handler
# @return [Proc]
attr_accessor :footer_handler
# @param [Thinreports::BasicReport::Core::Shape::List::Page] page
def initialize(page)
switch_current!(page)
@finalized = false
@page_count = 0
@page_finalize_handler = nil
@page_footer_handler = nil
@footer_handler = nil
end
# @param [Thinreports::BasicReport::Core::Shape::List::Page] page
# @return [Thinreports::BasicReport::Core::Shape::List::Manager]
def switch_current!(page)
@current_page = page
@current_page_state = page.internal
self
end
# @yield [new_list]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::Page] new_list
def change_new_page(&block)
finalize_page
new_page = report.internal.copy_page
block.call(new_page.list(current_page.id)) if block_given?
end
# @param [Hash] values ({})
# @yield [header]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::SectionInterface] header
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
# @raise [Thinreports::BasicReport::Errors::DisabledListSection]
def build_header(values = {}, &block)
raise Thinreports::BasicReport::Errors::DisabledListSection, 'header' unless format.has_header?
current_page_state.header ||= init_section(:header)
build_section(header_section, values, &block)
end
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def header_section
current_page_state.header
end
# @param (see #build_section)
# @return [Boolean]
def add_detail(values = {}, &block)
return false if current_page_state.finalized?
successful = true
if overflow_with?(:detail)
if auto_page_break?
change_new_page do |new_list|
new_list.manager.insert_detail(values, &block)
end
else
finalize
successful = false
end
else
insert_detail(values, &block)
end
successful
end
# @param values (see Thinreports::BasicReport::Core::Shape::Manager::Target#values)
# @yield [section,]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::SectionInterface] section
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def insert_detail(values = {}, &block)
detail = build_section(init_section(:detail), values, &block)
insert_row(detail)
end
# @param [Thinreports::BasicReport::Core::Shape::List::SectionInterface] row
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def insert_row(row)
row.internal.move_top_to(current_page_state.height)
current_page_state.rows << row
current_page_state.height += row.height
row
end
# @param [Thinreports::BasicReport::Core::Shape::List::SectionInterface] section
# @param values (see Thinreports::BasicReport::Core::Shape::Manager::Target#values)
# @yield [section,]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::SectionInterface] section
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def build_section(section, values = {}, &block)
section.values(values)
call_block_in(section, &block)
end
# @param [Symbol] section_name
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def init_section(section_name)
List::SectionInterface.new(current_page,
format.sections[section_name],
section_name)
end
# @param [Symbol] section_name
# @return [Boolean]
def overflow_with?(section_name = :detail)
max_height = page_max_height
max_height += format.section_height(:page_footer) if section_name == :footer && format.has_page_footer?
height = format.section_height(section_name)
(current_page_state.height + height) > max_height
end
# @return [Numeric]
def page_max_height
@page_max_height ||= begin
h = format.height
h -= format.section_height(:page_footer)
h -= format.section_height(:footer) unless auto_page_break?
h
end
end
# @return [Boolean]
def auto_page_break?
format.auto_page_break?
end
# @param [Hash] options
# @option options [Boolean] :ignore_page_footer (false)
# When the switch of the page is generated by #finalize, it is used.
def finalize_page(options = {})
return if current_page_state.finalized?
build_header if format.has_header?
finalize_page_footer unless options[:ignore_page_footer]
current_page_state.finalized!
@page_finalize_handler.call if @page_finalize_handler
@page_count += 1
current_page_state.no = @page_count
end
def finalize_page_footer
return unless format.has_page_footer?
page_footer = init_section(:page_footer)
insert_row(page_footer)
@page_footer_handler.call(page_footer) if @page_footer_handler
end
def finalize
return if finalized?
finalize_page
if format.has_footer?
footer = init_section(:footer)
@footer_handler.call(footer) if @footer_handler
if auto_page_break? && overflow_with?(:footer)
change_new_page do |new_list|
new_list.manager.insert_row(footer)
new_list.manager.finalize_page(ignore_page_footer: true)
end
else
insert_row(footer)
end
end
@finalized = true
end
# @return [Boolean]
def finalized?
@finalized
end
# @return [Thinreports::BasicReport::Report::Base]
def report
current_page_state.parent.report
end
# @return [Thinreports::BasicReport::Layout::Base]
def layout
current_page_state.parent.layout
end
# @return [Thinreports::BasicReport::Core::Shape::List::Format]
def format
current_page_state.format
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list/page.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class Page < Basic::Interface
extend Forwardable
attr_reader :manager
# @param [Thinreports::BasicReport::Report::Page] parent
# @param [Thinreports::BasicReport::Core::Shape::Basic::Format] format
# @param [Thinreports::BasicReport::Core::Shape::List::PageState] internal (nil)
# @param [Thinreports::BasicReport::Core::Shape::List::Manager] manager (nil)
def initialize(parent, format, internal = nil, manager = nil)
super(parent, format, internal)
@manager =
if manager
manager.switch_current!(self)
else
List::Manager.new(self)
end
# Set a reference to List::PageState List::Manager
self.internal.manager = self.manager
end
# @see Thinreports::BasicReport::Core::Shape::List::Manager#build_header
def_delegator :manager, :build_header, :header
def on_page_finalize(&block)
manager.page_finalize_handler = block
end
# @yield [page_footer]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::SectionInterface] page_footer
def on_page_footer_insert(&block)
manager.page_footer_handler = block
end
# @yield [footer]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::SectionInterface] footer
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def on_footer_insert(&block)
manager.footer_handler = block
end
# @param [Hash] values ({})
# @yield [row,]
# @yieldparam [Thinreports::BasicReport::Core::Shape::List::SectionInterface] row
# @return [Boolean]
def add_row(values = {}, &block)
manager.add_detail(values, &block)
end
# If enabled, the auto-page-break of the list will force a page break
# at the time this method is called. Otherwise, this list will be finalized.
def page_break
if manager.auto_page_break?
manager.change_new_page
else
manager.finalize_page
end
end
alias finalize page_break
# @return [Boolean] Returns true if list has overflowed
# when `list#add_row` is called at the next time.
def overflow?
manager.overflow_with?(:detail)
end
# @param [Thinreports::BasicReport::Report::Page] new_parent
# @return [Thinreports::BasicReport::Core::Shape::List::Page]
def copy(new_parent)
if manager.auto_page_break?
new_list = self.class.new(new_parent, internal.format,
nil, manager)
else
manager.finalize
new_list = self.class.new(new_parent, internal.format,
internal.copy(new_parent), manager)
internal.rows.each do |row|
new_list.internal.rows << row.copy(new_list)
end
new_list.internal.finalized!
end
new_list.internal.header = internal.header.copy(new_list) if internal.format.has_header?
new_list
end
private
# @see Thinreports::BasicReport::Core::Shape::Base::Interface#init_internal
def init_internal(parent, format)
List::PageState.new(parent, format)
end
end
# Alias to List::Page.
# @see Thinreports::BasicReport::Core::Shape::List::Page
List::Interface = List::Page
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list/page_state.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class PageState < Basic::Internal
attr_reader :rows
attr_accessor :height
attr_accessor :header
attr_accessor :no
attr_accessor :manager
def initialize(*args)
super(*args)
@rows = []
@height = 0
@finalized = false
@header = nil
end
def style
@style ||= Style::Basic.new(format)
end
def finalized?
@finalized
end
def finalized!
@finalized = true
end
def type_of?(type_name)
type_name == List::TYPE_NAME
end
end
# Alias to List::PageState.
# @see Thinreports::BasicReport::Core::Shape::List::PageState
List::Internal = List::PageState
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list/section_format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class SectionFormat < Shape::Manager::Format
config_reader :height
config_reader relative_left: %w[translate x],
relative_top: %w[translate y]
config_reader :style
# For compatible 0.8.x format API
config_checker true, display: %w[enabled]
def initialize(*)
super
initialize_items(attributes['items'])
end
private
def initialize_items(item_schemas)
item_schemas.each do |item_schema|
id, type = item_schema.values_at 'id', 'type'
next if id.empty?
shapes[id.to_sym] = Core::Shape::Format(type).new(item_schema)
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list/section_interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class SectionInterface < Base::Interface
include Core::Shape::Manager::Target
undef_method :list
internal_delegators :height
# @param [Thinreports::BasicReport::Core::Shape::List::Page] parent
# @param [Thinreports::BasicReport::Core::Shape::List::SectionFormat] format
# @param [Symbol] section_name
def initialize(parent, format, section_name)
super(parent, format)
internal.section_name = section_name
initialize_manager(format) do |f|
Core::Shape::Interface(self, f)
end
end
# @param [Thinreports::BasicReport::Core::Shape::List::Page] parent
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInterface]
def copy(parent)
new_sec = super
new_sec.internal.section_name = internal.section_name
manager.shapes.each do |id, shape|
new_sec.manager.shapes[id] = shape.copy(new_sec)
end
new_sec
end
private
# @param parent (see #initialize)
# @param format (see #initialize)
# @return [Thinreports::BasicReport::Core::Shape::List::SectionInternal]
def init_internal(parent, format)
List::SectionInternal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list/section_internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
class SectionInternal < Base::Internal
format_delegators :height,
:relative_left
# @return [Symbol]
attr_accessor :section_name
def style
@style ||= Style::Base.new(format)
end
# @param [Numeric] ry
def move_top_to(ry)
states[:relative_top] = ry
end
# @return [Float]
def relative_top
states[:relative_top] || 0
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/list.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module List
TYPE_NAME = 'list'
end
end
end
end
end
require_relative 'list/format'
require_relative 'list/manager'
require_relative 'list/page'
require_relative 'list/page_state'
require_relative 'list/section_format'
require_relative 'list/section_interface'
require_relative 'list/section_internal'
================================================
FILE: lib/thinreports/basic_report/core/shape/manager/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Manager
class Format < Core::Format::Base
# @return [Symbol, Integer]
attr_reader :identifier
def initialize(config, id = nil, &block)
super(config, &block)
@identifier = id || object_id
end
def find_shape(id)
shapes[id]
end
def has_shape?(id)
shapes.key?(id)
end
def shapes
@shapes ||= {}
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/manager/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Manager
class Internal
include Utils
attr_reader :format
attr_reader :shapes
attr_reader :lists
# @param [Thinreports::BasicReport::Core::Manager::Format] format
# @param [Proc] init_item_handler
def initialize(format, init_item_handler)
@format = format
@shapes = {}
@lists = {}
@init_item_handler = init_item_handler
end
# @param [String, Symbol] id
# @return [Thinreports::BasicReport::Core::Shape::Basic::Format]
def find_format(id)
format.find_shape(id.to_sym)
end
# @param [String, Symbol] id
# @param limit (see #valid_type?)
def find_item(id, limit = {})
id = id.to_sym
if shapes.key?(id)
shape = shapes[id]
valid_type?(shape.type, limit) ? shape : nil
elsif find_format(id)
shape_format = find_format(id)
return nil unless valid_type?(shape_format.type, limit)
shape = init_item(shape_format)
shapes[id] = shape
shape
end
end
# @param [String, Symbol] id
# @return [Thinreports::BasicReport::Core::Shape::Base::Interface, nil]
def final_shape(id)
shape = shapes[id]
# When shape was found in registry.
if shape
return nil unless shape.visible?
# In the case of TextBlock or ImageBlock.
if shape.internal.type_of?(:block)
blank_value?(shape.internal.real_value) ? nil : shape
else
shape
end
# When shape was not found in registry.
elsif format.has_shape?(id)
shape_format = find_format(id)
return nil unless shape_format.display?
case shape_format.type
# In the case of TextBlock.
when TextBlock::TYPE_NAME
return nil if !shape_format.has_reference? && blank_value?(shape_format.value)
init_item(shape_format)
# In the case of ImageBlock, Return the nil constantly.
when ImageBlock::TYPE_NAME
nil
else
init_item(shape_format)
end
end
end
# @param [Thinreports::BasicReport::Core::Shape::Basic::Format] format
def init_item(format)
@init_item_handler.call(format)
end
# @param [String] type
# @param [Hash] limit
# @option limit [String] :only
# @option limit [String] :except
# @return [Booldan]
def valid_type?(type, limit = {})
return true if limit.empty?
if limit[:only]
type == limit[:only]
elsif limit[:except]
type != limit[:except]
else
raise ArgumentError
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/manager/target.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Manager
module Target
include Utils
attr_reader :manager
# @example
# item(:title).value('Title').style(:fill, 'red')
#
# item(:title) do
# value('Title')
# style(:fill, 'red')
# end
#
# item(:title) do |t|
# t.value('Title')
# t.style(:fill, 'red')
# end
# item(:list) # => Error: UnknownItemId
# item(:unknown_id) # => Error: UnknownItemId
# @param [String, Symbol] id
# @yield [item,]
# @yieldparam [Thinreports::BasicReport::Core::Shape::Base::Interface] item
# @raise [Thinreports::BasicReport::Errors::UnknownItemId]
# @return [Thinreports::BasicReport::Core::Shape::Base::Interface]
def item(id, &block)
shape = find_item(id, except: Core::Shape::List::TYPE_NAME)
raise Thinreports::BasicReport::Errors::UnknownItemId, id unless shape
call_block_in(shape, &block)
end
# @example
# page[:text_block].style(:bold, true)
# page[:rect].style(:border_color, 'red')
#
# page[:list] # => Error: UnknownItemId
# page[:unknown_id] # => Error: UnknownItemId
# @param [String, Symbol] id
# @return [Thinreports::BasicReport::Core::Shape::Base::Interface]
def [](id)
item(id)
end
# @example
# page[:text_block] = 'Title'
# page[:image_block] = '/path/to/image.png'
# page[:list] = 'value' # => Error: UnknownItemId
# page[:ellipse] = 'value' # => Error: NoMethodError #value
# page[:unknown_id] = 'value' # => Error: UnknownItemId
# @param [String, Symbol] id
# @param [Object] value
def []=(id, value)
item(id).value = value
end
# @example
# page.values text_block: 'value',
# image_block: '/path/to/image.png'
# @param [Hash] item_values
def values(item_values)
item_values.each { |id, val| item(id).value(val) }
end
# @param [Symbol, String] id
# @return [Boolean]
def item_exists?(id)
!manager.find_format(id).nil?
end
alias exists? item_exists?
# @example
# report.list.add_row do |row|
# row.item(:price).value(1000)
# end
#
# report.list(:list_id) # => List
# report.list(:text_block_id) # => raises UnknownItemId
# @see #item
def list(id = nil, &block)
shape = find_item(id ||= :default, only: Core::Shape::List::TYPE_NAME)
raise Thinreports::BasicReport::Errors::UnknownItemId.new(id, 'List') unless shape
manager.lists[id.to_sym] ||= shape
call_block_in(shape, &block)
end
private
# @param format (see Thinreports::BasicReport::Core::Shape::Manager::Internal#initialize)
# @yield [format] Handler for initialize item.
# @yieldparam [Thinreports::BasicReport::Core::Shape::Basic::Format] format
def initialize_manager(format, &block)
@manager = Manager::Internal.new(format, block)
end
# @see Thinreports::BasicReport::Core::Shape::Manager::Internal#find_item
def find_item(id, limit = {})
manager.find_item(id, limit)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/manager.rb
================================================
# frozen_string_literal: true
require_relative 'manager/format'
require_relative 'manager/target'
require_relative 'manager/internal'
================================================
FILE: lib/thinreports/basic_report/core/shape/page_number/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module PageNumber
class Format < Basic::Format
config_reader :target
config_reader default_format: %w[format]
# For saving compatible 0.8.x format API
config_reader overflow: %w[style overflow]
def id
@id ||= blank_value?(read('id')) ? self.class.next_default_id : read('id')
end
def for_report?
blank_value?(target)
end
def self.next_default_id
@id_counter ||= 0
"__pageno#{@id_counter += 1}"
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/page_number/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module PageNumber
class Interface < Basic::Interface
internal_delegators :reset_format
def format(*args)
if args.empty?
internal.read_format
else
internal.write_format(args.first)
self
end
end
private
# @see Thinreports::BasicReport::Core::Shape::Base::Interface#init_internal
def init_internal(parent, format)
PageNumber::Internal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/page_number/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module PageNumber
class Internal < Basic::Internal
format_delegators :box, :for_report?
def read_format
states.key?(:format) ? states[:format] : format.default_format.dup
end
def reset_format
states.delete(:format)
end
def write_format(format)
states[:format] = format.to_s
end
def build_format(page_no, page_count)
return '' if blank_value?(read_format)
if start_page_number > 1
page_no += start_page_number - 1
page_count += start_page_number - 1
end
read_format.dup.tap do |f|
f.gsub! '{page}', page_no.to_s
f.gsub! '{total}', page_count.to_s
end
end
def style
@style ||= PageNumber::Style.new(format)
end
def type_of?(type_name)
type_name == PageNumber::TYPE_NAME
end
def start_page_number
for_report? ? parent.report.start_page_number : 1
end
end
class Style < Style::Text
accessible_styles.delete :valign
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/page_number.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module PageNumber
TYPE_NAME = 'page-number'
end
end
end
end
end
require_relative 'page_number/format'
require_relative 'page_number/internal'
require_relative 'page_number/interface'
================================================
FILE: lib/thinreports/basic_report/core/shape/stack_view/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module StackView
class Format < Basic::Format
attr_reader :rows
def initialize(*)
super
initialize_rows
end
private
def initialize_rows
@rows = []
attributes['rows'].each do |row|
@rows << StackView::RowFormat.new(row)
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/stack_view/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module StackView
class Interface < Basic::Interface
private
def init_internal(parent, format)
StackView::Internal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/stack_view/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module StackView
class Internal < Basic::Internal
def initialize(parent, format)
super
@rows = []
end
attr_accessor :rows
def type_of?(type_name)
type_name == StackView::TYPE_NAME
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/stack_view/row_format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module StackView
class RowFormat < Core::Format::Base
config_reader :id
config_reader :height
config_checker true, :display
config_checker true, auto_stretch: 'auto-stretch'
attr_reader :items
def initialize(*)
super
@items = []
@item_with_ids = {}
initialize_items(attributes['items'])
end
def find_item(id)
@item_with_ids[id.to_sym]
end
private
def initialize_items(item_schemas)
item_schemas.each do |item_schema|
item = Core::Shape::Format(item_schema['type']).new(item_schema)
@items << item
@item_with_ids[item.id.to_sym] = item unless item.id.empty?
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/stack_view.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module StackView
TYPE_NAME = 'stack-view'.freeze
end
end
end
end
end
require_relative 'stack_view/format'
require_relative 'stack_view/interface'
require_relative 'stack_view/internal'
require_relative 'stack_view/row_format'
================================================
FILE: lib/thinreports/basic_report/core/shape/style/base.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Style
class Base
include Utils
class << self
# @param [Symbol] style_method
# @param [String] style
# @return [void]
def style_accessor(style_method, style)
style_reader(style_method, style)
style_writer(style_method, style)
end
# @see .style_accessor
def style_reader(style_method, style)
define_method(style_method) do
read_internal_style(style)
end
end
# @see .style_accessor
def style_writer(style_method, style)
define_method(:"#{style_method}=") do |value|
write_internal_style(style, value)
end
end
# @param [Array<Symbol>] style_methods
def style_accessible(*style_methods)
accessible_styles.concat(style_methods)
end
# @return [Array<Symbol>]
def accessible_styles
@accessible_styles ||= []
end
def inherited(s)
s.accessible_styles.concat(accessible_styles.dup)
end
end
# @return [Hash]
attr_accessor :styles
# @see .accessible_styles
attr_reader :accessible_styles
# @param [Thinreports::BasicReport::Core::Format::Base] format
# @param [Hash] default_styles ({})
def initialize(format, default_styles = {})
@format = format
@styles = default_styles
@base_styles = format.style || {}
@accessible_styles = self.class.accessible_styles.dup
end
# @param [Symbol] style_method
# @return [Object]
def [](style_method)
verify_style_method(style_method)
send(style_method.to_sym)
end
# @param [Symbol] style_method
# @param [String, Number, Array<String, Number>] value
def []=(style_method, value)
verify_style_method(style_method)
send(:"#{style_method}=", value)
end
# @return [String]
def identifier
create_identifier(@styles)
end
# @return [self]
def copy
self.class.new(@format, @styles.empty? ? {} : deep_copy(@styles))
end
# @param [String, Symbol] style
# @return [Object]
def read_internal_style(style)
style = style.to_s
@styles.key?(style) ? @styles[style] : @base_styles[style]
end
# @param [String, Symbol] style
# @param [Object] value
def write_internal_style(style, value)
@styles[style.to_s] = value
end
# @param [Symbol] style_method
# @return [Boolean]
def has_style?(style_method)
accessible_styles.include?(style_method)
end
# @return [Hash]
def finalized_styles
@finalized_styles ||=
if @styles.empty?
@base_styles.dup
else
@base_styles.merge(@styles)
end
end
private
# @param [Hash] s
# @return [String]
def create_identifier(s)
s.empty? ? '' : s.hash.to_s
end
# @param [Symbol] style_method
# @raise Thinreports::BasicReport::Errors::UnknownShapeStyleName
def verify_style_method(style_method)
return if has_style?(style_method)
raise Thinreports::BasicReport::Errors::UnknownShapeStyleName.new(
style_method,
accessible_styles
)
end
# @param [Object] value
# @param [Array<Object>] allows
# @param [String] msg (nil)
# @raise ArgumentError
def verify_style_value(value, allows, msg = nil)
raise ArgumentError, msg unless allows.include?(value)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/style/basic.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Style
class Basic < Style::Base
style_accessible :visible, :offset_x, :offset_y
attr_accessor :visible
style_accessor :offset_x, 'offset-x'
style_accessor :offset_y, 'offset-y'
def initialize(*args)
super
@visible = @format.display?
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/style/graphic.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Style
class Graphic < Style::Basic
style_accessible :border_color, :border_width, :fill_color, :border
# @method border_color
# @return [String]
# @method border_color=(color)
# @param [String] color
style_accessor :border_color, 'border-color'
# @method border_width
# @return [Number]
style_accessor :border_width, 'border-width'
# @method fill_color
# @return [String]
# @method fill_color=(color)
# @param [String] color
style_accessor :fill_color, 'fill-color'
# @return [Array<String, Number>]
def border
[border_width, border_color]
end
# @param [Array<String, Number>] width_and_color
def border=(width_and_color)
w, c = width_and_color
self.border_width = w
self.border_color = c
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/style/text.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Style
class Text < Style::Basic
style_accessible :bold, :italic, :underline, :linethrough,
:align, :valign, :color, :font_size
# @method color
# @return [String]
# @method color=(v)
# @param [String] v
style_accessor :color, 'color'
# @method font_size
# @return [Numeric, String]
# @method font_size=(v)
# @param [Numeric, String] v
style_accessor :font_size, 'font-size'
def initialize(*)
super
initialize_font_style
end
# @return [Boolean]
def bold
read_internal_style('font-style').include?('bold')
end
# @param [Boolean] enable
def bold=(enable)
write_font_style('bold', enable)
end
# @return [Boolean]
def italic
read_internal_style('font-style').include?('italic')
end
# @param [Boolean] enable
def italic=(enable)
write_font_style('italic', enable)
end
# @return [Boolean]
def underline
read_internal_style('font-style').include?('underline')
end
# @param [Boolean] enable
def underline=(enable)
write_font_style('underline', enable)
end
# @return [Boolean]
def linethrough
read_internal_style('font-style').include?('linethrough')
end
# @param [Boolean] enable
def linethrough=(enable)
write_font_style('linethrough', enable)
end
# @return [:left, :center, :right]
def align
read_internal_style('text-align').to_sym
end
# @param [:left, :center, :right] align_name
def align=(align_name)
verify_style_value(align_name, %i[left center right],
'Only :left or :center, :right can be specified as align.')
write_internal_style('text-align', align_name.to_s)
end
# @return [:top, :middle, :bottom]
def valign
vertical_align = read_internal_style('vertical-align')
blank_value?(vertical_align) ? :top : vertical_align.to_sym
end
# @param [:top, :center, :middle, :bottom] valign_name
def valign=(valign_name)
if valign_name == :center
warn '[DEPRECATION] :center value for valign style is deprecated' \
' and will be removed in thinreports-generator 1.0.' \
' Please use :middle instead of :center.'
valign_name = :middle
end
verify_style_value(
valign_name,
%i[top middle bottom],
'Only :top or :middle (:center), :bottom can be specified as valign.'
)
write_internal_style('vertical-align', valign_name.to_s)
end
private
def initialize_font_style
styles['font-style'] ||= (@base_styles['font-style'] || []).dup
end
def write_font_style(style_name, enable)
if enable
styles['font-style'].push(style_name).uniq!
else
styles['font-style'].delete(style_name)
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/style.rb
================================================
# frozen_string_literal: true
require_relative 'style/base'
require_relative 'style/basic'
require_relative 'style/graphic'
require_relative 'style/text'
================================================
FILE: lib/thinreports/basic_report/core/shape/text/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Text
class Format < Basic::Format
config_reader :texts
config_reader valign: %w[style vertical-align]
config_reader line_height: %w[style line-height]
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Text
class Interface < Basic::Interface
private
# @see Thinreports::BasicReport::Core::Shape::Base::Interface#init_internal
def init_internal(parent, format)
Text::Internal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Text
class Internal < Basic::Internal
# Delegate to Format's methods
format_delegators :texts, :box
def style
@style ||= Style::Text.new(format)
end
def type_of?(type_name)
type_name == Text::TYPE_NAME
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module Text
TYPE_NAME = 'text'
end
end
end
end
end
require_relative 'text/format'
require_relative 'text/internal'
require_relative 'text/interface'
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/format.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
class Format < Basic::BlockFormat
# For saving compatible 0.8.x format API
config_reader ref_id: %w[reference-id]
config_reader valign: %w[style vertical-align]
config_reader overflow: %w[style overflow]
config_reader line_height: %w[style line-height]
config_reader format_base: %w[format base],
format_type: %w[format type],
format_datetime_format: %w[format datetime format],
format_number_delimiter: %w[format number delimiter],
format_number_precision: %w[format number precision],
format_padding_char: %w[format padding char],
format_padding_dir: %w[format padding direction]
config_checker true, multiple: %w[multiple-line]
config_checker 'R', format_padding_rdir: %w[format padding direction]
config_reader format_padding_length: %w[format padding length] do |len|
blank_value?(len) ? 0 : len.to_i
end
config_reader has_format?: %w[format type] do |type|
%w[datetime number padding].include?(type)
end
# For saving compatible 0.8.x format API
def has_reference?
!blank_value?(ref_id)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/basic.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
module Formatter
class Basic
include Utils
attr_reader :format
def initialize(format)
@format = format
end
def apply(value)
value = apply_format_to(value) if applicable?(value)
return value if blank_value?(format.format_base)
format.format_base.gsub(/\{value\}/, value.to_s)
end
private
def apply_format_to(value)
value
end
def applicable?(_value)
true
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/datetime.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
module Formatter
class Datetime < Formatter::Basic
private
def apply_format_to(value)
value.strftime(format.format_datetime_format)
end
def applicable?(value)
!blank_value?(format.format_datetime_format) && value.respond_to?(:strftime)
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/number.rb
================================================
# frozen_string_literal: true
require 'bigdecimal'
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
module Formatter
class Number < Formatter::Basic
private
def apply_format_to(value)
precision = format.format_number_precision
delimiter = format.format_number_delimiter
if_applicable value do |val|
val = number_with_precision(val, precision) unless blank_value?(precision)
val = number_with_delimiter(val, delimiter) unless blank_value?(delimiter)
val
end
end
def if_applicable(value, &block)
normalized_value = normalize(value)
normalized_value.nil? ? value : block.call(normalized_value)
end
def normalize(value)
if value.is_a?(String)
convert_to_integer(value) || convert_to_float(value)
else
value
end
end
def number_with_delimiter(value, delimiter = ',')
value_int, value_float = value.to_s.split('.')
[
value_int.gsub(/(\d)(?=(\d{3})+(?!\d))/) { "#{$1}#{delimiter}" },
value_float
].compact.join('.')
end
def number_with_precision(value, precision = 3)
value = BigDecimal(value.to_s).round(precision)
sprintf("%.#{precision}f", value)
end
def convert_to_integer(value)
Integer(value)
rescue ArgumentError
nil
end
def convert_to_float(value)
Float(value)
rescue ArgumentError
nil
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
module Formatter
class Padding < Formatter::Basic
private
def apply_format_to(value)
value.to_s.send(format.format_padding_rdir? ? :ljust : :rjust,
format.format_padding_length,
format.format_padding_char)
end
def applicable?(_value)
!blank_value?(format.format_padding_char) && format.format_padding_length > 0
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
module Formatter
include Utils
# @param [Thinreports::BasicReport::Core::Shape::TextBlock::Format] format
# @return [Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::Base]
def self.setup(format)
klass =
if blank_value?(format.format_type)
Basic
else
case format.format_type
when 'number' then Number
when 'datetime' then Datetime
when 'padding' then Padding
else
raise Thinreports::BasicReport::Errors::UnknownFormatterType
end
end
klass.new(format)
end
end
end
end
end
end
end
require_relative 'formatter/basic'
require_relative 'formatter/datetime'
require_relative 'formatter/padding'
require_relative 'formatter/number'
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/interface.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
class Interface < Basic::BlockInterface
internal_delegators :format_enabled?
# @param [Boolean] enabled
# @return [self]
def format_enabled(enabled)
internal.format_enabled(enabled)
self
end
# @param [Object] val
# @param [Hash<Symbol, Object>] style_settings
# @return [self]
def set(val, style_settings = {})
value(val)
styles(style_settings) #=> self
end
private
# @see Thinreports::BasicReport::Core::Shape::Base::Interface#init_internal
def init_internal(parent, format)
TextBlock::Internal.new(parent, format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block/internal.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
class Internal < Basic::BlockInternal
format_delegators :multiple?
attr_reader :style
def initialize(*args)
super(*args)
@reference = nil
@formatter = nil
@style = Style::Text.new(format)
@style.accessible_styles.delete(:valign) unless multiple?
end
def read_value
if format.has_reference?
@reference ||= parent.item(format.ref_id)
@reference.value
else
super
end
end
def write_value(val)
if format.has_reference?
warn 'The set value was not saved, ' \
"Because '#{format.id}' has reference to '#{format.ref_id}'."
else
super
end
end
def real_value
if format_enabled?
formatter.apply(read_value)
else
super
end
end
def format_enabled(enabled)
states[:format_enabled] = enabled
end
def format_enabled?
if states.key?(:format_enabled)
states[:format_enabled]
else
!blank_value?(format.format_base) || format.has_format?
end
end
def type_of?(type_name)
type_name == TextBlock::TYPE_NAME || super
end
private
def formatter
@formatter ||= TextBlock::Formatter.setup(format)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/core/shape/text_block.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
module TextBlock
TYPE_NAME = 'text-block'
end
end
end
end
end
require_relative 'text_block/format'
require_relative 'text_block/internal'
require_relative 'text_block/interface'
require_relative 'text_block/formatter'
================================================
FILE: lib/thinreports/basic_report/core/shape.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Core
module Shape
def Interface(parent, format)
find_by_type(format.type)::Interface.new(parent, format)
end
def Format(type)
find_by_type(type)::Format
end
module_function :Interface, :Format
def self.find_by_type(type)
case type
when TextBlock::TYPE_NAME then TextBlock
when ImageBlock::TYPE_NAME then ImageBlock
when List::TYPE_NAME then List
when StackView::TYPE_NAME then StackView
when Text::TYPE_NAME then Text
when PageNumber::TYPE_NAME then PageNumber
when *Basic::TYPE_NAMES then Basic
else
raise Thinreports::BasicReport::Errors::UnknownShapeType
end
end
end
end
end
end
require_relative 'shape/style'
require_relative 'shape/manager'
require_relative 'shape/base'
require_relative 'shape/basic'
require_relative 'shape/text'
require_relative 'shape/text_block'
require_relative 'shape/image_block'
require_relative 'shape/list'
require_relative 'shape/stack_view'
require_relative 'shape/page_number'
================================================
FILE: lib/thinreports/basic_report/core/utils.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Utils
def self.included(klass)
klass.extend self
end
def deep_copy(src)
case src
when Hash
src.each_with_object({}) do |(k, v), h|
h[k] = v.dup rescue v
end
when Array
src.map do |a|
a.dup rescue a
end
else
raise ArgumentError
end
end
def blank_value?(value)
case value
when String then value.empty?
when NilClass then true
else false
end
end
def call_block_in(scope, &block)
return scope unless block_given?
if block.arity == 1
block.call(scope)
else
scope.instance_eval(&block)
end
scope
end
end
extend Utils
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/draw_shape.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module DrawShape
# @param [Thinreports::BasicReport::Core::Shape::TextBlock::Internal] shape
# @param [Numeric] height (nil) It will be used as rendering height if present.
# Otherwise, the rendering height is the height of schema.
# @param [:truncate, :shrink_to_fit, :expand] overflow (nil) It will be set the overflow attribute if present.
def draw_shape_tblock(shape, height: nil, overflow: nil, &block)
x, y, w = shape.format.attributes.values_at('x', 'y', 'width')
h = height || shape.format.attributes['height']
content = shape.real_value.to_s
return if content.empty?
attrs = build_text_attributes(shape.style.finalized_styles)
attrs[:overflow] = overflow if overflow
unless shape.multiple?
content = content.tr("\n", ' ')
attrs[:single] = true
end
text_box(content, x, y, w, h, attrs, &block)
end
def draw_shape_pageno(shape, page_no, page_count)
x, y, w, h = shape.format.attributes.values_at('x', 'y', 'width', 'height')
attrs = build_text_attributes(shape.style.finalized_styles)
text_box(shape.build_format(page_no, page_count), x, y, w, h, attrs)
end
# @param [Thinreports::BasicReport::Core::Shape::Basic::Internal] shape
def draw_shape_image(shape)
x, y, w, h = shape.format.attributes.values_at('x', 'y', 'width', 'height')
image_data = shape.format.attributes['data']
base64image(image_data['base64'], x, y, w, h)
end
# @param [Thinreports::BasicReport::Core::Shape::ImageBlock::Internal] shape
def draw_shape_iblock(shape)
return if blank_value?(shape.src)
x, y, w, h = shape.format.attributes.values_at('x', 'y', 'width', 'height')
style = shape.style.finalized_styles
image_box(
shape.src, x, y, w, h,
position_x: image_position_x(style['position-x']),
position_y: image_position_y(style['position-y']),
offset_x: style['offset-x'],
offset_y: style['offset-y']
)
end
def shape_iblock_dimenions(shape)
return nil if blank_value?(shape.src)
x, y, w, h = shape.format.attributes.values_at('x', 'y', 'width', 'height')
style = shape.style.finalized_styles
image_dimensions(
shape.src, x, y, w, h,
position_x: image_position_x(style['position-x']),
position_y: image_position_y(style['position-y'])
)
end
# @param [Thinreports::BasicReport::Core::Shape::Text::Internal] shape
def draw_shape_text(shape, dheight = 0)
x, y, w, h = shape.format.attributes.values_at('x', 'y', 'width', 'height')
text(
shape.texts.join("\n"), x, y, w, h + dheight,
build_text_attributes(shape.style.finalized_styles)
)
end
# @param [Thinreports::BasicReport::Core::Shape::Basic::Internal] shape
def draw_shape_ellipse(shape)
cx, cy, rx, ry = shape.format.attributes.values_at('cx', 'cy', 'rx', 'ry')
ellipse(cx, cy, rx, ry, build_graphic_attributes(shape.style.finalized_styles))
end
# @param [Thinreports::BasicReport::Core::Shape::Basic::Internal] shape
def draw_shape_line(shape, dy1 = 0, dy2 = 0)
x1, y1, x2, y2 = shape.format.attributes.values_at('x1', 'y1', 'x2', 'y2')
line(x1, y1 + dy1, x2, y2 + dy2, build_graphic_attributes(shape.style.finalized_styles))
end
# @param [Thinreports::BasicReport::Core::Shape::Basic::Internal] shape
def draw_shape_rect(shape, dheight = 0)
x, y, w, h = shape.format.attributes.values_at('x', 'y', 'width', 'height')
rect_attributes = build_graphic_attributes(shape.style.finalized_styles) do |attrs|
attrs[:radius] = shape.format.attributes['border-radius']
end
rect(x, y, w, h + dheight, rect_attributes)
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module DrawTemplateItems
# @param [Array<Hash>] items
def draw_template_items(items)
items.each do |item_attributes|
next unless drawable?(item_attributes)
case item_attributes['type']
when 'text' then draw_text(item_attributes)
when 'image' then draw_image(item_attributes)
when 'rect' then draw_rect(item_attributes)
when 'ellipse' then draw_ellipse(item_attributes)
when 'line' then draw_line(item_attributes)
end
end
end
private
# @param [Hash] item_attributes
def draw_rect(item_attributes)
x, y, w, h = item_attributes.values_at('x', 'y', 'width', 'height')
graphic_attributes = build_graphic_attributes(item_attributes['style']) do |attrs|
attrs[:radius] = item_attributes['border-radius']
end
rect(x, y, w, h, graphic_attributes)
end
# @see #draw_rect
def draw_ellipse(item_attributes)
x, y, rx, ry = item_attributes.values_at('cx', 'cy', 'rx', 'ry')
ellipse(x, y, rx, ry, build_graphic_attributes(item_attributes['style']))
end
# @see #draw_rect
def draw_line(item_attributes)
x1, y1, x2, y2 = item_attributes.values_at('x1', 'y1', 'x2', 'y2')
line(x1, y1, x2, y2, build_graphic_attributes(item_attributes['style']))
end
# @see #draw_rect
def draw_text(item_attributes)
x, y, w, h = item_attributes.values_at('x', 'y', 'width', 'height')
text(
item_attributes['texts'].join("\n"), x, y, w, h,
build_text_attributes(item_attributes['style'])
)
end
# @see #draw_rect
def draw_image(item_attributes)
x, y, w, h = item_attributes.values_at('x', 'y', 'width', 'height')
image_data = item_attributes['data']
base64image(image_data['base64'], x, y, w, h)
end
def drawable?(item_attributes)
item_attributes['id'].empty? && item_attributes['display']
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/font.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Font
FONT_STORE = Thinreports.root.join('fonts')
BUILTIN_FONTS = {
'IPAMincho' => FONT_STORE.join('ipam.ttf').to_s,
'IPAPMincho' => FONT_STORE.join('ipamp.ttf').to_s,
'IPAGothic' => FONT_STORE.join('ipag.ttf').to_s,
'IPAPGothic' => FONT_STORE.join('ipagp.ttf').to_s
}.freeze
DEFAULT_FALLBACK_FONTS = %w[IPAMincho].freeze
PRAWN_BUINTIN_FONT_ALIASES = {
'Courier New' => 'Courier',
'Times New Roman' => 'Times-Roman'
}.freeze
def setup_fonts
# Install built-in fonts.
BUILTIN_FONTS.each do |font_name, font_path|
install_font(font_name, font_path)
end
# Create aliases from the font list provided by Prawn.
PRAWN_BUINTIN_FONT_ALIASES.each do |alias_name, name|
pdf.font_families[alias_name] = pdf.font_families[name]
end
# Setup custom fallback fonts
fallback_fonts = Thinreports.config.fallback_fonts.uniq
fallback_fonts.map!.with_index do |font, i|
if pdf.font_families.key?(font)
font
else
install_font "Custom-fallback-font#{i}", font
end
end
# Set fallback fonts
pdf.fallback_fonts(fallback_fonts + DEFAULT_FALLBACK_FONTS)
end
# @param [String] name
# @param [String] file
# @return [String] installed font name
def install_font(name, file)
raise Errors::FontFileNotFound unless File.exist?(file)
pdf.font_families[name] = {
normal: file,
bold: file,
italic: file,
bold_italic: file
}
name
end
# @return [String]
def default_family
'Helvetica'
end
# @param [String] family
# @return [String]
def default_family_if_missing(family)
pdf.font_families.key?(family) ? family : default_family
end
# @param [String] font_name
# @param [:bold, :italic] font_style
# @return [Boolean]
def font_has_style?(font_name, font_style)
font = pdf.font_families[font_name]
return false unless font
return false unless font.key?(font_style)
font[font_style] != font[:normal]
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/attributes.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Graphics
# @param [Hash] style
# @yield [attrs]
# @yieldparam [Hash] attrs
# @return [Hash]
def build_graphic_attributes(style, &block)
graphic_attributes = {
stroke: style['border-color'],
stroke_width: style['border-width'],
stroke_type: style['border-style'],
fill: style['fill-color']
}
block.call(graphic_attributes) if block_given?
graphic_attributes
end
# @param [Hash] style
# @yield [attrs]
# @yieldparam [Hash] attrs
# @return [Hash]
def build_text_attributes(style, &block)
word_wrap = word_wrap(style['word-wrap'])
text_attributes = {
font: font_family(style['font-family']),
size: style['font-size'],
color: style['color'],
align: text_align(style['text-align']),
valign: text_valign(style['vertical-align']),
styles: font_styles(style['font-style']),
letter_spacing: letter_spacing(style['letter-spacing']),
line_height: line_height(style['line-height']),
overflow: text_overflow(style['overflow']),
word_wrap: word_wrap,
# Deprecated: Use overflow_wrap instead of word_wrap
overflow_wrap: overflow_wrap(style['overflow-wrap'], word_wrap)
}
block.call(text_attributes) if block_given?
text_attributes
end
def overflow_wrap(style, computed_word_wrap)
case style || migrate_overflow_wrap_from_word_wrap(computed_word_wrap)
when 'normal', nil then :normal
when 'anywhere' then :anywhere
# Deprecated: This is a temporary value for migrating from word_wrap.
when 'disable-break-word-by-space' then :disable_break_word_by_space
else :normal
end
end
def migrate_overflow_wrap_from_word_wrap(computed_word_wrap)
case computed_word_wrap
when :none then 'disable-break-word-by-space'
when :break_word then 'normal'
else raise ArgumentError, 'Invalid computed word_wrap value'
end
end
# @param [Array<String>] font_names
# @return [String]
def font_family(font_names)
font_name = font_names.first
default_family_if_missing(font_name)
end
# @param [Array<String>] styles
# @return [Array<Symbol>]
def font_styles(styles)
styles.map do |font_style|
case font_style
when 'bold' then :bold
when 'italic' then :italic
when 'underline' then :underline
when 'linethrough' then :strikethrough
end
end
end
# @param [Float, "", nil] spacing
# @return [Float, nil]
def letter_spacing(spacing)
blank_value?(spacing) ? nil : spacing
end
# @param ["left", "center", "right", ""] align
# @return [:left, :center, :right]
def text_align(align)
case align
when 'left' then :left
when 'center' then :center
when 'right' then :right
when '' then :left
else :left
end
end
# @param ["top", "middle", "bottom", "", nil] valign
# @return [:top, :center, :bottom]
def text_valign(valign)
case valign
when 'top' then :top
when 'middle' then :center
when 'bottom' then :bottom
when '' then :top
else :top
end
end
# @param ["truncate", "fit", "expand", "", nil] overflow
# @return [:truncate, :shrink_to_fit, :expand]
def text_overflow(overflow)
case overflow
when 'truncate' then :truncate
when 'fit' then :shrink_to_fit
when 'expand' then :expand
when '' then :truncate
else :truncate
end
end
# @param ["break-word", "none", "", nil] word_wrap
# @return [:break_word, :none]
def word_wrap(word_wrap)
case word_wrap
when 'break-word' then :break_word
when 'none' then :none
else :none
end
end
# @param [Float, "", nil] height
# @return [Float, nil]
def line_height(height)
blank_value?(height) ? nil : height
end
# @param ["left", "center", "right", ""] position
# @return [:left, :center, :right]
def image_position_x(position)
case position
when 'left' then :left
when 'center' then :center
when 'right' then :right
when '' then :left
else :left
end
end
# @param ["top", "middle", "bottom", ""] position
# @return [:left, :center, :right]
def image_position_y(position)
case position
when 'top' then :top
when 'middle' then :center
when 'bottom' then :bottom
when '' then :top
else :top
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/basic.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Graphics
STROKE_DASH = {
dashed: [2, 2],
dotted: [1, 2]
}.freeze
# @param [Numeric, String] x1
# @param [Numeric, String] y1
# @param [Numeric, String] x2
# @param [Numeric, String] y2
# @param [Hash] attrs ({})
# @option attrs [String] :stroke
# @option attrs [Numeric, String] :stroke_width
# @option attrs ["solid", "dashed", "dotted"] :stroke_type
def line(x1, y1, x2, y2, attrs = {})
with_graphic_styles(attrs) do
pdf.line(pos(x1, y1), pos(x2, y2))
end
end
# @param [Numeric, String] x
# @param [Numeric, String] y
# @param [Numeric, String] w width
# @param [Numeric, String] h height
# @param [Hash] attrs ({})
# @option attrs [Integer, String] :radius
# @option attrs [String] :stroke
# @option attrs [Numeric, String] :stroke_width
# @option attrs ["solid", "dashed", "dotted"] :stroke_type
# @option attrs [String] :fill
def rect(x, y, w, h, attrs = {})
w, h = s2f(w, h)
radius = s2f(attrs[:radius])
with_graphic_styles(attrs) do
if radius && !radius.zero?
pdf.rounded_rectangle(pos(x, y), w, h, radius)
else
pdf.rectangle(pos(x, y), w, h)
end
end
end
# @param [Numeric, String] x center-x
# @param [Numeric, String] y center-y
# @param [Numeric, String] rx
# @param [Numeric, String] ry
# @param [Hash] attrs ({})
# @option attrs [String] :stroke
# @option attrs [Numeric, String] :stroke_width
# @option attrs [Array<Integer, String>] :stroke_dash
# @option attrs ["solid", "dashed", "dotted"] :stroke_type
# @option attrs [String] :fill
def ellipse(x, y, rx, ry, attrs = {})
rx, ry = s2f(rx, ry)
with_graphic_styles(attrs) do
pdf.ellipse(pos(x, y), rx, ry)
end
end
# @param [Hash] attrs
def with_graphic_styles(attrs, &block)
stroke = build_stroke_styles(attrs)
fill = build_fill_styles(attrs)
# Do not draw if no colors given.
return unless fill || stroke
save_graphics_state
# Apply stroke-dashed.
if stroke && stroke[:dash]
length, space = stroke[:dash]
pdf.dash(length, space: space)
end
# Draw with fill and stroke.
if fill && stroke
pdf.fill_and_stroke do
line_width(stroke[:width])
pdf.fill_color(fill[:color])
pdf.stroke_color(stroke[:color])
block.call
end
# Draw only with fill.
elsif fill
pdf.fill do
pdf.fill_color(fill[:color])
block.call
end
# Draw only with stroke.
elsif stroke
pdf.stroke do
line_width(stroke[:width])
pdf.stroke_color(stroke[:color])
block.call
end
end
restore_graphics_state
end
# @param [Hash] styles
# @return [Hash, nil]
def build_stroke_styles(styles)
color = styles[:stroke]
width = styles[:stroke_width]
return nil unless color && color != 'none'
return nil unless width && width != 0
{
color: parse_color(color),
width: s2f(width),
dash: STROKE_DASH[styles[:stroke_type].to_sym]
}
end
# @param [Hash] styles
# @return [Hash, nil]
def build_fill_styles(styles)
color = styles[:fill]
return nil unless color && color != 'none'
{ color: parse_color(color) }
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/image.rb
================================================
# frozen_string_literal: true
require 'tempfile'
require 'base64'
require 'digest/md5'
module Thinreports
module BasicReport
module Generator
class PDF
module Graphics
# @param [String, IO] filename_or_io
# @param [Numeric, Strng] x
# @param [Numeric, Strng] y
# @param [Numeric, Strng] w
# @param [Numeric, Strng] h
def image(filename_or_io, x, y, w, h)
w, h = s2f(w, h)
pdf.image(filename_or_io, at: pos(x, y), width: w, height: h)
end
# @param [String] base64_data
# @param [Numeric, Strng] x
# @param [Numeric, Strng] y
# @param [Numeric, Strng] w
# @param [Numeric, Strng] h
def base64image(base64_data, x, y, w, h)
image_data = Base64.decode64(base64_data)
image_id = Digest::MD5.hexdigest(base64_data)
image_path = create_temp_imagefile(image_id, image_data)
image(image_path, x, y, w, h)
end
# @param [String, IO] filename_or_io
# @param [Numeric, Strng] x
# @param [Numeric, Strng] y
# @param [Numeric, Strng] w
# @param [Numeric, Strng] h
# @param [Hash] options
# @option options [:left, :center, :right] :position_x (:left)
# @option options [:top, :center, :bottom] :position_y (:top)
# @option options [Numeric] :offset_x
# @option options [Numeric] :offset_y
def image_box(filename_or_io, x, y, w, h, options = {})
w, h = s2f(w, h)
computed_position = pos(
x + (options[:offset_x] || 0),
y + (options[:offset_y] || 0)
)
pdf.bounding_box(computed_position, width: w, height: h) do
pdf.image(
filename_or_io,
position: options[:position_x] || :left,
vposition: options[:position_y] || :top,
auto_fit: [w, h]
)
end
end
def image_dimensions(filename_or_io, x, y, w, h, options = {})
w, h = s2f(w, h)
# XXX: Calling @private method
_pdf_obj, info = pdf.build_image_object(filename_or_io)
info.calc_image_dimensions(
position: options[:position_x] || :left,
vposition: options[:position_y] || :top,
auto_fit: [w, h]
)
end
def clean_temp_images
temp_image_registry.each_value(&:close!)
temp_image_registry.clear
end
def temp_image_registry
@temp_image_registry ||= {}
end
# @param [String] image_id
# @param [String] image_data
# @return [String] Path to imagefile
def create_temp_imagefile(image_id, image_data)
temp_image_registry[image_id] ||= begin
file = Tempfile.new('temp-image')
file.binmode
file.write(image_data)
file.open
file
end
temp_image_registry[image_id].path
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/text.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Graphics
# @param [String] content
# @param [Numeric, String] x
# @param [Numeric, String] y
# @param [Numeric, String] w
# @param [Numeric, String] h
# @param [Hash] attrs ({})
# @option attrs [String] :font
# @option attrs [Numeric, String] :size
# @option attrs [String] :color
# @option attrs [Array<:bold, :italic, :underline, :strikethrough>]
# :styles (nil)
# @option attrs [:left, :center, :right] :align (:left)
# @option attrs [:top, :center, :bottom] :valign (:top)
# @option attrs [Numeric, String] :line_height The total height of an text line.
# @option attrs [Numeric, String] :letter_spacing
# @option attrs [Boolean] :single (false)
# @option attrs [:trancate, :shrink_to_fit, :expand] :overflow (:trancate)
# @option attrs [:none, :break_word] :word_wrap (:none)
# @option attrs [:normal, :anywhere, :disable_break_word_by_space] :overflow_wrap (:normal)
def text_box(content, x, y, w, h, attrs = {}, &block)
w, h = s2f(w, h)
box_attrs = text_box_attrs(
x, y, w, h,
single: attrs.delete(:single),
overflow: attrs[:overflow]
)
content = replace_space_to_nbsp(content) if attrs[:overflow_wrap] == :disable_break_word_by_space
with_text_styles(attrs) do |built_attrs, font_styles|
if block
block.call [{ text: content, styles: font_styles }],
built_attrs.merge(box_attrs)
else
pdf.formatted_text_box(
[{ text: content, styles: font_styles }],
built_attrs.merge(box_attrs)
)
end
end
rescue Prawn::Errors::CannotFit
# Nothing to do.
#
# When the area is too small compared
# with the content and the style of the text.
# (See prawn/core/text/formatted/line_wrap.rb#L185)
end
# @see #text_box
def text(content, x, y, w, h, attrs = {})
# Set the :overflow property to :shirink_to_fit.
text_box(content, x, y, w, h, { overflow: :shirink_to_fit }.merge(attrs))
end
private
# @param x (see #text_box)
# @param y (see #text_box)
# @param w (see #text_box)
# @param h (see #text_box)
# @param [Hash] states
# @option states [Boolean] :single
# @option states [Symbold] :overflow
# @return [Hash]
def text_box_attrs(x, y, w, h, states = {})
attrs = {
at: pos(x, y),
width: s2f(w)
}
if states[:single]
states[:overflow] != :expand ? attrs.merge(single_line: true) : attrs
else
attrs.merge(height: s2f(h))
end
end
# @param attrs (see #text)
# @yield [built_attrs, font_styles]
# @yieldparam [Hash] built_attrs The finalized attributes.
# @yieldparam [Array] font_styles The finalized styles.
def with_text_styles(attrs, &block)
# When no color is given, do not draw.
return unless attrs.key?(:color) && attrs[:color] != 'none'
save_graphics_state
fontinfo = {
name: attrs.delete(:font).to_s,
color: parse_color(attrs.delete(:color)),
size: s2f(attrs.delete(:size))
}
# Add the specified value to :leading option.
line_height = attrs.delete(:line_height)
if line_height
attrs[:leading] = text_line_leading(
s2f(line_height),
name: fontinfo[:name],
size: fontinfo[:size]
)
end
# Set the :character_spacing option.
spacing = attrs.delete(:letter_spacing)
attrs[:character_spacing] = s2f(spacing) if spacing
# Disable line breaking on chars such as spaces and hyphens
attrs[:disable_word_break] = true if attrs.delete(:overflow_wrap) == :anywhere
# Delete unnecessary attributes
attrs.delete(:word_wrap)
# Or... with_font_styles(attrs, fontinfo, &block)
with_font_styles(attrs, fontinfo) do |modified_attrs, styles|
block.call(modified_attrs, styles)
end
restore_graphics_state
end
# @param [Numeric] line_height
# @param [Hash] font
# @option font [String] :name Name of font.
# @option font [Numeric] :size Size of font.
# @return [Numeric]
def text_line_leading(line_height, font)
line_height - pdf.font(font[:name], size: font[:size]).height
end
# @param [String] content
# @return [String]
def replace_space_to_nbsp(content)
content.gsub(/ /, Prawn::Text::NBSP)
end
# @param [Hash] attrs
# @param [Hash] font
# @option font [String] :color
# @option font [Numeric] :size
# @option font [String] :name
# @yield [attributes, styles]
# @yieldparam [Hash] modified_attrs
# @yieldparam [Array] styles
def with_font_styles(attrs, font, &block)
# Building font styles.
styles = attrs.delete(:styles)
if styles
manual, styles = styles.partition do |style|
%i[bold italic].include?(style) && !font_has_style?(font[:name], style)
end
end
# Emulate bold style.
if manual && manual.include?(:bold)
pdf.stroke_color(font[:color])
pdf.line_width(font[:size] * 0.025)
# Change rendering mode to :fill_stroke.
attrs[:mode] = :fill_stroke
end
# Emulate italic style.
if manual && manual.include?(:italic)
# FIXME
# pdf.transformation_matrix(1, 0, 0.26, 1, 0, 0)
end
pdf.font(font[:name], size: font[:size]) do
pdf.fill_color(font[:color])
block.call(attrs, styles || [])
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Graphics
BASE_LINE_WIDTH = 0.9
private
# Change the default graphic states defined by Prawn.
def setup_custom_graphic_states
pdf.line_width(BASE_LINE_WIDTH)
end
# @param [Numeric] width
def line_width(width)
pdf.line_width(width * BASE_LINE_WIDTH)
end
# Delegate to Prawn::Document#save_graphic_state
# @see Prawn::Document#save_graphics_state
def save_graphics_state
pdf.save_graphics_state
end
# Delegate to Prawn::Document#restore_graphic_state
# @see Prawn::Document#restore_graphics_state
def restore_graphics_state
pdf.restore_graphics_state
end
end
end
end
end
end
require_relative 'graphics/attributes'
require_relative 'graphics/basic'
require_relative 'graphics/image'
require_relative 'graphics/text'
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/page.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Page
JIS_SIZES = {
'B4' => [728.5, 1031.8],
'B5' => [515.9, 728.5]
}.freeze
# @param [Thinreports::BasicReport::Layout::Format] format
def start_new_page(format)
format_id =
if change_page_format?(format)
pdf.start_new_page(new_basic_page_options(format))
@current_page_format = format
create_format_stamp(format) unless format_stamp_registry.include?(format.identifier)
format.identifier
else
pdf.start_new_page(new_basic_page_options(current_page_format))
current_page_format.identifier
end
stamp(format_id.to_s)
end
def start_new_page_for_section_report(format)
@current_page_format = format
pdf.start_new_page(new_basic_page_options(current_page_format).merge(
top_margin: current_page_format.page_margin[0],
bottom_margin: current_page_format.page_margin[2]
))
end
def max_content_height
pdf.margin_box.height
end
def add_blank_page
pdf.start_new_page(pdf.page_count.zero? ? { size: 'A4' } : {})
end
private
# @return [Thinreports::BasicReport::Layout::Format]
attr_reader :current_page_format
# @param [Thinreports::BasicReport::Layout::Format] new_format
# @return [Boolean]
def change_page_format?(new_format)
!current_page_format ||
current_page_format.identifier != new_format.identifier
end
# @param [Thinreports::BasicReport::Layout::Format] format
def create_format_stamp(format)
create_stamp(format.identifier.to_s) do
draw_template_items(format.attributes['items'])
end
format_stamp_registry << format.identifier
end
# @return [Array]
def format_stamp_registry
@format_stamp_registry ||= []
end
# @param [Thinreports::BasicReport::Layout::Format] format
# @return [Hash]
def new_basic_page_options(format)
options = { layout: format.page_orientation.to_sym }
options[:size] =
if format.user_paper_type?
[format.page_width.to_f, format.page_height.to_f]
else
case format.page_paper_type
# Convert B4(5)_ISO to B4(5)
when 'B4_ISO', 'B5_ISO'
format.page_paper_type.delete('_ISO')
when 'B4', 'B5'
JIS_SIZES[format.page_paper_type]
else
format.page_paper_type
end
end
options
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document/parse_color.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module ParseColor
# @param [String] color
# @return [String]
def parse_color(color)
color = color.downcase
if color =~ /^#?[\da-f]{6}$/
color.delete('#')
else
find_color_from_name(color)
end
end
private
# Supported only SAFE COLORS.
SUPPORTED_COLOR_NAMES = {
'red' => 'ff0000',
'yellow' => 'fff000',
'lime' => '00ff00',
'aqua' => '00ffff',
'blue' => '0000ff',
'fuchsia' => 'ff00ff',
'maroon' => '800000',
'olive' => '808000',
'green' => '008800',
'teal' => '008080',
'navy' => '000080',
'purple' => '800080',
'black' => '000000',
'gray' => '808080',
'silver' => 'c0c0c0',
'white' => 'ffffff'
}.freeze
def find_color_from_name(name)
color = SUPPORTED_COLOR_NAMES[name]
raise Thinreports::BasicReport::Errors::UnsupportedColorName, name unless color
color
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/document.rb
================================================
# frozen_string_literal: true
require_relative 'document/font'
require_relative 'document/parse_color'
require_relative 'document/graphics'
require_relative 'document/draw_shape'
require_relative 'document/draw_template_items'
require_relative 'document/page'
module Thinreports
module BasicReport
module Generator
class PDF
class Document
include Utils
include PDF::Font
include PDF::ParseColor
include PDF::Graphics
include PDF::DrawShape
include PDF::DrawTemplateItems
include PDF::Page
# @return [Prawn::Document]
attr_reader :pdf
# @param [String] title (nil)
# @param [Hash] security (nil)
def initialize(title: nil, security: nil)
@pdf = Prawn::Document.new(
skip_page_creation: true,
margin: [0, 0],
info: {
CreationDate: Time.now,
Creator: 'Thinreports Generator for Ruby ' + Thinreports::VERSION,
Title: title
}
)
# Setup to Prawn::Document.
setup_fonts
setup_custom_graphic_states
# Encrypts the document.
@pdf.encrypt_document(security) if security
end
# Delegate to Prawn::Document#render
# @see Prawn::Document#render
def render
result = pdf.render
finalize
result
end
# Delegate to Prawn::Document#render_file
# @see Prawn::Document#render_file
def render_file(*args)
finalize
pdf.render_file(*args)
end
# @param [Numeric, String] x
# @param [Numeric, String] y
def translate(x, y, &block)
x, y = rpos(x, y)
pdf.translate(x, y, &block)
end
# @param [String] stamp_id
# @param [Array<Numeric>] at (nil)
def stamp(stamp_id, at = nil)
if at.nil?
pdf.stamp(stamp_id)
else
pdf.stamp_at(stamp_id, rpos(*at))
end
end
# Delegate to Prawn::Document#create_stamp
# @param [String] id
# @see Prawn::Document#create_stamp
def create_stamp(id, &block)
pdf.create_stamp(id, &block)
end
# @see #pdf
def internal
@pdf
end
private
def finalize
clean_temp_images
end
# @param [Array<String, Numeric>] values
# @return [Numeric, Array<Numeric>, nil]
def s2f(*values)
return nil if values.empty?
if values.size == 1
value = values.first
return nil unless value
value.is_a?(::Numeric) ? value : value.to_f
else
values.map { |v| s2f(v) }
end
end
# @param [Numeric, String] x
# @param [Numeric, String] y
# @return [Array<Float>]
def map_to_upper_left_relative_position(x, y)
x, y = s2f(x, y)
[x, -y]
end
alias rpos map_to_upper_left_relative_position
# @param [Numeric, String] x
# @param [Numeric, String] y
# @return [Array<Float>]
def map_to_upper_left_position(x, y)
x, y = s2f(x, y)
[x, pdf.bounds.height - y]
end
alias pos map_to_upper_left_position
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/drawer/base.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Drawer
# @abstract
class Base
# @param [Thinreports::BasicReport::Generator::PDF::Document] pdf
# @param [Thinreports::BasicReport::Core::Shape::Manager::Format] format
def initialize(pdf, format)
@pdf = pdf
@format = format
@stamps = []
@draw_at = nil
end
# @abstract
def draw
raise NotImplementedError
end
private
# @param [Thinreports::BasicReport::Core::Shape::Base::Internal] shape
# @return [String]
def pdf_stamp_id(shape)
"#{@format.identifier}#{shape.identifier}"
end
# @overload pdf_stamp(shape_id)
# @param [String] shape_id
# @overload pdf_stamp(shape)
# @param [Thinreports::BasicReport::Core::Shape::Base::Internal] shape
def pdf_stamp(shape)
shape = pdf_stamp_id(shape) unless shape.is_a?(::String)
@pdf.stamp(shape, @draw_at)
end
# @param [Thinreports::BasicReport::Core::Shape::Base::Internal] shape
def create_pdf_stamp(shape, &block)
@pdf.create_stamp(pdf_stamp_id(shape), &block)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/drawer/list.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Drawer
class List < Base
# @param (see PDF::Drawer::Base#initialize)
def initialize(pdf, format)
super
@sections = {}
end
# @param [Thinreports::BasicReport::Core::Shape::List::PageState] list_page
def draw(list_page)
draw_section(list_page.header) if list_page.header
list_page.rows.each do |row|
draw_section(row)
end
# Returns Thinreports::BasicReport::Report::Page object
manager = list_page.parent.manager
list_id = list_page.id.to_s
manager.format.shapes.each do |id, shape|
next unless list_pageno?(list_id, shape)
shape = manager.final_shape(id)
@pdf.draw_shape_pageno(shape.internal,
list_page.no, list_page.manager.page_count)
end
end
private
# @param [String] list_id
# @param [Thinreports::BasicReport::Core::Shape::Base::Format] shape
# @return [Boolean]
def list_pageno?(list_id, shape)
shape.type == Thinreports::BasicReport::Core::Shape::PageNumber::TYPE_NAME &&
shape.target == list_id
end
# @param [Thinreports::BasicReport::Core::Shape::List::SectionInterface] section
def draw_section(section)
internal = section.internal
base_top = @format.section_base_position_top(internal.section_name)
position = [internal.relative_left, base_top + internal.relative_top]
drawer(internal).draw(section, position)
end
# @param [Thinreports::BasicReport::Core::Shape::List::SectionInternal] section
# @return [Thinreports::BasicReport::Generator::PDF::Drawer::ListSection]
def drawer(section)
@sections[section.section_name] ||= ListSection.new(@pdf, section)
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/drawer/list_section.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Drawer
class ListSection < Page
# @param pdf (see PDF::Drawer::Page#initialize)
# @param section [Thinreports::BasicReport::Core::Shape::List::SectionInternal] section
def initialize(pdf, section)
super(pdf, section.format)
@section = section
@stamp_created = false
end
# @param [Thinreports::BasicReport::Core::Shape::List::SectionInternal] section
# @param [Array<Numeric>] at
def draw(section, at)
@draw_at = at
draw_section
super(section)
end
private
def draw_section
id = @format.identifier.to_s
unless @stamp_created
@pdf.create_stamp(id) { @pdf.draw_template_items(@format.attributes['items']) }
@stamp_created = true
end
pdf_stamp(id)
end
# @see Thinreports::BasicReport::Generator::PDF::Drawer::Page#draw_tblock_shape
def draw_tblock_shape(shape)
@pdf.translate(*@draw_at) { super }
end
# @see Thinreports::BasicReport::Generator::PDF::Drawer::Page#draw_iblock_shape
def draw_iblock_shape(shape)
@pdf.translate(*@draw_at) { super }
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/drawer/page.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
class PDF
module Drawer
class Page < Base
# @param (see PDF::Drawer::Base#initialize)
def initialize(pdf, format)
super
@lists = {}
end
# @param [Thinreports::BasicReport::Report::Page] page
def draw(page)
manager = page.manager
manager.format.shapes.each_key do |id|
shape = manager.final_shape(id)
next unless shape
shape = shape.internal
if shape.type_of?(Core::Shape::PageNumber::TYPE_NAME)
# Do not draw pageno if is not for Report
draw_pageno_shape(shape, page) if page.count? && shape.for_report?
else
draw_shape(shape)
end
end
end
private
def draw_shape(shape)
if shape.type_of?(Core::Shape::TextBlock::TYPE_NAME)
draw_tblock_shape(shape)
elsif shape.type_of?(Core::Shape::List::TYPE_NAME)
draw_list_shape(shape)
elsif shape.type_of?(Core::Shape::ImageBlock::TYPE_NAME)
draw_iblock_shape(shape)
else
id = shape.identifier
unless @stamps.include?(id)
create_basic_shape_stamp(shape)
@stamps << id
end
pdf_stamp(shape)
end
end
def draw_pageno_shape(shape, page)
@pdf.draw_shape_pageno(shape, page.no, page.report.page_count)
end
# @see #draw_shape
def draw_list_shape(shape)
drawer = @lists[shape.id] ||= List.new(@pdf, shape.format)
drawer.draw(shape)
end
# @see #draw_shape
def draw_tblock_shape(shape)
@pdf.draw_shape_tblock(shape)
end
# @see #draw_shape
def draw_iblock_shape(shape)
@pdf.draw_shape_iblock(shape)
end
# @param [Thinreports::BasicReport::Core::Shape::Base::Internal] shape
def create_basic_shape_stamp(shape)
if shape.type_of?('text')
create_text_stamp(shape)
elsif shape.type_of?('image')
create_image_stamp(shape)
elsif shape.type_of?('ellipse')
create_ellipse_stamp(shape)
elsif shape.type_of?('rect')
create_rect_stamp(shape)
elsif shape.type_of?('line')
create_line_stamp(shape)
end
end
# @see #create_basic_shape_stamp
def create_image_stamp(shape)
create_pdf_stamp(shape) do
@pdf.draw_shape_image(shape)
end
end
# @see #create_basic_shape_stamp
def create_rect_stamp(shape)
create_pdf_stamp(shape) do
@pdf.draw_shape_rect(shape)
end
end
# @see #create_basic_shape_stamp
def create_ellipse_stamp(shape)
create_pdf_stamp(shape) do
@pdf.draw_shape_ellipse(shape)
end
end
# @see #create_basic_shape_stamp
def create_line_stamp(shape)
create_pdf_stamp(shape) do
@pdf.draw_shape_line(shape)
end
end
# @see #create_basic_shape_stamp
def create_text_stamp(shape)
create_pdf_stamp(shape) do
@pdf.draw_shape_text(shape)
end
end
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/prawn_ext/calc_image_dimensions.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
module PrawnExt
module CalcImageDimensions
# Implement :auto_fit option for image size calculation.
#
# When the image is larger than the box, the original: fit option does not change
# the image size. The :auto_fit option changes the image size to fit in the box
# while maintaining the aspect ratio.
#
# Usage:
# image '/path/to/image.png', at: [100, 100], auto_fit: [100, 100]
#
def calc_image_dimensions(options)
if options[:auto_fit]
image_width = options[:width] || width
image_height = options[:height] || height
box_width, box_height = options.delete(:auto_fit)
options[:fit] = [box_width, box_height] if image_width > box_width || image_height > box_height
end
super(options)
end
end
end
end
end
end
Prawn::Images::Image.prepend Thinreports::BasicReport::Generator::PrawnExt::CalcImageDimensions
================================================
FILE: lib/thinreports/basic_report/generator/pdf/prawn_ext/width_of.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Generator
module PrawnExt
module WidthOf
# This patch fixes the character_spacing effect on text width calculation.
#
# The original #width_of:
#
# width_of('abcd') #=> 4 + 4 = 8
#
# The #width_of in this patch:
#
# width_of('abcd') #=> 4 + 3 = 7
#
def width_of(*)
width = super - character_spacing
width > 0 ? width : 0
end
end
end
end
end
end
# Prawn v2.3 and later includes this patch by https://github.com/prawnpdf/prawn/pull/1117.
if Prawn::VERSION < '2.3.0'
Prawn::Document.prepend Thinreports::BasicReport::Generator::PrawnExt::WidthOf
end
================================================
FILE: lib/thinreports/basic_report/generator/pdf/prawn_ext.rb
================================================
# frozen_string_literal: true
require_relative 'prawn_ext/width_of'
require_relative 'prawn_ext/calc_image_dimensions'
Prawn::Font::AFM.hide_m17n_warning = true
================================================
FILE: lib/thinreports/basic_report/generator/pdf.rb
================================================
# frozen_string_literal: true
require 'prawn'
require 'prawn/disable_word_break'
Prawn::DisableWordBreak.config.default = false
module Thinreports
module BasicReport
module Generator
class PDF
# @return [Thinreports::BasicReport::Report::Base]
attr_reader :report
# @param [Thinreports::BasicReport::Report::Base] report
# @param [Hash] security (nil)
# @param [String] title (nil)
def initialize(report, security: nil, title: nil)
report.finalize
@report = report.internal
title ||= default_layout ? default_layout.format.report_title : nil
@document = Document.new(title: title, security: security)
@drawers = {}
end
# @param [String, nil] filename
# @return [String, nil]
def generate(filename = nil)
draw_report
filename ? @document.render_file(filename) : @document.render
end
def default_layout
report.default_layout
end
private
def draw_report
report.pages.each do |page|
draw_page(page)
end
end
def draw_page(page)
return @document.add_blank_page if page.blank?
format = page.layout.format
@document.start_new_page(format)
drawer(format).draw(page)
end
def drawer(format)
@drawers[format.identifier] ||= Drawer::Page.new(@document, format)
end
end
end
end
end
require_relative 'pdf/prawn_ext'
require_relative 'pdf/document'
require_relative 'pdf/drawer/base'
require_relative 'pdf/drawer/page'
require_relative 'pdf/drawer/list'
require_relative 'pdf/drawer/list_section'
================================================
FILE: lib/thinreports/basic_report/layout/base.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Layout
class Base
EXT_NAME = 'tlf'
include Utils
class << self
# @param [String] filename
# @return [Thinreports::BasicReport::Layout::Format]
# @raise [Thinreports::BasicReport::Errors::InvalidLayoutFormat]
# @raise [Thinreports::BasicReport::Errors::IncompatibleLayoutFormat]
def load_format(filename)
filename += ".#{EXT_NAME}" unless filename =~ /\.#{EXT_NAME}$/
raise Thinreports::BasicReport::Errors::LayoutFileNotFound unless File.exist?(filename)
# Build format.
Thinreports::BasicReport::Layout::Format.build(filename)
end
end
attr_reader :format
# @return [String]
attr_reader :filename
# @return [Symbol]
attr_reader :id
# @param [String] filename
# @param [Hash] options
# @option options [Symbol] :id (nil)
def initialize(filename, options = {})
@filename = filename
@format = self.class.load_format(filename)
@id = options[:id]
end
# @return [Boolean] Return the true if is default layout.
def default?
@id.nil?
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/layout/format.rb
================================================
# frozen_string_literal: true
require 'json'
module Thinreports
module BasicReport
module Layout
class Format < Core::Shape::Manager::Format
config_reader last_version: %w[version]
config_reader report_title: %w[title]
config_reader page_paper_type: %w[report paper-type],
page_width: %w[report width],
page_height: %w[report height],
page_orientation: %w[report orientation]
class << self
def build(filename)
schema = JSON.parse(read_file(filename))
schema_version = Layout::Version.new(schema['version'])
unless schema_version.compatible?
raise Errors::IncompatibleLayoutFormat.new(
filename, schema['version'],
Layout::Version.compatible_rules.join(' and ')
)
end
if schema_version.legacy?
warn '[DEPRECATION] Support for the layout file with old format' \
' that generated with Editor 0.8 or lower will be dropped in Thinreports 1.1.' \
' Please convert to new layout format using Thinreports Editor 0.9 or 1.0.'
schema = Layout::LegacySchema.new(schema).upgrade
end
new schema
end
def read_file(filename)
File.read(filename, encoding: 'UTF-8')
end
end
def initialize(*)
super
initialize_items(attributes['items'])
end
def user_paper_type?
page_paper_type == 'user'
end
private
def initialize_items(item_schemas)
item_schemas.each do |item_schema|
id, type = item_schema.values_at 'id', 'type'
next if id.empty? && type != 'page-number'
item = Core::Shape::Format(type).new(item_schema)
shapes[item.id.to_sym] = item
end
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/layout/legacy_schema.rb
================================================
# frozen_string_literal: true
require 'json'
require 'rexml/document'
module Thinreports
module BasicReport
module Layout
class LegacySchema
include Utils
def initialize(legacy_schema)
@legacy_schema = legacy_schema
@legacy_svg = legacy_schema['svg'].dup
@legacy_item_schemas = extract_legacy_item_schemas(legacy_svg)
@legacy_svg = cleanup_svg(@legacy_svg)
end
def upgrade
config = legacy_schema['config']
page_config = config['page']
{
'version' => legacy_schema['version'],
'title' => legacy_schema['config']['title'],
'report' => {
'paper-type' => page_config['paper-type'],
'width' => page_config['width'].to_f,
'height' => page_config['height'].to_f,
'orientation' => page_config['orientation'],
'margin' => page_config.values_at(
'margin-top',
'margin-right',
'margin-bottom',
'margin-left'
).map(&:to_f)
},
'items' => item_schemas
}
end
attr_reader :legacy_schema, :legacy_svg, :legacy_item_schemas
def item_schemas
svg = REXML::Document.new(legacy_svg)
build_item_schemas_from_svg(svg.elements['/svg/g'])
end
def build_item_schemas_from_svg(svg_elements)
return [] unless svg_elements
items = []
svg_elements.each do |item_element|
item_attributes = item_element.attributes
items <<
case item_element.attributes['class']
when 's-text' then text_item_schema(item_attributes, extract_texts_from(item_element))
when 's-image' then image_item_schema(item_attributes)
when 's-rect' then rect_item_schema(item_attributes)
when 's-ellipse' then ellipse_item_schema(item_attributes)
when 's-line' then line_item_schema(item_attributes)
when 's-tblock' then text_block_item_schema(item_attributes)
when 's-iblock' then image_block_item_schema(item_attributes)
when 's-pageno' then page_number_item_schema(item_attributes)
when 's-list' then list_item_schema(item_element)
else raise 'Unknown item type'
end
end
items
end
def text_item_schema(attributes, texts)
{
'id' => attributes['x-id'],
'type' => Core::Shape::Text::TYPE_NAME,
'x' => attributes['x-left'].to_f,
'y' => attributes['x-top'].to_f,
'width' => attributes['x-width'].to_f,
'height' => attributes['x-height'].to_f,
'display' => display(attributes['x-display']),
'texts' => texts,
'style' => {
'font-family' => [attributes['font-family']],
'font-size' => attributes['font-size'].to_f,
'color' => attributes['fill'],
'font-style' => font_style(attributes),
'text-align' => text_align(attributes['text-anchor']),
'vertical-align' => vertical_align(attributes['x-valign']),
'line-height' => line_height(attributes['x-line-height']),
'letter-spacing' => letter_spacing(attributes['kerning'])
}
}
end
def rect_item_schema(attributes)
{
'id' => attributes['x-id'],
'type' => 'rect',
'x' => attributes['x'].to_f,
'y' => attributes['y'].to_f,
'width' => attributes['width'].to_f,
'height' => attributes['height'].to_f,
'display' => display(attributes['x-display']),
'border-radius' => attributes['rx'].to_i,
'style' => {
'border-width' => attributes['stroke-width'].to_f,
'border-color' => attributes['stroke'],
'border-style' => attributes['x-stroke-type'],
'fill-color' => attributes['fill']
}
}
end
def line_item_schema(attributes)
{
'id' => attributes['x-id'],
'type' => 'line',
'x1' => attributes['x1'].to_f,
'y1' => attributes['y1'].to_f,
'x2' => attributes['x2'].to_f,
'y2' => attributes['y2'].to_f,
'display' => display(attributes['x-display']),
'style' => {
'border-width' => attributes['stroke-width'].to_f,
'border-color' => attributes['stroke'],
'border-style' => attributes['x-stroke-type']
}
}
end
def ellipse_item_schema(attributes)
{
'id' => attributes['x-id'],
'type' => 'ellipse',
'cx' => attributes['cx'].to_f,
'cy' => attributes['cy'].to_f,
'rx' => attributes['rx'].to_f,
'ry' => attributes['ry'].to_f,
'display' => display(attributes['x-display']),
'style' => {
'border-width' => attributes['stroke-width'].to_f,
'border-color' => attributes['stroke'],
'border-style' => attributes['x-stroke-type'],
'fill-color' => attributes['fill']
}
}
end
def image_item_schema(attributes)
_, image_type, image_data = attributes['xlink:href'].match(%r{^data:(image/[a-z]+?);base64,(.+)}).to_a
{
'id' => attributes['x-id'],
'type' => 'image',
'x' => attributes['x'].to_f,
'y' => attributes['y'].to_f,
'width' => attributes['width'].to_f,
'height' => attributes['height'].to_f,
'display' => display(attributes['x-display']),
'data' => {
'mime-type' => image_type,
'base64' => image_data
}
}
end
def page_number_item_schema(attributes)
{
'id' => attributes['x-id'],
'type' => Core::Shape::PageNumber::TYPE_NAME,
'x' => attributes['x-left'].to_f,
'y' => attributes['x-top'].to_f,
'width' => attributes['x-width'].to_f,
'height' => attributes['x-height'].to_f,
'format' => attributes['x-format'],
'target' => attributes['x-target'],
'display' => display(attributes['x-display']),
'style' => {
'font-family' => [attributes['font-family']],
'font-size' => attributes['font-size'].to_f,
'color' => attributes['fill'],
'font-style' => font_style(attributes),
'text-align' => text_align(attributes['text-anchor']),
'overflow' => attributes['x-overflow']
}
}
end
def image_block_item_schema(attributes)
{
'id' => attributes['x-id'],
'type' => Core::Shape::ImageBlock::TYPE_NAME,
'x' => attributes['x-left'].to_f,
'y' => attributes['x-top'].to_f,
'width' => attributes['x-width'].to_f,
'height' => attributes['x-height'].to_f,
'display' => display(attributes['x-display']),
'style' => {
'position-x' => attributes['x-position-x'],
'position-y' => image_position_y(attributes['x-position-y'])
}
}
end
def text_block_item_schema(attributes)
text_format = {
'base' => attributes['x-format-base'],
'type' => attributes['x-format-type']
}
case text_format['type']
when 'datetime'
text_format['datetime'] = {
'format' => attributes['x-format-datetime-format']
}
when 'number'
text_format['number'] = {
'delimiter' => attributes['x-format-number-delimiter'],
'precision' => attributes['x-format-number-precision'].to_i
}
when 'padding'
text_format['padding'] = {
'length' => attributes['x-format-padding-length'].to_i,
'char' => attributes['x-format-padding-char'],
'direction' => attributes['x-format-padding-direction']
}
end
{
'id' => attributes['x-id'],
'type' => Core::Shape::TextBlock::TYPE_NAME,
'x' => attributes['x-left'].to_f,
'y' => attributes['x-top'].to_f,
'width' => attributes['x-width'].to_f,
'height' => attributes['x-height'].to_f,
'display' => display(attributes['x-display']),
'value' => attributes['x-value'],
'multiple-line' => attributes['x-multiple'] == 'true',
'format' => text_format,
'reference-id' => attributes['x-ref-id'],
'style' => {
'font-family' => [attributes['font-family']],
'font-size' => attributes['font-size'].to_f,
'color' => attributes['fill'],
'font-style' => font_style(attributes),
'text-align' => text_align(attributes['text-anchor']),
'vertical-align' => vertical_align(attributes['x-valign']),
'line-height' => line_height(attributes['x-line-height']),
'letter-spacing' => letter_spacing(attributes['kerning']),
'overflow' => attributes['x-overflow'],
'word-wrap' => attributes['x-word-wrap'] || ''
}
}
end
def list_item_schema(legacy_element)
legacy_schema = legacy_item_schemas[legacy_element.attributes['x-id']]
header = list_section_schema('header', legacy_element, legacy_schema)
detail = list_section_schema('detail', legacy_element, legacy_schema)
page_footer = list_section_schema('page-footer', legacy_element, legacy_schema)
footer = list_section_schema('footer', legacy_element, legacy_schema)
schema = {
'id' => legacy_schema['id'],
'type' => Core::Shape::List::TYPE_NAME,
'content-height' => legacy_schema['content-height'].to_f,
'auto-page-break' => legacy_schema['page-break'] == 'true',
'display' => display(legacy_schema['display']),
'header' => header,
'detail' => detail,
'page-footer' => page_footer,
'footer' => footer
}
page_footer['translate']['y'] += detail['height'] if page_footer['enabled']
if footer['enabled']
footer['translate']['y'] += detail['height']
footer['translate']['y'] += page_footer['height'] if page_footer['enabled']
end
schema
end
def list_section_schema(section_name, legacy_list_element, legacy_list_schema)
legacy_section_schema = legacy_list_schema[section_name]
return {} if legacy_section_schema.empty?
section_item_elements = legacy_list_element.elements["g[@class='s-list-#{section_name}']"]
section_schema = {
'height' => legacy_section_schema['height'].to_f,
'translate' => {
'x' => legacy_section_schema['translate']['x'].to_f,
'y' => legacy_section_schema['translate']['y'].to_f
},
'items' => build_item_schemas_from_svg(section_item_elements)
}
unless section_name == 'detail'
section_schema['enabled'] = legacy_list_schema["#{section_name}-enabled"] == 'true'
end
section_schema
end
def extract_texts_from(text_item_element)
[].tap do |texts|
text_item_element.each_element('text') { |e| texts << e.text }
end
end
def image_position_y(legacy_position_y)
case legacy_position_y
when 'top' then 'top'
when 'center' then 'middle'
when 'bottom' then 'bottom'
end
end
def display(legacy_display)
legacy_display == 'true'
end
def font_style(attributes)
style = []
style << 'bold' if attributes['font-weight'] == 'bold'
style << 'italic' if attributes['font-style'] == 'italic'
style << 'underline' if attributes['text-decoration'].include?('underline')
style << 'linethrough' if attributes['text-decoration'].include?('line-through')
style
end
def text_align(legacy_text_align)
case legacy_text_align
when 'start' then 'left'
when 'middle' then 'center'
when 'end' then 'right'
else 'left'
end
end
def vertical_align(legacy_vertical_align)
return '' unless legacy_vertical_align
case legacy_vertical_align
when 'top' then 'top'
when 'center' then 'middle'
when 'bottom' then 'bottom'
else 'top'
end
end
def line_height(legacy_line_height)
blank_value?(legacy_line_height) ? '' : legacy_line_height.to_f
end
def letter_spacing(legacy_letter_spacing)
case legacy_letter_spacing
when 'auto', '' then ''
else legacy_letter_spacing.to_f
end
end
def extract_legacy_item_schemas(svg)
items = {}
svg.scan(/<!--SHAPE(.*?)SHAPE-->/) do |(item_schema_json)|
item_schema = JSON.parse(item_schema_json)
items[item_schema['id']] = item_schema
end
items
end
def cleanup_svg(svg)
cleaned_svg = svg.gsub(/<!--SHAPE.*?SHAPE-->/, '')
cleaned_svg.gsub(/<!--LAYOUT(.*?)LAYOUT-->/) { $1 }
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/layout/version.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Layout
class Version
COMPATIBLE_RULES = ['>= 0.8.0', '< 1.0.0'].freeze
NEW_SCHEMA_FROM = '0.9.0'
class << self
def compatible_rules
COMPATIBLE_RULES
end
end
def initialize(schema_version)
@schema_version = normalize_version(schema_version)
end
def compatible?
self.class.compatible_rules.all? do |rule|
op, ver = rule.split(' ')
schema_version.send(op.to_sym, normalize_version(ver))
end
end
def legacy?
@schema_version < normalize_version(NEW_SCHEMA_FROM)
end
private
attr_reader :schema_version
def normalize_version(version)
Gem::Version.create(version)
end
end
end
end
end
================================================
FILE: lib/thinreports/basic_report/layout.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Layout
# @see Thinreports::BasicReport::Layout::Base#initialize
def self.new(filename, options = {})
Base.new(filename, options)
end
end
end
end
require_relative 'layout/version'
require_relative 'layout/base'
require_relative 'layout/format'
require_relative 'layout/legacy_schema'
================================================
FILE: lib/thinreports/basic_report/report/base.rb
================================================
# frozen_string_literal: true
module Thinreports
module BasicReport
module Report
class Base
extend Forwardable
include Utils
class << self
# @param options (see #initialize)
# @option options (see #initialize)
# @yield [report]
# @yieldparam [Thinreports::BasicReport::Report::Base] report
# @return [Thinreports::BasicReport::Report::Base]
def create(options = {}, &block)
raise ArgumentError, '#create requires a block' unless block_given?
report = new(options)
call_block_in(report, &block)
report.finalize
report
end
# @param layout (see #initialize)
# @param filename (see #generate)
# @param security (see #generate)
# @param title (see #generate)
# @param [Hash] report ({}) DEPRECATED. Options for Report.
# @param [Hash] generator ({}) DEPRECATED. Options for Generator.
# @yield (see .create)
# @yieldparam (see .create)
# @return [String]
def generate(layout: nil, filename: nil, security: nil, title: nil, report: {}, generator: {}, &block)
raise ArgumentError, '#generate requires a block' unless block_given?
if report.any? || generator.any?
warn '[DEPRECATION] :report and :generator argument has been deprecated. ' \
'Use :layout and :filename, :security argument instead.'
end
layout ||= report[:layout]
filename ||= generator[:filename]
security ||= generator[:security]
report = create(layout: layout, &block)
report.generate(filename: filename, security: security, title: title)
end
end
# @return [Thinreports::BasicReport::Report::Internal]
attr_reader :internal
# @return [Integer]
attr_reader :start_page_number
# @return [Thinreports::BasicReport::Report::Page]
def_delegator :internal, :page
# @return [Integer]
def_delegator :internal, :page_count
# @return [Array<Thinreports::BasicReport::Report::Page>]
def_delegator :internal, :pages
# @return [Thinreports::BasicReport::Layout::Base]
def_delegator :internal, :default_layout
# @param [Hash] options
# @option options [String, nil] :layout (nil)
def initialize(options = {})
@internal = Report::Internal.new(self, options)
@start_page_number = 1
end
# @yield [page]
# @yieldparam [Thinreports::BasicReport::Report::Page] page
# @example
# report.on_page_create do |page|
# page.item(:header_title).value = 'Title'
# end
def on_page_create(&block)
internal.page_create_handler = block
end
# @param [Integer] page_number
def start_page_number_from(page_number)
@start_page_number = page_number
end
# @param [String] layout filename of layout file
# @param [Hash] options
# @option options [Boolean] :default (true)
# @option options [Symbol] :id (nil)
# @example
# report.use_layout '/path/to/default_layout.tlf' # Default layout
# report.use_layout '/path/to/default_layout.tlf', default: true
# report.use_layout '/path/to/other_layout', id: :other_layout
def use_layout(layout, options = {})
internal.register_layout(layout, options)
end
# @example
# page = report.start_new_page
#
# report.start_new_page do |page|
# page.item(:text).value = 'value'
# end
#
# report.use_layout 'foo.tlf', default: true
# report.use_layout 'bar.tlf', id: :bar
#
# report.start_new_page # Use 'foo.tlf'
# report.start_new_page layout: :bar # Use 'bar.tlf'
# report.start_new_page layout: 'boo.tlf' # Use 'boo.tlf'
# @param [Hash] options
# @option options [String, Symbol] :layout (nil)
# @option options [Boolean] :count (true)
# @yield [page]
# @yieldparam [Thinreports::BasicReport::Report::Page] page
# @return [Thinreports::BasicReport::Report::Page]
def start_new_page(options = {}, &block)
layout = internal.load_layout(options.delete(:layout))
raise Thinreports::BasicReport::Errors::NoRegisteredLayoutFound unless layout
page = internal.add_page(Report::Page.new(self, layout, options))
call_block_in(page, &block)
end
# @param [Hash] options
# @option options [Boolean] :count (true)
# @return [Thinreports::BasicReport::Report::BlankPage]
def add_blank_page(options = {})
internal.add_page(Report::BlankPage.new(options[:count]))
end
alias blank_page add_blank_page
# @param [Symbol, nil] id
# @return [Thinreports::BasicReport::Layout::Base]
def layout(id = nil)
if id
internal.layout_registry[id] ||
raise(Thinreports::BasicReport::Errors::UnknownLayoutId)
else
internal.default_layout
end
end
# @param [String] filename
# @param [Hash] security (see http://prawnpdf.org/api-docs/2.0/Prawn/Document/Security.html#encrypt_document-instance_method)
# @param [String] title Value of the title attribute of the PDF document metadata.
# if nil, the title of the default layo
gitextract_0zurrwy2/ ├── .github/ │ ├── CONTRIBUTING.md │ ├── dependabot.yml │ └── workflows/ │ └── test.yml ├── .gitignore ├── CHANGELOG.md ├── Gemfile ├── LICENSE.txt ├── README.md ├── Rakefile ├── fonts/ │ └── IPA_Font_License_Agreement_v1.0.txt ├── gemfiles/ │ ├── prawn-2.4.gemfile │ └── prawn-2.5.gemfile ├── lib/ │ ├── thinreports/ │ │ ├── basic_report/ │ │ │ ├── core/ │ │ │ │ ├── errors.rb │ │ │ │ ├── format/ │ │ │ │ │ └── base.rb │ │ │ │ ├── shape/ │ │ │ │ │ ├── base/ │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ └── internal.rb │ │ │ │ │ ├── base.rb │ │ │ │ │ ├── basic/ │ │ │ │ │ │ ├── block_format.rb │ │ │ │ │ │ ├── block_interface.rb │ │ │ │ │ │ ├── block_internal.rb │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ └── internal.rb │ │ │ │ │ ├── basic.rb │ │ │ │ │ ├── image_block/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ └── internal.rb │ │ │ │ │ ├── image_block.rb │ │ │ │ │ ├── list/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── manager.rb │ │ │ │ │ │ ├── page.rb │ │ │ │ │ │ ├── page_state.rb │ │ │ │ │ │ ├── section_format.rb │ │ │ │ │ │ ├── section_interface.rb │ │ │ │ │ │ └── section_internal.rb │ │ │ │ │ ├── list.rb │ │ │ │ │ ├── manager/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── internal.rb │ │ │ │ │ │ └── target.rb │ │ │ │ │ ├── manager.rb │ │ │ │ │ ├── page_number/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ └── internal.rb │ │ │ │ │ ├── page_number.rb │ │ │ │ │ ├── stack_view/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ ├── internal.rb │ │ │ │ │ │ └── row_format.rb │ │ │ │ │ ├── stack_view.rb │ │ │ │ │ ├── style/ │ │ │ │ │ │ ├── base.rb │ │ │ │ │ │ ├── basic.rb │ │ │ │ │ │ ├── graphic.rb │ │ │ │ │ │ └── text.rb │ │ │ │ │ ├── style.rb │ │ │ │ │ ├── text/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ └── internal.rb │ │ │ │ │ ├── text.rb │ │ │ │ │ ├── text_block/ │ │ │ │ │ │ ├── format.rb │ │ │ │ │ │ ├── formatter/ │ │ │ │ │ │ │ ├── basic.rb │ │ │ │ │ │ │ ├── datetime.rb │ │ │ │ │ │ │ ├── number.rb │ │ │ │ │ │ │ └── padding.rb │ │ │ │ │ │ ├── formatter.rb │ │ │ │ │ │ ├── interface.rb │ │ │ │ │ │ └── internal.rb │ │ │ │ │ └── text_block.rb │ │ │ │ ├── shape.rb │ │ │ │ └── utils.rb │ │ │ ├── generator/ │ │ │ │ ├── pdf/ │ │ │ │ │ ├── document/ │ │ │ │ │ │ ├── draw_shape.rb │ │ │ │ │ │ ├── draw_template_items.rb │ │ │ │ │ │ ├── font.rb │ │ │ │ │ │ ├── graphics/ │ │ │ │ │ │ │ ├── attributes.rb │ │ │ │ │ │ │ ├── basic.rb │ │ │ │ │ │ │ ├── image.rb │ │ │ │ │ │ │ └── text.rb │ │ │ │ │ │ ├── graphics.rb │ │ │ │ │ │ ├── page.rb │ │ │ │ │ │ └── parse_color.rb │ │ │ │ │ ├── document.rb │ │ │ │ │ ├── drawer/ │ │ │ │ │ │ ├── base.rb │ │ │ │ │ │ ├── list.rb │ │ │ │ │ │ ├── list_section.rb │ │ │ │ │ │ └── page.rb │ │ │ │ │ ├── prawn_ext/ │ │ │ │ │ │ ├── calc_image_dimensions.rb │ │ │ │ │ │ └── width_of.rb │ │ │ │ │ └── prawn_ext.rb │ │ │ │ └── pdf.rb │ │ │ ├── layout/ │ │ │ │ ├── base.rb │ │ │ │ ├── format.rb │ │ │ │ ├── legacy_schema.rb │ │ │ │ └── version.rb │ │ │ ├── layout.rb │ │ │ ├── report/ │ │ │ │ ├── base.rb │ │ │ │ ├── internal.rb │ │ │ │ └── page.rb │ │ │ └── report.rb │ │ ├── basic_report.rb │ │ ├── config.rb │ │ ├── section_report/ │ │ │ ├── build.rb │ │ │ ├── builder/ │ │ │ │ ├── item_builder.rb │ │ │ │ ├── report_builder.rb │ │ │ │ ├── report_data.rb │ │ │ │ ├── stack_view_builder.rb │ │ │ │ └── stack_view_data.rb │ │ │ ├── generate.rb │ │ │ ├── pdf/ │ │ │ │ ├── render.rb │ │ │ │ └── renderer/ │ │ │ │ ├── draw_item.rb │ │ │ │ ├── group_renderer.rb │ │ │ │ ├── section_height.rb │ │ │ │ ├── section_renderer.rb │ │ │ │ ├── stack_view_renderer.rb │ │ │ │ └── stack_view_row_renderer.rb │ │ │ └── schema/ │ │ │ ├── loader.rb │ │ │ ├── parser.rb │ │ │ ├── report.rb │ │ │ └── section.rb │ │ ├── section_report.rb │ │ └── version.rb │ └── thinreports.rb ├── test/ │ ├── basic_report/ │ │ ├── data/ │ │ │ ├── image_normal_jpg_noext │ │ │ ├── image_normal_png_noext │ │ │ └── legacy_layout/ │ │ │ └── all-items.tlf │ │ ├── features/ │ │ │ ├── dynamic_style/ │ │ │ │ ├── templates/ │ │ │ │ │ ├── styles.tlf │ │ │ │ │ └── styles_in_list.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── eudc/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── graphics/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── hidden_item/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── image_block/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── list_events/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── list_manually/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── page_number/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── page_number_with_list/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── palleted_png/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── report_callbacks/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_align/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_block_formatting/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_block_overflow/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_block_singleline/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_block_style/ │ │ │ │ ├── templates/ │ │ │ │ │ ├── basic_styles.tlf │ │ │ │ │ └── font_size.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_character_spacing/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ ├── text_overflow_wrap/ │ │ │ │ ├── template.tlf │ │ │ │ └── test_feature.rb │ │ │ └── text_word_wrap/ │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── schema_helper.rb │ │ ├── test_helper.rb │ │ └── units/ │ │ ├── core/ │ │ │ ├── format/ │ │ │ │ └── test_base.rb │ │ │ ├── shape/ │ │ │ │ ├── base/ │ │ │ │ │ └── test_internal.rb │ │ │ │ ├── basic/ │ │ │ │ │ ├── test_block_format.rb │ │ │ │ │ ├── test_block_interface.rb │ │ │ │ │ ├── test_block_internal.rb │ │ │ │ │ ├── test_format.rb │ │ │ │ │ ├── test_interface.rb │ │ │ │ │ └── test_internal.rb │ │ │ │ ├── image_block/ │ │ │ │ │ ├── test_interface.rb │ │ │ │ │ └── test_internal.rb │ │ │ │ ├── list/ │ │ │ │ │ ├── test_format.rb │ │ │ │ │ ├── test_manager.rb │ │ │ │ │ ├── test_page.rb │ │ │ │ │ ├── test_page_state.rb │ │ │ │ │ ├── test_section_format.rb │ │ │ │ │ ├── test_section_interface.rb │ │ │ │ │ └── test_section_internal.rb │ │ │ │ ├── manager/ │ │ │ │ │ ├── test_format.rb │ │ │ │ │ ├── test_internal.rb │ │ │ │ │ └── test_target.rb │ │ │ │ ├── page_number/ │ │ │ │ │ ├── test_format.rb │ │ │ │ │ ├── test_interface.rb │ │ │ │ │ └── test_internal.rb │ │ │ │ ├── styles/ │ │ │ │ │ ├── test_base.rb │ │ │ │ │ ├── test_basic.rb │ │ │ │ │ ├── test_graphic.rb │ │ │ │ │ └── test_text.rb │ │ │ │ ├── text/ │ │ │ │ │ ├── test_format.rb │ │ │ │ │ └── test_internal.rb │ │ │ │ └── text_block/ │ │ │ │ ├── formatter/ │ │ │ │ │ ├── test_basic.rb │ │ │ │ │ ├── test_datetime.rb │ │ │ │ │ ├── test_number.rb │ │ │ │ │ └── test_padding.rb │ │ │ │ ├── test_format.rb │ │ │ │ ├── test_formatter.rb │ │ │ │ ├── test_interface.rb │ │ │ │ └── test_internal.rb │ │ │ ├── test_shape.rb │ │ │ └── test_utils.rb │ │ ├── generator/ │ │ │ ├── pdf/ │ │ │ │ ├── document/ │ │ │ │ │ ├── graphics/ │ │ │ │ │ │ ├── test_attributes.rb │ │ │ │ │ │ ├── test_basic.rb │ │ │ │ │ │ ├── test_image.rb │ │ │ │ │ │ └── test_text.rb │ │ │ │ │ ├── test_font.rb │ │ │ │ │ ├── test_graphics.rb │ │ │ │ │ ├── test_page.rb │ │ │ │ │ └── test_parse_color.rb │ │ │ │ ├── prawn_ext/ │ │ │ │ │ ├── test_calc_image_dimensions.rb │ │ │ │ │ └── test_width_of.rb │ │ │ │ └── test_document.rb │ │ │ └── test_pdf.rb │ │ ├── layout/ │ │ │ ├── test_base.rb │ │ │ ├── test_format.rb │ │ │ ├── test_legacy_schema.rb │ │ │ └── test_version.rb │ │ ├── report/ │ │ │ ├── test_base.rb │ │ │ └── test_internal.rb │ │ ├── test_layout.rb │ │ └── test_report.rb │ ├── feature_test.rb │ ├── main/ │ │ ├── test_config.rb │ │ └── test_helper.rb │ └── section_report/ │ ├── features/ │ │ ├── basic/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── item_follow_stretch/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── item_parameters/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── multiple_groups/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── nonexistent_id/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── section_auto_stretch/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── section_bottom_margin/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── section_parameters/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── stack_view/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── stack_view_row_auto_stretch/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── stack_view_row_bottom_margin/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── stack_view_row_parameters/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ ├── stack_view_with_floating_item/ │ │ │ ├── README.md │ │ │ ├── template.tlf │ │ │ └── test_feature.rb │ │ └── text_block_vertical_align/ │ │ ├── README.md │ │ ├── template.tlf │ │ └── test_feature.rb │ └── test_helper.rb └── thinreports.gemspec
SYMBOL INDEX (1586 symbols across 200 files)
FILE: lib/thinreports.rb
type Thinreports (line 5) | module Thinreports
function root (line 6) | def self.root
FILE: lib/thinreports/basic_report.rb
type Thinreports (line 12) | module Thinreports
FILE: lib/thinreports/basic_report/core/errors.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Errors (line 5) | module Errors
class Basic (line 6) | class Basic < ::StandardError
class UnknownShapeStyleName (line 9) | class UnknownShapeStyleName < Basic
method initialize (line 10) | def initialize(style, availables)
class UnknownShapeType (line 16) | class UnknownShapeType < Basic
class UnknownFormatterType (line 19) | class UnknownFormatterType < Basic
class LayoutFileNotFound (line 22) | class LayoutFileNotFound < Basic
class FontFileNotFound (line 25) | class FontFileNotFound < Basic
class NoRegisteredLayoutFound (line 28) | class NoRegisteredLayoutFound < Basic
class UnknownItemId (line 31) | class UnknownItemId < Basic
method initialize (line 32) | def initialize(id, item_type = 'Basic')
class DisabledListSection (line 37) | class DisabledListSection < Basic
method initialize (line 38) | def initialize(section)
class UnknownLayoutId (line 43) | class UnknownLayoutId < Basic
class UnsupportedColorName (line 46) | class UnsupportedColorName < Basic
class InvalidLayoutFormat (line 49) | class InvalidLayoutFormat < Basic
class IncompatibleLayoutFormat (line 52) | class IncompatibleLayoutFormat < Basic
method initialize (line 53) | def initialize(filename, fileversion, required_rules)
FILE: lib/thinreports/basic_report/core/format/base.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Format (line 6) | module Format
class Base (line 8) | class Base
method config_reader (line 10) | def config_reader(*configs, &block)
method config_checker (line 16) | def config_checker(check, *configs)
method config_writer (line 23) | def config_writer(*configs)
method config_accessor (line 29) | def config_accessor(*configs, &block)
method define_read_method (line 36) | def define_read_method(m, location = nil, &block)
method define_write_method (line 42) | def define_write_method(m, location = nil)
method each_configs (line 48) | def each_configs(*configs, &block)
method initialize (line 56) | def initialize(config, &block)
method attributes (line 61) | def attributes
method find (line 67) | def find(*keys)
method write (line 77) | def write(value, *keys)
method read (line 83) | def read(*keys, &block)
FILE: lib/thinreports/basic_report/core/shape.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
function Interface (line 7) | def Interface(parent, format)
function Format (line 11) | def Format(type)
function find_by_type (line 17) | def self.find_by_type(type)
FILE: lib/thinreports/basic_report/core/shape/base/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Base (line 7) | module Base
class Interface (line 9) | class Interface
method internal_delegators (line 13) | def self.internal_delegators(*args)
method initialize (line 20) | def initialize(parent, format, internal = nil)
method copy (line 24) | def copy(parent)
method init_internal (line 34) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/base/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Base (line 7) | module Base
class Internal (line 9) | class Internal
method format_delegators (line 13) | def self.format_delegators(*args)
method initialize (line 23) | def initialize(parent, format)
method style (line 32) | def style
method copy (line 36) | def copy(new_parent, &block)
method type_of? (line 45) | def type_of?
FILE: lib/thinreports/basic_report/core/shape/basic.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
FILE: lib/thinreports/basic_report/core/shape/basic/block_format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
class BlockFormat (line 8) | class BlockFormat < Basic::Format
FILE: lib/thinreports/basic_report/core/shape/basic/block_interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
class BlockInterface (line 8) | class BlockInterface < Basic::Interface
method value (line 16) | def value(*args)
method value= (line 26) | def value=(val)
FILE: lib/thinreports/basic_report/core/shape/basic/block_internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
class BlockInternal (line 8) | class BlockInternal < Basic::Internal
method style (line 11) | def style
method read_value (line 15) | def read_value
method write_value (line 20) | def write_value(val)
method real_value (line 24) | def real_value
method type_of? (line 28) | def type_of?(type_name)
FILE: lib/thinreports/basic_report/core/shape/basic/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
class Format (line 8) | class Format < Core::Format::Base
method affect_bottom_margin? (line 16) | def affect_bottom_margin?
FILE: lib/thinreports/basic_report/core/shape/basic/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
class Interface (line 8) | class Interface < Base::Interface
method id (line 12) | def id
method visible (line 18) | def visible(visibility)
method visible? (line 24) | def visible?
method style (line 40) | def style(*args)
method styles (line 57) | def styles(settings)
method hide (line 64) | def hide
method show (line 71) | def show
method init_internal (line 79) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/basic/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Basic (line 7) | module Basic
class Internal (line 8) | class Internal < Base::Internal
method style (line 12) | def style
method type_of? (line 16) | def type_of?(type_name)
method identifier (line 20) | def identifier
FILE: lib/thinreports/basic_report/core/shape/image_block.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type ImageBlock (line 7) | module ImageBlock
FILE: lib/thinreports/basic_report/core/shape/image_block/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type ImageBlock (line 7) | module ImageBlock
class Format (line 8) | class Format < Basic::BlockFormat
FILE: lib/thinreports/basic_report/core/shape/image_block/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type ImageBlock (line 7) | module ImageBlock
class Interface (line 8) | class Interface < Basic::BlockInterface
method init_internal (line 17) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/image_block/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type ImageBlock (line 7) | module ImageBlock
class Internal (line 8) | class Internal < Basic::BlockInternal
method type_of? (line 11) | def type_of?(type_name)
FILE: lib/thinreports/basic_report/core/shape/list.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
FILE: lib/thinreports/basic_report/core/shape/list/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class Format (line 8) | class Format < Basic::Format
method initialize (line 30) | def initialize(*)
method section (line 38) | def section(section_name)
method has_section? (line 44) | def has_section?(section_name)
method section_height (line 50) | def section_height(section_name)
method section_base_position_top (line 56) | def section_base_position_top(section_name)
method initialize_sections (line 74) | def initialize_sections
method section_format (line 84) | def section_format(section_name)
FILE: lib/thinreports/basic_report/core/shape/list/manager.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class Manager (line 8) | class Manager
method initialize (line 30) | def initialize(page)
method switch_current! (line 43) | def switch_current!(page)
method change_new_page (line 51) | def change_new_page(&block)
method build_header (line 63) | def build_header(values = {}, &block)
method header_section (line 71) | def header_section
method add_detail (line 77) | def add_detail(values = {}, &block)
method insert_detail (line 101) | def insert_detail(values = {}, &block)
method insert_row (line 108) | def insert_row(row)
method build_section (line 121) | def build_section(section, values = {}, &block)
method init_section (line 128) | def init_section(section_name)
method overflow_with? (line 136) | def overflow_with?(section_name = :detail)
method page_max_height (line 146) | def page_max_height
method auto_page_break? (line 156) | def auto_page_break?
method finalize_page (line 163) | def finalize_page(options = {})
method finalize_page_footer (line 177) | def finalize_page_footer
method finalize (line 186) | def finalize
method finalized? (line 208) | def finalized?
method report (line 213) | def report
method layout (line 218) | def layout
method format (line 223) | def format
FILE: lib/thinreports/basic_report/core/shape/list/page.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class Page (line 8) | class Page < Basic::Interface
method initialize (line 17) | def initialize(parent, format, internal = nil, manager = nil)
method on_page_finalize (line 34) | def on_page_finalize(&block)
method on_page_footer_insert (line 40) | def on_page_footer_insert(&block)
method on_footer_insert (line 47) | def on_footer_insert(&block)
method add_row (line 55) | def add_row(values = {}, &block)
method page_break (line 61) | def page_break
method overflow? (line 72) | def overflow?
method copy (line 78) | def copy(new_parent)
method init_internal (line 100) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/list/page_state.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class PageState (line 8) | class PageState < Basic::Internal
method initialize (line 16) | def initialize(*args)
method style (line 26) | def style
method finalized? (line 30) | def finalized?
method finalized! (line 34) | def finalized!
method type_of? (line 38) | def type_of?(type_name)
FILE: lib/thinreports/basic_report/core/shape/list/section_format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class SectionFormat (line 8) | class SectionFormat < Shape::Manager::Format
method initialize (line 17) | def initialize(*)
method initialize_items (line 24) | def initialize_items(item_schemas)
FILE: lib/thinreports/basic_report/core/shape/list/section_interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class SectionInterface (line 8) | class SectionInterface < Base::Interface
method initialize (line 17) | def initialize(parent, format, section_name)
method copy (line 28) | def copy(parent)
method init_internal (line 43) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/list/section_internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type List (line 7) | module List
class SectionInternal (line 8) | class SectionInternal < Base::Internal
method style (line 15) | def style
method move_top_to (line 20) | def move_top_to(ry)
method relative_top (line 25) | def relative_top
FILE: lib/thinreports/basic_report/core/shape/manager/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Manager (line 7) | module Manager
class Format (line 8) | class Format < Core::Format::Base
method initialize (line 12) | def initialize(config, id = nil, &block)
method find_shape (line 17) | def find_shape(id)
method has_shape? (line 21) | def has_shape?(id)
method shapes (line 25) | def shapes
FILE: lib/thinreports/basic_report/core/shape/manager/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Manager (line 7) | module Manager
class Internal (line 8) | class Internal
method initialize (line 17) | def initialize(format, init_item_handler)
method find_format (line 26) | def find_format(id)
method find_item (line 32) | def find_item(id, limit = {})
method final_shape (line 51) | def final_shape(id)
method init_item (line 84) | def init_item(format)
method valid_type? (line 93) | def valid_type?(type, limit = {})
FILE: lib/thinreports/basic_report/core/shape/manager/target.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Manager (line 7) | module Manager
type Target (line 8) | module Target
function item (line 32) | def item(id, &block)
function [] (line 48) | def [](id)
function []= (line 60) | def []=(id, value)
function values (line 68) | def values(item_values)
function item_exists? (line 74) | def item_exists?(id)
function list (line 87) | def list(id = nil, &block)
function initialize_manager (line 101) | def initialize_manager(format, &block)
function find_item (line 106) | def find_item(id, limit = {})
FILE: lib/thinreports/basic_report/core/shape/page_number.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type PageNumber (line 7) | module PageNumber
FILE: lib/thinreports/basic_report/core/shape/page_number/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type PageNumber (line 7) | module PageNumber
class Format (line 8) | class Format < Basic::Format
method id (line 15) | def id
method for_report? (line 19) | def for_report?
method next_default_id (line 23) | def self.next_default_id
FILE: lib/thinreports/basic_report/core/shape/page_number/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type PageNumber (line 7) | module PageNumber
class Interface (line 8) | class Interface < Basic::Interface
method format (line 11) | def format(*args)
method init_internal (line 23) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/page_number/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type PageNumber (line 7) | module PageNumber
class Internal (line 8) | class Internal < Basic::Internal
method read_format (line 11) | def read_format
method reset_format (line 15) | def reset_format
method write_format (line 19) | def write_format(format)
method build_format (line 23) | def build_format(page_no, page_count)
method style (line 37) | def style
method type_of? (line 41) | def type_of?(type_name)
method start_page_number (line 45) | def start_page_number
class Style (line 50) | class Style < Style::Text
FILE: lib/thinreports/basic_report/core/shape/stack_view.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type StackView (line 7) | module StackView
FILE: lib/thinreports/basic_report/core/shape/stack_view/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type StackView (line 7) | module StackView
class Format (line 8) | class Format < Basic::Format
method initialize (line 11) | def initialize(*)
method initialize_rows (line 18) | def initialize_rows
FILE: lib/thinreports/basic_report/core/shape/stack_view/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type StackView (line 7) | module StackView
class Interface (line 8) | class Interface < Basic::Interface
method init_internal (line 11) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/stack_view/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type StackView (line 7) | module StackView
class Internal (line 8) | class Internal < Basic::Internal
method initialize (line 9) | def initialize(parent, format)
method type_of? (line 16) | def type_of?(type_name)
FILE: lib/thinreports/basic_report/core/shape/stack_view/row_format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type StackView (line 7) | module StackView
class RowFormat (line 8) | class RowFormat < Core::Format::Base
method initialize (line 16) | def initialize(*)
method find_item (line 23) | def find_item(id)
method initialize_items (line 29) | def initialize_items(item_schemas)
FILE: lib/thinreports/basic_report/core/shape/style/base.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Style (line 7) | module Style
class Base (line 8) | class Base
method style_accessor (line 15) | def style_accessor(style_method, style)
method style_reader (line 21) | def style_reader(style_method, style)
method style_writer (line 28) | def style_writer(style_method, style)
method style_accessible (line 35) | def style_accessible(*style_methods)
method accessible_styles (line 40) | def accessible_styles
method inherited (line 44) | def inherited(s)
method initialize (line 56) | def initialize(format, default_styles = {})
method [] (line 66) | def [](style_method)
method []= (line 73) | def []=(style_method, value)
method identifier (line 79) | def identifier
method copy (line 84) | def copy
method read_internal_style (line 90) | def read_internal_style(style)
method write_internal_style (line 97) | def write_internal_style(style, value)
method has_style? (line 103) | def has_style?(style_method)
method finalized_styles (line 108) | def finalized_styles
method create_identifier (line 121) | def create_identifier(s)
method verify_style_method (line 127) | def verify_style_method(style_method)
method verify_style_value (line 140) | def verify_style_value(value, allows, msg = nil)
FILE: lib/thinreports/basic_report/core/shape/style/basic.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Style (line 7) | module Style
class Basic (line 8) | class Basic < Style::Base
method initialize (line 15) | def initialize(*args)
FILE: lib/thinreports/basic_report/core/shape/style/graphic.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Style (line 7) | module Style
class Graphic (line 8) | class Graphic < Style::Basic
method border (line 28) | def border
method border= (line 33) | def border=(width_and_color)
FILE: lib/thinreports/basic_report/core/shape/style/text.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Style (line 7) | module Style
class Text (line 8) | class Text < Style::Basic
method initialize (line 24) | def initialize(*)
method bold (line 30) | def bold
method bold= (line 35) | def bold=(enable)
method italic (line 40) | def italic
method italic= (line 45) | def italic=(enable)
method underline (line 50) | def underline
method underline= (line 55) | def underline=(enable)
method linethrough (line 60) | def linethrough
method linethrough= (line 65) | def linethrough=(enable)
method align (line 70) | def align
method align= (line 75) | def align=(align_name)
method valign (line 82) | def valign
method valign= (line 88) | def valign=(valign_name)
method initialize_font_style (line 106) | def initialize_font_style
method write_font_style (line 110) | def write_font_style(style_name, enable)
FILE: lib/thinreports/basic_report/core/shape/text.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Text (line 7) | module Text
FILE: lib/thinreports/basic_report/core/shape/text/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Text (line 7) | module Text
class Format (line 8) | class Format < Basic::Format
FILE: lib/thinreports/basic_report/core/shape/text/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Text (line 7) | module Text
class Interface (line 8) | class Interface < Basic::Interface
method init_internal (line 12) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/text/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type Text (line 7) | module Text
class Internal (line 8) | class Internal < Basic::Internal
method style (line 12) | def style
method type_of? (line 16) | def type_of?(type_name)
FILE: lib/thinreports/basic_report/core/shape/text_block.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
FILE: lib/thinreports/basic_report/core/shape/text_block/format.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
class Format (line 8) | class Format < Basic::BlockFormat
method has_reference? (line 35) | def has_reference?
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
type Formatter (line 8) | module Formatter
function setup (line 13) | def self.setup(format)
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/basic.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
type Formatter (line 8) | module Formatter
class Basic (line 9) | class Basic
method initialize (line 14) | def initialize(format)
method apply (line 18) | def apply(value)
method apply_format_to (line 28) | def apply_format_to(value)
method applicable? (line 32) | def applicable?(_value)
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/datetime.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
type Formatter (line 8) | module Formatter
class Datetime (line 9) | class Datetime < Formatter::Basic
method apply_format_to (line 12) | def apply_format_to(value)
method applicable? (line 16) | def applicable?(value)
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/number.rb
type Thinreports (line 5) | module Thinreports
type BasicReport (line 6) | module BasicReport
type Core (line 7) | module Core
type Shape (line 8) | module Shape
type TextBlock (line 9) | module TextBlock
type Formatter (line 10) | module Formatter
class Number (line 11) | class Number < Formatter::Basic
method apply_format_to (line 14) | def apply_format_to(value)
method if_applicable (line 25) | def if_applicable(value, &block)
method normalize (line 30) | def normalize(value)
method number_with_delimiter (line 38) | def number_with_delimiter(value, delimiter = ',')
method number_with_precision (line 47) | def number_with_precision(value, precision = 3)
method convert_to_integer (line 52) | def convert_to_integer(value)
method convert_to_float (line 58) | def convert_to_float(value)
FILE: lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
type Formatter (line 8) | module Formatter
class Padding (line 9) | class Padding < Formatter::Basic
method apply_format_to (line 12) | def apply_format_to(value)
method applicable? (line 18) | def applicable?(_value)
FILE: lib/thinreports/basic_report/core/shape/text_block/interface.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
class Interface (line 8) | class Interface < Basic::BlockInterface
method format_enabled (line 13) | def format_enabled(enabled)
method set (line 21) | def set(val, style_settings = {})
method init_internal (line 29) | def init_internal(parent, format)
FILE: lib/thinreports/basic_report/core/shape/text_block/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Core (line 5) | module Core
type Shape (line 6) | module Shape
type TextBlock (line 7) | module TextBlock
class Internal (line 8) | class Internal < Basic::BlockInternal
method initialize (line 13) | def initialize(*args)
method read_value (line 23) | def read_value
method write_value (line 32) | def write_value(val)
method real_value (line 41) | def real_value
method format_enabled (line 49) | def format_enabled(enabled)
method format_enabled? (line 53) | def format_enabled?
method type_of? (line 61) | def type_of?(type_name)
method formatter (line 67) | def formatter
FILE: lib/thinreports/basic_report/core/utils.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Utils (line 5) | module Utils
function included (line 6) | def self.included(klass)
function deep_copy (line 10) | def deep_copy(src)
function blank_value? (line 25) | def blank_value?(value)
function call_block_in (line 33) | def call_block_in(scope, &block)
FILE: lib/thinreports/basic_report/generator/pdf.rb
type Thinreports (line 8) | module Thinreports
type BasicReport (line 9) | module BasicReport
type Generator (line 10) | module Generator
class PDF (line 11) | class PDF
method initialize (line 18) | def initialize(report, security: nil, title: nil)
method generate (line 30) | def generate(filename = nil)
method default_layout (line 35) | def default_layout
method draw_report (line 41) | def draw_report
method draw_page (line 47) | def draw_page(page)
method drawer (line 56) | def drawer(format)
FILE: lib/thinreports/basic_report/generator/pdf/document.rb
type Thinreports (line 10) | module Thinreports
type BasicReport (line 11) | module BasicReport
type Generator (line 12) | module Generator
class PDF (line 13) | class PDF
class Document (line 14) | class Document
method initialize (line 29) | def initialize(title: nil, security: nil)
method render (line 49) | def render
method render_file (line 57) | def render_file(*args)
method translate (line 64) | def translate(x, y, &block)
method stamp (line 71) | def stamp(stamp_id, at = nil)
method create_stamp (line 82) | def create_stamp(id, &block)
method internal (line 87) | def internal
method finalize (line 93) | def finalize
method s2f (line 99) | def s2f(*values)
method map_to_upper_left_relative_position (line 114) | def map_to_upper_left_relative_position(x, y)
method map_to_upper_left_position (line 123) | def map_to_upper_left_position(x, y)
FILE: lib/thinreports/basic_report/generator/pdf/document/draw_shape.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type DrawShape (line 7) | module DrawShape
function draw_shape_tblock (line 12) | def draw_shape_tblock(shape, height: nil, overflow: nil, &block)
function draw_shape_pageno (line 31) | def draw_shape_pageno(shape, page_no, page_count)
function draw_shape_image (line 39) | def draw_shape_image(shape)
function draw_shape_iblock (line 47) | def draw_shape_iblock(shape)
function shape_iblock_dimenions (line 62) | def shape_iblock_dimenions(shape)
function draw_shape_text (line 76) | def draw_shape_text(shape, dheight = 0)
function draw_shape_ellipse (line 85) | def draw_shape_ellipse(shape)
function draw_shape_line (line 91) | def draw_shape_line(shape, dy1 = 0, dy2 = 0)
function draw_shape_rect (line 97) | def draw_shape_rect(shape, dheight = 0)
FILE: lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type DrawTemplateItems (line 7) | module DrawTemplateItems
function draw_template_items (line 9) | def draw_template_items(items)
function draw_rect (line 26) | def draw_rect(item_attributes)
function draw_ellipse (line 36) | def draw_ellipse(item_attributes)
function draw_line (line 42) | def draw_line(item_attributes)
function draw_text (line 48) | def draw_text(item_attributes)
function draw_image (line 57) | def draw_image(item_attributes)
function drawable? (line 64) | def drawable?(item_attributes)
FILE: lib/thinreports/basic_report/generator/pdf/document/font.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Font (line 7) | module Font
function setup_fonts (line 24) | def setup_fonts
function install_font (line 52) | def install_font(name, file)
function default_family (line 65) | def default_family
function default_family_if_missing (line 71) | def default_family_if_missing(family)
function font_has_style? (line 78) | def font_has_style?(font_name, font_style)
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Graphics (line 7) | module Graphics
function setup_custom_graphic_states (line 13) | def setup_custom_graphic_states
function line_width (line 18) | def line_width(width)
function save_graphics_state (line 24) | def save_graphics_state
function restore_graphics_state (line 30) | def restore_graphics_state
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/attributes.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Graphics (line 7) | module Graphics
function build_graphic_attributes (line 12) | def build_graphic_attributes(style, &block)
function build_text_attributes (line 27) | def build_text_attributes(style, &block)
function overflow_wrap (line 48) | def overflow_wrap(style, computed_word_wrap)
function migrate_overflow_wrap_from_word_wrap (line 58) | def migrate_overflow_wrap_from_word_wrap(computed_word_wrap)
function font_family (line 68) | def font_family(font_names)
function font_styles (line 75) | def font_styles(styles)
function letter_spacing (line 88) | def letter_spacing(spacing)
function text_align (line 94) | def text_align(align)
function text_valign (line 106) | def text_valign(valign)
function text_overflow (line 118) | def text_overflow(overflow)
function word_wrap (line 130) | def word_wrap(word_wrap)
function line_height (line 140) | def line_height(height)
function image_position_x (line 146) | def image_position_x(position)
function image_position_y (line 158) | def image_position_y(position)
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/basic.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Graphics (line 7) | module Graphics
function line (line 21) | def line(x1, y1, x2, y2, attrs = {})
function rect (line 37) | def rect(x, y, w, h, attrs = {})
function ellipse (line 60) | def ellipse(x, y, rx, ry, attrs = {})
function with_graphic_styles (line 69) | def with_graphic_styles(attrs, &block)
function build_stroke_styles (line 112) | def build_stroke_styles(styles)
function build_fill_styles (line 127) | def build_fill_styles(styles)
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/image.rb
type Thinreports (line 7) | module Thinreports
type BasicReport (line 8) | module BasicReport
type Generator (line 9) | module Generator
class PDF (line 10) | class PDF
type Graphics (line 11) | module Graphics
function image (line 17) | def image(filename_or_io, x, y, w, h)
function base64image (line 27) | def base64image(base64_data, x, y, w, h)
function image_box (line 45) | def image_box(filename_or_io, x, y, w, h, options = {})
function image_dimensions (line 62) | def image_dimensions(filename_or_io, x, y, w, h, options = {})
function clean_temp_images (line 73) | def clean_temp_images
function temp_image_registry (line 78) | def temp_image_registry
function create_temp_imagefile (line 85) | def create_temp_imagefile(image_id, image_data)
FILE: lib/thinreports/basic_report/generator/pdf/document/graphics/text.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Graphics (line 7) | module Graphics
function text_box (line 27) | def text_box(content, x, y, w, h, attrs = {}, &block)
function text (line 58) | def text(content, x, y, w, h, attrs = {})
function text_box_attrs (line 73) | def text_box_attrs(x, y, w, h, states = {})
function with_text_styles (line 89) | def with_text_styles(attrs, &block)
function text_line_leading (line 134) | def text_line_leading(line_height, font)
function replace_space_to_nbsp (line 140) | def replace_space_to_nbsp(content)
function with_font_styles (line 152) | def with_font_styles(attrs, font, &block)
FILE: lib/thinreports/basic_report/generator/pdf/document/page.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Page (line 7) | module Page
function start_new_page (line 14) | def start_new_page(format)
function start_new_page_for_section_report (line 30) | def start_new_page_for_section_report(format)
function max_content_height (line 38) | def max_content_height
function add_blank_page (line 42) | def add_blank_page
function change_page_format? (line 53) | def change_page_format?(new_format)
function create_format_stamp (line 59) | def create_format_stamp(format)
function format_stamp_registry (line 67) | def format_stamp_registry
function new_basic_page_options (line 73) | def new_basic_page_options(format)
FILE: lib/thinreports/basic_report/generator/pdf/document/parse_color.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type ParseColor (line 7) | module ParseColor
function parse_color (line 10) | def parse_color(color)
function find_color_from_name (line 42) | def find_color_from_name(name)
FILE: lib/thinreports/basic_report/generator/pdf/drawer/base.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Drawer (line 7) | module Drawer
class Base (line 9) | class Base
method initialize (line 12) | def initialize(pdf, format)
method draw (line 20) | def draw
method pdf_stamp_id (line 28) | def pdf_stamp_id(shape)
method pdf_stamp (line 36) | def pdf_stamp(shape)
method create_pdf_stamp (line 42) | def create_pdf_stamp(shape, &block)
FILE: lib/thinreports/basic_report/generator/pdf/drawer/list.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Drawer (line 7) | module Drawer
class List (line 8) | class List < Base
method initialize (line 10) | def initialize(pdf, format)
method draw (line 16) | def draw(list_page)
method list_pageno? (line 40) | def list_pageno?(list_id, shape)
method draw_section (line 46) | def draw_section(section)
method drawer (line 57) | def drawer(section)
FILE: lib/thinreports/basic_report/generator/pdf/drawer/list_section.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Drawer (line 7) | module Drawer
class ListSection (line 8) | class ListSection < Page
method initialize (line 11) | def initialize(pdf, section)
method draw (line 19) | def draw(section, at)
method draw_section (line 27) | def draw_section
method draw_tblock_shape (line 38) | def draw_tblock_shape(shape)
method draw_iblock_shape (line 43) | def draw_iblock_shape(shape)
FILE: lib/thinreports/basic_report/generator/pdf/drawer/page.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
class PDF (line 6) | class PDF
type Drawer (line 7) | module Drawer
class Page (line 8) | class Page < Base
method initialize (line 10) | def initialize(pdf, format)
method draw (line 16) | def draw(page)
method draw_shape (line 36) | def draw_shape(shape)
method draw_pageno_shape (line 53) | def draw_pageno_shape(shape, page)
method draw_list_shape (line 58) | def draw_list_shape(shape)
method draw_tblock_shape (line 64) | def draw_tblock_shape(shape)
method draw_iblock_shape (line 69) | def draw_iblock_shape(shape)
method create_basic_shape_stamp (line 74) | def create_basic_shape_stamp(shape)
method create_image_stamp (line 89) | def create_image_stamp(shape)
method create_rect_stamp (line 96) | def create_rect_stamp(shape)
method create_ellipse_stamp (line 103) | def create_ellipse_stamp(shape)
method create_line_stamp (line 110) | def create_line_stamp(shape)
method create_text_stamp (line 117) | def create_text_stamp(shape)
FILE: lib/thinreports/basic_report/generator/pdf/prawn_ext/calc_image_dimensions.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
type PrawnExt (line 6) | module PrawnExt
type CalcImageDimensions (line 7) | module CalcImageDimensions
function calc_image_dimensions (line 17) | def calc_image_dimensions(options)
FILE: lib/thinreports/basic_report/generator/pdf/prawn_ext/width_of.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Generator (line 5) | module Generator
type PrawnExt (line 6) | module PrawnExt
type WidthOf (line 7) | module WidthOf
function width_of (line 18) | def width_of(*)
FILE: lib/thinreports/basic_report/layout.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Layout (line 5) | module Layout
function new (line 7) | def self.new(filename, options = {})
FILE: lib/thinreports/basic_report/layout/base.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Layout (line 5) | module Layout
class Base (line 6) | class Base
method load_format (line 15) | def load_format(filename)
method initialize (line 35) | def initialize(filename, options = {})
method default? (line 42) | def default?
FILE: lib/thinreports/basic_report/layout/format.rb
type Thinreports (line 5) | module Thinreports
type BasicReport (line 6) | module BasicReport
type Layout (line 7) | module Layout
class Format (line 8) | class Format < Core::Shape::Manager::Format
method build (line 17) | def build(filename)
method read_file (line 38) | def read_file(filename)
method initialize (line 43) | def initialize(*)
method user_paper_type? (line 48) | def user_paper_type?
method initialize_items (line 54) | def initialize_items(item_schemas)
FILE: lib/thinreports/basic_report/layout/legacy_schema.rb
type Thinreports (line 6) | module Thinreports
type BasicReport (line 7) | module BasicReport
type Layout (line 8) | module Layout
class LegacySchema (line 9) | class LegacySchema
method initialize (line 12) | def initialize(legacy_schema)
method upgrade (line 20) | def upgrade
method item_schemas (line 45) | def item_schemas
method build_item_schemas_from_svg (line 50) | def build_item_schemas_from_svg(svg_elements)
method text_item_schema (line 76) | def text_item_schema(attributes, texts)
method rect_item_schema (line 99) | def rect_item_schema(attributes)
method line_item_schema (line 118) | def line_item_schema(attributes)
method ellipse_item_schema (line 135) | def ellipse_item_schema(attributes)
method image_item_schema (line 153) | def image_item_schema(attributes)
method page_number_item_schema (line 171) | def page_number_item_schema(attributes)
method image_block_item_schema (line 193) | def image_block_item_schema(attributes)
method text_block_item_schema (line 209) | def text_block_item_schema(attributes)
method list_item_schema (line 259) | def list_item_schema(legacy_element)
method list_section_schema (line 288) | def list_section_schema(section_name, legacy_list_element, legac...
method extract_texts_from (line 309) | def extract_texts_from(text_item_element)
method image_position_y (line 315) | def image_position_y(legacy_position_y)
method display (line 323) | def display(legacy_display)
method font_style (line 327) | def font_style(attributes)
method text_align (line 336) | def text_align(legacy_text_align)
method vertical_align (line 345) | def vertical_align(legacy_vertical_align)
method line_height (line 356) | def line_height(legacy_line_height)
method letter_spacing (line 360) | def letter_spacing(legacy_letter_spacing)
method extract_legacy_item_schemas (line 367) | def extract_legacy_item_schemas(svg)
method cleanup_svg (line 376) | def cleanup_svg(svg)
FILE: lib/thinreports/basic_report/layout/version.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Layout (line 5) | module Layout
class Version (line 6) | class Version
method compatible_rules (line 11) | def compatible_rules
method initialize (line 16) | def initialize(schema_version)
method compatible? (line 20) | def compatible?
method legacy? (line 27) | def legacy?
method normalize_version (line 35) | def normalize_version(version)
FILE: lib/thinreports/basic_report/report.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Report (line 5) | module Report
function new (line 7) | def self.new(*args)
function create (line 12) | def self.create(*args, &block)
function generate (line 17) | def self.generate(**args, &block)
FILE: lib/thinreports/basic_report/report/base.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Report (line 5) | module Report
class Base (line 6) | class Base
method create (line 16) | def create(options = {}, &block)
method generate (line 35) | def generate(layout: nil, filename: nil, security: nil, title: n...
method initialize (line 72) | def initialize(options = {})
method on_page_create (line 83) | def on_page_create(&block)
method start_page_number_from (line 88) | def start_page_number_from(page_number)
method use_layout (line 100) | def use_layout(layout, options = {})
method start_new_page (line 123) | def start_new_page(options = {}, &block)
method add_blank_page (line 135) | def add_blank_page(options = {})
method layout (line 142) | def layout(id = nil)
method generate (line 160) | def generate(filename: nil, security: nil, title: nil)
method list (line 165) | def list(id = nil, &block)
FILE: lib/thinreports/basic_report/report/internal.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Report (line 5) | module Report
class Internal (line 6) | class Internal
method initialize (line 17) | def initialize(report, options)
method register_layout (line 31) | def register_layout(layout, options = {})
method add_page (line 42) | def add_page(new_page)
method copy_page (line 47) | def copy_page
method finalize (line 52) | def finalize
method finalized? (line 59) | def finalized?
method load_layout (line 63) | def load_layout(id_or_filename)
method insert_page (line 82) | def insert_page(new_page)
method finalize_current_page (line 95) | def finalize_current_page(options = {})
method init_layout (line 99) | def init_layout(filename, id = nil)
FILE: lib/thinreports/basic_report/report/page.rb
type Thinreports (line 3) | module Thinreports
type BasicReport (line 4) | module BasicReport
type Report (line 5) | module Report
class BlankPage (line 6) | class BlankPage
method initialize (line 17) | def initialize(count = nil)
method count? (line 28) | def count?
method blank? (line 33) | def blank?
class Page (line 38) | class Page < BlankPage
method initialize (line 51) | def initialize(report, layout, options = {})
method blank? (line 64) | def blank?
method copy (line 68) | def copy
method finalize (line 82) | def finalize(options = {})
method finalized? (line 91) | def finalized?
FILE: lib/thinreports/config.rb
type Thinreports (line 3) | module Thinreports
function configure (line 6) | def self.configure(&block)
function config (line 11) | def self.config
class Configuration (line 15) | class Configuration
method initialize (line 16) | def initialize
method fallback_fonts (line 23) | def fallback_fonts
method fallback_fonts= (line 32) | def fallback_fonts=(font_names)
FILE: lib/thinreports/section_report.rb
type Thinreports (line 3) | module Thinreports
function generate (line 7) | def self.generate(report_params, filename: nil)
FILE: lib/thinreports/section_report/build.rb
type Thinreports (line 6) | module Thinreports
type SectionReport (line 7) | module SectionReport
class Build (line 8) | class Build
method call (line 9) | def call(report_params)
method load_schema (line 18) | def load_schema(report_params)
FILE: lib/thinreports/section_report/builder/item_builder.rb
type Thinreports (line 5) | module Thinreports
type SectionReport (line 6) | module SectionReport
type Builder (line 7) | module Builder
class ItemBuilder (line 8) | class ItemBuilder
method initialize (line 11) | def initialize(item_schema, parent_schema)
method build (line 16) | def build(item_params)
method build_params (line 34) | def build_params(params)
FILE: lib/thinreports/section_report/builder/report_builder.rb
type Thinreports (line 6) | module Thinreports
type SectionReport (line 7) | module SectionReport
type Builder (line 8) | module Builder
class ReportBuilder (line 9) | class ReportBuilder
method initialize (line 10) | def initialize(schema)
method build (line 14) | def build(params)
method build_groups (line 25) | def build_groups(groups_params)
method build_sections (line 37) | def build_sections(section_type, sections_params)
method build_detail_sections (line 53) | def build_detail_sections(details_params)
method build_items (line 65) | def build_items(section_schema, items_params)
method section_enabled? (line 72) | def section_enabled?(section_schema, section_params)
FILE: lib/thinreports/section_report/builder/report_data.rb
type Thinreports (line 3) | module Thinreports
type SectionReport (line 4) | module SectionReport
type Builder (line 5) | module Builder
type ReportData (line 6) | module ReportData
FILE: lib/thinreports/section_report/builder/stack_view_builder.rb
type Thinreports (line 5) | module Thinreports
type SectionReport (line 6) | module SectionReport
type Builder (line 7) | module Builder
class StackViewBuilder (line 8) | class StackViewBuilder
method initialize (line 9) | def initialize(item)
method update (line 13) | def update(params)
method build_row_items (line 36) | def build_row_items(row_schema, items_params)
method row_enabled? (line 43) | def row_enabled?(row_schema, row_params)
FILE: lib/thinreports/section_report/builder/stack_view_data.rb
type Thinreports (line 3) | module Thinreports
type SectionReport (line 4) | module SectionReport
type Builder (line 5) | module Builder
type StackViewData (line 6) | module StackViewData
FILE: lib/thinreports/section_report/generate.rb
type Thinreports (line 6) | module Thinreports
type SectionReport (line 7) | module SectionReport
class Generate (line 8) | class Generate
method initialize (line 9) | def initialize
method call (line 13) | def call(report_params, filename: nil)
FILE: lib/thinreports/section_report/pdf/render.rb
type Thinreports (line 5) | module Thinreports
type SectionReport (line 6) | module SectionReport
type PDF (line 7) | module PDF
class Render (line 8) | class Render
method initialize (line 9) | def initialize(pdf)
method call! (line 13) | def call!(report)
FILE: lib/thinreports/section_report/pdf/renderer/draw_item.rb
type Thinreports (line 3) | module Thinreports
type SectionReport (line 4) | module SectionReport
type Renderer (line 5) | module Renderer
type DrawItem (line 6) | module DrawItem
function draw_item (line 7) | def draw_item(item, expanded_height = 0)
FILE: lib/thinreports/section_report/pdf/renderer/group_renderer.rb
type Thinreports (line 5) | module Thinreports
type SectionReport (line 6) | module SectionReport
type Renderer (line 7) | module Renderer
class GroupRenderer (line 8) | class GroupRenderer
method initialize (line 9) | def initialize(pdf)
method render (line 14) | def render(report, group)
FILE: lib/thinreports/section_report/pdf/renderer/section_height.rb
type Thinreports (line 3) | module Thinreports
type SectionReport (line 4) | module SectionReport
type Renderer (line 5) | module Renderer
type SectionHeight (line 6) | module SectionHeight
function section_height (line 9) | def section_height(section)
function calc_float_content_bottom (line 25) | def calc_float_content_bottom(section)
function item_layout (line 32) | def item_layout(section, shape)
function static_layout (line 52) | def static_layout(section, shape, y, height)
function image_block_layout (line 56) | def image_block_layout(section, shape)
function calc_text_block_height (line 68) | def calc_text_block_height(shape)
function text_layout (line 78) | def text_layout(section, shape)
function stack_view_layout (line 90) | def stack_view_layout(section, shape)
FILE: lib/thinreports/section_report/pdf/renderer/section_renderer.rb
type Thinreports (line 7) | module Thinreports
type SectionReport (line 8) | module SectionReport
type Renderer (line 9) | module Renderer
class SectionRenderer (line 10) | class SectionRenderer
method initialize (line 14) | def initialize(pdf)
method render (line 18) | def render(section)
method stack_view_renderer (line 33) | def stack_view_renderer
FILE: lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb
type Thinreports (line 5) | module Thinreports
type SectionReport (line 6) | module SectionReport
type Renderer (line 7) | module Renderer
class StackViewRenderer (line 8) | class StackViewRenderer
method initialize (line 9) | def initialize(pdf)
method section_height (line 16) | def section_height(shape)
method render (line 27) | def render(shape)
method build_row_layouts (line 42) | def build_row_layouts(rows)
FILE: lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb
type Thinreports (line 6) | module Thinreports
type SectionReport (line 7) | module SectionReport
type Renderer (line 8) | module Renderer
class StackViewRowRenderer (line 9) | class StackViewRowRenderer
method initialize (line 13) | def initialize(pdf)
method render (line 17) | def render(row)
method stack_view_renderer (line 32) | def stack_view_renderer
FILE: lib/thinreports/section_report/schema/loader.rb
type Thinreports (line 5) | module Thinreports
type SectionReport (line 6) | module SectionReport
type Schema (line 7) | module Schema
class Loader (line 8) | class Loader
method initialize (line 9) | def initialize
method load_from_file (line 13) | def load_from_file(filename)
method load_from_data (line 18) | def load_from_data(data)
FILE: lib/thinreports/section_report/schema/parser.rb
type Thinreports (line 8) | module Thinreports
type SectionReport (line 9) | module SectionReport
type Schema (line 10) | module Schema
class Parser (line 11) | class Parser
method parse (line 12) | def parse(schema_json_data)
method parse_sections (line 29) | def parse_sections(section_type, section_schema_datas = nil)
method parse_section (line 38) | def parse_section(type, section_schema_data)
method section_schema_class_for (line 46) | def section_schema_class_for(section_type)
FILE: lib/thinreports/section_report/schema/report.rb
type Thinreports (line 3) | module Thinreports
type SectionReport (line 4) | module SectionReport
type Schema (line 5) | module Schema
class Report (line 6) | class Report < Core::Shape::Manager::Format
method user_paper_type? (line 17) | def user_paper_type?
method initialize (line 21) | def initialize(schema_data, headers:, details:, footers:)
FILE: lib/thinreports/section_report/schema/section.rb
type Thinreports (line 3) | module Thinreports
type SectionReport (line 4) | module SectionReport
type Schema (line 5) | module Schema
type Section (line 6) | module Section
class Base (line 7) | class Base < Core::Shape::Manager::Format
method initialize (line 15) | def initialize(schema_data, items:)
method find_item (line 20) | def find_item(id)
method initialize_items (line 26) | def initialize_items(items)
class Header (line 35) | class Header < Base
class Footer (line 39) | class Footer < Base
class Detail (line 42) | class Detail < Base
FILE: lib/thinreports/version.rb
type Thinreports (line 3) | module Thinreports
FILE: test/basic_report/features/dynamic_style/test_feature.rb
class Thinreports::BasicReport::TestDynamicStyleFeature (line 5) | class Thinreports::BasicReport::TestDynamicStyleFeature < Thinreports::F...
FILE: test/basic_report/features/eudc/test_feature.rb
class Thinreports::BasicReport::TestEudcFeature (line 5) | class Thinreports::BasicReport::TestEudcFeature < Thinreports::FeatureTe...
method teardown (line 24) | def teardown
FILE: test/basic_report/features/graphics/test_feature.rb
class Thinreports::BasicReport::TestGraphicsFeature (line 5) | class Thinreports::BasicReport::TestGraphicsFeature < Thinreports::Featu...
FILE: test/basic_report/features/hidden_item/test_feature.rb
class Thinreports::BasicReport::TestHiddenItemFeature (line 5) | class Thinreports::BasicReport::TestHiddenItemFeature < Thinreports::Fea...
FILE: test/basic_report/features/image_block/test_feature.rb
class Thinreports::BasicReport::TestImageBlockFeature (line 7) | class Thinreports::BasicReport::TestImageBlockFeature < Thinreports::Fea...
FILE: test/basic_report/features/list_events/test_feature.rb
class Thinreports::BasicReport::TestListEventsFeature (line 5) | class Thinreports::BasicReport::TestListEventsFeature < Thinreports::Fea...
FILE: test/basic_report/features/list_manually/test_feature.rb
class Thinreports::BasicReport::TestListManuallyFeature (line 5) | class Thinreports::BasicReport::TestListManuallyFeature < Thinreports::F...
FILE: test/basic_report/features/page_number/test_feature.rb
class Thinreports::BasicReport::TestPageNumberFeature (line 5) | class Thinreports::BasicReport::TestPageNumberFeature < Thinreports::Fea...
FILE: test/basic_report/features/page_number_with_list/test_feature.rb
class Thinreports::BasicReport::TestPageNumberWithListFeature (line 5) | class Thinreports::BasicReport::TestPageNumberWithListFeature < Thinrepo...
FILE: test/basic_report/features/palleted_png/test_feature.rb
class Thinreports::BasicReport::TestPalletedPngFeature (line 5) | class Thinreports::BasicReport::TestPalletedPngFeature < Thinreports::Fe...
FILE: test/basic_report/features/report_callbacks/test_feature.rb
class Thinreports::BasicReport::TestReportCallbacksFeature (line 5) | class Thinreports::BasicReport::TestReportCallbacksFeature < Thinreports...
FILE: test/basic_report/features/text_align/test_feature.rb
class Thinreports::BasicReport::TestTextAlignFeature (line 5) | class Thinreports::BasicReport::TestTextAlignFeature < Thinreports::Feat...
FILE: test/basic_report/features/text_block_formatting/test_feature.rb
class Thinreports::BasicReport::TestTextBlockFormattingFeature (line 6) | class Thinreports::BasicReport::TestTextBlockFormattingFeature < Thinrep...
FILE: test/basic_report/features/text_block_overflow/test_feature.rb
class Thinreports::BasicReport::TestTextBlockOverflowFeature (line 5) | class Thinreports::BasicReport::TestTextBlockOverflowFeature < Thinrepor...
FILE: test/basic_report/features/text_block_singleline/test_feature.rb
class Thinreports::BasicReport::TestTextBlockSinglelineFeature (line 5) | class Thinreports::BasicReport::TestTextBlockSinglelineFeature < Thinrep...
FILE: test/basic_report/features/text_block_style/test_feature.rb
class Thinreports::BasicReport::TestTextBlockStyleFeature (line 5) | class Thinreports::BasicReport::TestTextBlockStyleFeature < Thinreports:...
FILE: test/basic_report/features/text_character_spacing/test_feature.rb
class Thinreports::BasicReport::TestTextCharacterSpacingFeature (line 5) | class Thinreports::BasicReport::TestTextCharacterSpacingFeature < Thinre...
FILE: test/basic_report/features/text_overflow_wrap/test_feature.rb
class Thinreports::BasicReport::TestTextOverflowWrapFeature (line 5) | class Thinreports::BasicReport::TestTextOverflowWrapFeature < Thinreport...
FILE: test/basic_report/features/text_word_wrap/test_feature.rb
class Thinreports::BasicReport::TestTextWordWrapFeature (line 5) | class Thinreports::BasicReport::TestTextWordWrapFeature < Thinreports::F...
FILE: test/basic_report/schema_helper.rb
type Thinreports::BasicReport::SchemaHelper (line 3) | module Thinreports::BasicReport::SchemaHelper
function layout_file (line 127) | def layout_file(options = {})
FILE: test/basic_report/test_helper.rb
type Thinreports (line 20) | module Thinreports
type BasicReport (line 21) | module BasicReport
type TestHelper (line 22) | module TestHelper
function assert_deprecated (line 27) | def assert_deprecated(&block)
function data_file (line 32) | def data_file(*paths)
function read_data_file (line 36) | def read_data_file(*paths)
function analyze_pdf_images (line 40) | def analyze_pdf_images(pdf_data)
function assert_pdf_data (line 47) | def assert_pdf_data(data)
FILE: test/basic_report/units/core/format/test_base.rb
class Thinreports::BasicReport::Core::Format::BaseTest (line 5) | class Thinreports::BasicReport::Core::Format::BaseTest < Minitest::Test
class TestFormat (line 34) | class TestFormat < Thinreports::BasicReport::Core::Format::Base
method setup (line 76) | def setup
method test_definition_of_all_config_methods (line 80) | def test_definition_of_all_config_methods
method test_readers (line 91) | def test_readers
method test_checkers (line 108) | def test_checkers
method test_reader_cannot_write_value (line 115) | def test_reader_cannot_write_value
method test_writers (line 125) | def test_writers
method test_accessors (line 141) | def test_accessors
method test_attributes (line 149) | def test_attributes
FILE: test/basic_report/units/core/shape/base/test_internal.rb
class Thinreports::BasicReport::Core::Shape::Base::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::Base::TestInternal < Minite...
method setup (line 8) | def setup
method create_internal (line 13) | def create_internal(format_config = {}, &block)
method test_self_format_delegators_should_defines_method_delegated_from_format (line 28) | def test_self_format_delegators_should_defines_method_delegated_from_f...
method test_method_delegated_from_format_should_return_same_value_as_an_format (line 35) | def test_method_delegated_from_format_should_return_same_value_as_an_f...
method test_copied_internal_should_have_the_new_value_specified_as_a_parent_property (line 42) | def test_copied_internal_should_have_the_new_value_specified_as_a_pare...
method test_copied_internal_should_have_style_copied_from_original (line 53) | def test_copied_internal_should_have_style_copied_from_original
method test_copied_internal_should_have_states_property_copied_from_original (line 65) | def test_copied_internal_should_have_states_property_copied_from_original
method test_copy_should_execute_block_with_new_internal_as_argument (line 77) | def test_copy_should_execute_block_with_new_internal_as_argument
FILE: test/basic_report/units/core/shape/basic/test_block_format.rb
class Thinreports::BasicReport::Core::Shape::Basic::TestBlockFormat (line 5) | class Thinreports::BasicReport::Core::Shape::Basic::TestBlockFormat < Mi...
method test_attribute_readers (line 18) | def test_attribute_readers
FILE: test/basic_report/units/core/shape/basic/test_block_interface.rb
class Thinreports::BasicReport::Core::Shape::Basic::TestBlockInterface (line 5) | class Thinreports::BasicReport::Core::Shape::Basic::TestBlockInterface <...
method setup (line 10) | def setup
method test_value_should_work_as_reader_with_no_arguments (line 20) | def test_value_should_work_as_reader_with_no_arguments
method test_value_should_work_as_writer_with_arguments (line 25) | def test_value_should_work_as_writer_with_arguments
FILE: test/basic_report/units/core/shape/basic/test_block_internal.rb
class Thinreports::BasicReport::Core::Shape::Basic::TestBlockInternal (line 5) | class Thinreports::BasicReport::Core::Shape::Basic::TestBlockInternal < ...
method test_read_value_should_return_value_from_format (line 10) | def test_read_value_should_return_value_from_format
method test_read_value_should_return_value_from_state_with_value_key (line 15) | def test_read_value_should_return_value_from_state_with_value_key
method test_real_value_should_return_the_same_value_as_a_read_value_method (line 21) | def test_real_value_should_return_the_same_value_as_a_read_value_method
method test_write_value_should_save_value_to_states_store_as_value (line 27) | def test_write_value_should_save_value_to_states_store_as_value
method test_type_of_asker_should_return_true_when_given_the_block_value (line 33) | def test_type_of_asker_should_return_true_when_given_the_block_value
method test_value_should_works_the_same_as_read_value_method (line 37) | def test_value_should_works_the_same_as_read_value_method
method test_type_of_asker_should_return_false_otherwise (line 43) | def test_type_of_asker_should_return_false_otherwise
method init_internal (line 49) | def init_internal(format = {})
FILE: test/basic_report/units/core/shape/basic/test_format.rb
class Thinreports::BasicReport::Core::Shape::Basic::TestFormat (line 5) | class Thinreports::BasicReport::Core::Shape::Basic::TestFormat < Minites...
method test_attribute_readers (line 29) | def test_attribute_readers
FILE: test/basic_report/units/core/shape/basic/test_interface.rb
class Thinreports::BasicReport::Core::Shape::Basic::TestInterface (line 5) | class Thinreports::BasicReport::Core::Shape::Basic::TestInterface < Mini...
method create_interface (line 11) | def create_interface(format_config = {})
method test_id_should_return_id_with_reference_to_internal (line 18) | def test_id_should_return_id_with_reference_to_internal
method test_id_should_return_cloned_id (line 23) | def test_id_should_return_cloned_id
method test_type_should_operate_as_delegator_of_internal (line 28) | def test_type_should_operate_as_delegator_of_internal
method test_visible_asker_should_return_result_with_reference_to_style_of_internal (line 33) | def test_visible_asker_should_return_result_with_reference_to_style_of...
method test_visible_should_properly_set_visibility_to_style_of_internal (line 38) | def test_visible_should_properly_set_visibility_to_style_of_internal
method test_style_should_operate_as_reader_when_one_argument_is_given (line 45) | def test_style_should_operate_as_reader_when_one_argument_is_given
method test_style_should_operate_as_writer_when_two_arguments_are_given (line 51) | def test_style_should_operate_as_writer_when_two_arguments_are_given
method test_style_should_operate_as_writer_for_border_style_when_three_arguments_are_given (line 58) | def test_style_should_operate_as_writer_for_border_style_when_three_ar...
method test_style_should_return_self_when_two_arguments_are_given (line 65) | def test_style_should_return_self_when_two_arguments_are_given
method test_style_should_return_self_when_three_arguments_are_given (line 69) | def test_style_should_return_self_when_three_arguments_are_given
method test_styles_should_properly_set_the_specified_styles_as_Hash (line 73) | def test_styles_should_properly_set_the_specified_styles_as_Hash
method test_hide_should_properly_set_false_to_visibility (line 87) | def test_hide_should_properly_set_false_to_visibility
method test_hide_should_return_self (line 94) | def test_hide_should_return_self
method test_show_should_properly_set_true_to_visibility (line 98) | def test_show_should_properly_set_true_to_visibility
method test_show_should_return_self (line 105) | def test_show_should_return_self
FILE: test/basic_report/units/core/shape/basic/test_internal.rb
class Thinreports::BasicReport::Core::Shape::Basic::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::Basic::TestInternal < Minit...
method create_internal (line 11) | def create_internal(format_config = {})
method test_id_should_operate_as_delegator_of_format (line 17) | def test_id_should_operate_as_delegator_of_format
method test_type_should_operate_as_delegator_of_format (line 22) | def test_type_should_operate_as_delegator_of_format
method test_style_should_return_instance_of_StyleGraphic (line 27) | def test_style_should_return_instance_of_StyleGraphic
method test_type_of_asker_should_already_return_true_when_the_specified_type_is_basic (line 32) | def test_type_of_asker_should_already_return_true_when_the_specified_t...
method test_type_of_asker_should_return_true_when_the_specified_type_equal_self_type_name (line 36) | def test_type_of_asker_should_return_true_when_the_specified_type_equa...
method test_identifier (line 47) | def test_identifier
FILE: test/basic_report/units/core/shape/image_block/test_interface.rb
class Thinreports::BasicReport::Core::Shape::ImageBlock::TestInterface (line 5) | class Thinreports::BasicReport::Core::Shape::ImageBlock::TestInterface <...
method setup (line 10) | def setup
method test_src (line 15) | def test_src
method test_src= (line 20) | def test_src=
FILE: test/basic_report/units/core/shape/image_block/test_internal.rb
class Thinreports::BasicReport::Core::Shape::ImageBlock::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::ImageBlock::TestInternal < ...
method test_src_should_return_the_same_value_as_value_method (line 10) | def test_src_should_return_the_same_value_as_value_method
method test_type_of_asker_should_return_true_when_iblock_value_is_given (line 17) | def test_type_of_asker_should_return_true_when_iblock_value_is_given
method test_type_of_asker_should_return_true_when_block_value_is_given (line 21) | def test_type_of_asker_should_return_true_when_block_value_is_given
method create_internal (line 25) | def create_internal
FILE: test/basic_report/units/core/shape/list/test_format.rb
class Thinreports::BasicReport::Core::Shape::List::TestFormat (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestFormat < Minitest...
method test_has_section? (line 45) | def test_has_section?
method test_section_height (line 53) | def test_section_height
method test_attribute_readers (line 59) | def test_attribute_readers
method test_section_base_position_top (line 73) | def test_section_base_position_top
method test_initialize_sections (line 93) | def test_initialize_sections
method format_section_enabled (line 105) | def format_section_enabled(enable, section, list_format)
FILE: test/basic_report/units/core/shape/list/test_manager.rb
class Thinreports::BasicReport::Core::Shape::List::TestManager (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestManager < Minites...
method create_report (line 11) | def create_report(&block)
method list_manager (line 17) | def list_manager
method test_current_page_should_return_the_instance_of_ListPage (line 22) | def test_current_page_should_return_the_instance_of_ListPage
method test_current_page_state_should_return_the_instance_of_ListPageState (line 26) | def test_current_page_state_should_return_the_instance_of_ListPageState
method test_switch_current_should_replace_own_current_page_property_by_the_given_page (line 30) | def test_switch_current_should_replace_own_current_page_property_by_th...
method test_switch_current_should_replace_own_current_page_state_property_by_internal_property_of_the_given_page (line 40) | def test_switch_current_should_replace_own_current_page_state_property...
method test_switch_current_should_return_the_self (line 50) | def test_switch_current_should_return_the_self
method test_page_count (line 58) | def test_page_count
FILE: test/basic_report/units/core/shape/list/test_page.rb
class Thinreports::BasicReport::Core::Shape::List::TestPage (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestPage < Minitest::...
method create_report (line 46) | def create_report(&block)
method test_on_page_finalize_callback (line 52) | def test_on_page_finalize_callback
method test_on_page_footer_insert_callback (line 68) | def test_on_page_footer_insert_callback
method test_on_footer_insert_callback (line 89) | def test_on_footer_insert_callback
method test_copy_should_properly_work_when_list_has_not_header (line 110) | def test_copy_should_properly_work_when_list_has_not_header
method test_copy_when_auto_page_break_disabled (line 118) | def test_copy_when_auto_page_break_disabled
method test_copy_when_auto_page_break_enabled (line 137) | def test_copy_when_auto_page_break_enabled
FILE: test/basic_report/units/core/shape/list/test_page_state.rb
class Thinreports::BasicReport::Core::Shape::List::TestPageState (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestPageState < Minit...
method setup (line 11) | def setup
method test_alias_class (line 18) | def test_alias_class
method test_type_of? (line 22) | def test_type_of?
method test_finalized! (line 26) | def test_finalized!
FILE: test/basic_report/units/core/shape/list/test_section_format.rb
class Thinreports::BasicReport::Core::Shape::List::TestSectionFormat (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestSectionFormat < M...
method test_attribute_readers (line 21) | def test_attribute_readers
method test_initialize_items (line 30) | def test_initialize_items
FILE: test/basic_report/units/core/shape/list/test_section_interface.rb
class Thinreports::BasicReport::Core::Shape::List::TestSectionInterface (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestSectionInterface ...
method setup (line 17) | def setup
method create_interface (line 21) | def create_interface(extra_section_schema = {})
method test_internal_should_return_instance_of_SectionInternal (line 31) | def test_internal_should_return_instance_of_SectionInternal
method test_initialize_should_properly_set_the_specified_section_name_to_internal (line 35) | def test_initialize_should_properly_set_the_specified_section_name_to_...
method test_initialize_should_properly_initialize_manager (line 39) | def test_initialize_should_properly_initialize_manager
method test_height_should_operate_as_delegator_of_internal (line 44) | def test_height_should_operate_as_delegator_of_internal
method test_copied_interface_should_succeed_an_section_name_of_original (line 49) | def test_copied_interface_should_succeed_an_section_name_of_original
method test_copied_interface_should_have_all_the_copies_of_Shape_which_original_holds (line 57) | def test_copied_interface_should_have_all_the_copies_of_Shape_which_or...
method copied_list (line 64) | def copied_list(list, &block)
FILE: test/basic_report/units/core/shape/list/test_section_internal.rb
class Thinreports::BasicReport::Core::Shape::List::TestSectionInternal (line 5) | class Thinreports::BasicReport::Core::Shape::List::TestSectionInternal <...
method create_internal (line 17) | def create_internal(extra_section_schema = {})
method test_height_should_operate_as_delegator_of_format (line 26) | def test_height_should_operate_as_delegator_of_format
method test_relative_left_should_operate_as_delegator_of_format (line 31) | def test_relative_left_should_operate_as_delegator_of_format
method test_move_top_to_should_properly_set_value_to_states_as_relative_top (line 36) | def test_move_top_to_should_properly_set_value_to_states_as_relative_top
method test_relative_top (line 43) | def test_relative_top
FILE: test/basic_report/units/core/shape/manager/test_format.rb
class Thinreports::BasicReport::Core::Shape::Manager::TestFormat (line 5) | class Thinreports::BasicReport::Core::Shape::Manager::TestFormat < Minit...
class TestFormat (line 8) | class TestFormat < Thinreports::BasicReport::Core::Shape::Manager::For...
method test_identifier_should_return_the_same_as_object_id_when_id_is_not_given (line 10) | def test_identifier_should_return_the_same_as_object_id_when_id_is_not...
method test_identifier_should_return_the_specified_id_when_id_is_given (line 15) | def test_identifier_should_return_the_specified_id_when_id_is_given
method test_has_shape (line 19) | def test_has_shape
method test_find_shape_should_return_format_of_shape_when_shape_is_found (line 27) | def test_find_shape_should_return_format_of_shape_when_shape_is_found
method test_find_shape_should_return_nil_when_shape_is_not_found (line 35) | def test_find_shape_should_return_nil_when_shape_is_not_found
FILE: test/basic_report/units/core/shape/manager/test_internal.rb
class Thinreports::BasicReport::Core::Shape::Manager::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::Manager::TestInternal < Min...
method create_shape_format (line 11) | def create_shape_format(type, id, other_config = {})
method create_internal (line 17) | def create_internal(&block)
method test_find_format_should_return_format_with_the_specified_Symbol_id (line 26) | def test_find_format_should_return_format_with_the_specified_Symbol_id
method test_find_format_should_return_format_with_the_specified_String_id (line 30) | def test_find_format_should_return_format_with_the_specified_String_id
method test_find_format_should_return_nil_when_format_with_specified_id_is_not_found (line 34) | def test_find_format_should_return_nil_when_format_with_specified_id_i...
method test_find_item_should_return_shape_with_the_specified_id (line 38) | def test_find_item_should_return_shape_with_the_specified_id
method test_find_item_should_return_shape_in_shapes_registry_when_the_specified_shape_exists_in_registry (line 42) | def test_find_item_should_return_shape_in_shapes_registry_when_the_spe...
method test_find_item_should_return_shape_when_passing_in_the_specified_only_filter (line 49) | def test_find_item_should_return_shape_when_passing_in_the_specified_o...
method test_find_item_should_return_nil_when_not_passing_in_the_specified_only_filter (line 54) | def test_find_item_should_return_nil_when_not_passing_in_the_specified...
method test_find_item_should_return_shape_when_passing_in_the_specified_except_filter (line 59) | def test_find_item_should_return_shape_when_passing_in_the_specified_e...
method test_find_item_should_return_shape_when_not_passing_in_the_specified_except_filter (line 64) | def test_find_item_should_return_shape_when_not_passing_in_the_specifi...
method test_final_shape_should_return_nil_when_shape_is_not_found (line 69) | def test_final_shape_should_return_nil_when_shape_is_not_found
method test_final_shape_should_return_nil_when_shape_is_stored_in_shapes_and_hidden (line 74) | def test_final_shape_should_return_nil_when_shape_is_stored_in_shapes_...
method test_final_shape_should_return_shape_when_shape_is_stored_in_shapes_and_TextBlock_with_value (line 81) | def test_final_shape_should_return_shape_when_shape_is_stored_in_shape...
method test_final_shape_should_return_nil_when_shape_is_stored_in_shapes_and_TextBlock_with_no_value (line 88) | def test_final_shape_should_return_nil_when_shape_is_stored_in_shapes_...
method test_final_shape_should_return_shape_when_shape_is_stored_in_shapes_and_ImageBlock_with_src (line 95) | def test_final_shape_should_return_shape_when_shape_is_stored_in_shape...
method test_final_shape_should_return_nil_when_shape_is_stored_in_shapes_and_ImageBlock_with_no_src (line 102) | def test_final_shape_should_return_nil_when_shape_is_stored_in_shapes_...
method test_final_shape_should_return_nil_when_shape_isnot_stored_in_shapes_and_hidden (line 107) | def test_final_shape_should_return_nil_when_shape_isnot_stored_in_shap...
method test_final_shape_should_return_shape_when_shape_isnot_stored_in_shapes_and_not_Block (line 111) | def test_final_shape_should_return_shape_when_shape_isnot_stored_in_sh...
method test_final_shape_should_return_nil_when_shape_isnot_stored_in_shapes_and_ImageBlock (line 115) | def test_final_shape_should_return_nil_when_shape_isnot_stored_in_shap...
method test_final_shape_should_return_shape_when_shape_isnot_stored_in_shapes_and_TextBlock_with_reference (line 123) | def test_final_shape_should_return_shape_when_shape_isnot_stored_in_sh...
method test_final_shape_should_return_nil_when_shape_isnot_stored_in_shapes_and_TextBlock_with_no_value_no_reference (line 127) | def test_final_shape_should_return_nil_when_shape_isnot_stored_in_shap...
FILE: test/basic_report/units/core/shape/manager/test_target.rb
class Thinreports::BasicReport::Core::Shape::Manager::TestTarget (line 5) | class Thinreports::BasicReport::Core::Shape::Manager::TestTarget < Minit...
class TestManager (line 11) | class TestManager
method initialize (line 16) | def initialize(report, layout)
method create_shape_format (line 26) | def create_shape_format(type, id)
method create_manager (line 30) | def create_manager
method test_shorthand_for_finding_item (line 37) | def test_shorthand_for_finding_item
method test_shorthand_for_setting_value_to_block (line 56) | def test_shorthand_for_setting_value_to_block
method test_manager_should_return_instance_of_ManagerInternal (line 69) | def test_manager_should_return_instance_of_ManagerInternal
method test_item_should_properly_return_shape_with_the_specified_Symbol_id (line 73) | def test_item_should_properly_return_shape_with_the_specified_Symbol_id
method test_item_should_properly_return_shape_with_the_specified_String_id (line 77) | def test_item_should_properly_return_shape_with_the_specified_String_id
method test_item_should_raise_when_the_shape_with_the_specified_id_is_not_found (line 81) | def test_item_should_raise_when_the_shape_with_the_specified_id_is_not...
method test_item_should_set_an_shape_as_argument_when_a_block_is_given (line 87) | def test_item_should_set_an_shape_as_argument_when_a_block_is_given
method test_item_should_raise_when_type_of_shape_with_the_specified_id_is_list (line 93) | def test_item_should_raise_when_type_of_shape_with_the_specified_id_is...
method test_list_should_properly_return_list_with_the_specified_Symbol_id (line 99) | def test_list_should_properly_return_list_with_the_specified_Symbol_id
method test_list_should_properly_return_list_with_the_specified_String_id (line 103) | def test_list_should_properly_return_list_with_the_specified_String_id
method test_list_should_raise_when_type_of_shape_with_the_specified_id_is_not_list (line 107) | def test_list_should_raise_when_type_of_shape_with_the_specified_id_is...
method test_list_should_use_default_as_id_when_id_is_omitted (line 113) | def test_list_should_use_default_as_id_when_id_is_omitted
method test_values_should_properly_set_values_to_shapes_with_specified_id (line 117) | def test_values_should_properly_set_values_to_shapes_with_specified_id
method test_item_exists_asker_should_return_true_when_shape_with_specified_Symbol_id_is_found (line 124) | def test_item_exists_asker_should_return_true_when_shape_with_specifie...
method test_item_exists_asker_should_return_true_when_shape_with_specified_String_id_is_found (line 128) | def test_item_exists_asker_should_return_true_when_shape_with_specifie...
method test_item_exists_asker_should_return_false_when_shape_with_specified_id_not_found (line 132) | def test_item_exists_asker_should_return_false_when_shape_with_specifi...
method test_exists_asker_should_operate_like_as_item_exists_asker (line 136) | def test_exists_asker_should_operate_like_as_item_exists_asker
FILE: test/basic_report/units/core/shape/page_number/test_format.rb
class Thinreports::BasicReport::Core::Shape::PageNumber::TestFormat (line 5) | class Thinreports::BasicReport::Core::Shape::PageNumber::TestFormat < Mi...
method test_attribute_readers (line 32) | def test_attribute_readers
method test_id (line 40) | def test_id
method test_for_report? (line 48) | def test_for_report?
FILE: test/basic_report/units/core/shape/page_number/test_interface.rb
class Thinreports::BasicReport::Core::Shape::PageNumber::TestInterface (line 5) | class Thinreports::BasicReport::Core::Shape::PageNumber::TestInterface <...
method create_pageno (line 10) | def create_pageno(format = {})
method test_format (line 17) | def test_format
method test_reset_format (line 25) | def test_reset_format
FILE: test/basic_report/units/core/shape/page_number/test_internal.rb
class Thinreports::BasicReport::Core::Shape::PageNumber::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::PageNumber::TestInternal < ...
method setup (line 10) | def setup
method init_pageno (line 15) | def init_pageno(format = {})
method test_read_format (line 19) | def test_read_format
method test_write_format (line 25) | def test_write_format
method test_reset_format (line 32) | def test_reset_format
method test_build_format (line 40) | def test_build_format
method test_type_of (line 57) | def test_type_of
method test_style (line 62) | def test_style
method test_for_report (line 70) | def test_for_report
method test_Style_class (line 78) | def test_Style_class
FILE: test/basic_report/units/core/shape/styles/test_base.rb
class Thinreports::BasicReport::Core::Shape::Style::TestBase (line 5) | class Thinreports::BasicReport::Core::Shape::Style::TestBase < Minitest:...
method create_basic_format (line 11) | def create_basic_format(base_style = {})
method create_style (line 15) | def create_style(base_style = {})
method create_new_style (line 19) | def create_new_style(base_style = {}, &block)
method test_self_style_reader_should_properly_define_a_reading_method (line 24) | def test_self_style_reader_should_properly_define_a_reading_method
method test_self_style_writer_should_properly_define_a_writing_method (line 31) | def test_self_style_writer_should_properly_define_a_writing_method
method test_self_style_accessor_should_properly_defines_reading_and_writing_methods (line 38) | def test_self_style_accessor_should_properly_defines_reading_and_writi...
method test_self_style_accessible_should_add_specified_styles_to_the_accessible_styles_variable (line 46) | def test_self_style_accessible_should_add_specified_styles_to_the_acce...
method test_self_accessible_styles_variable_should_not_be_shared_each_SubClasses (line 54) | def test_self_accessible_styles_variable_should_not_be_shared_each_Sub...
method test_self_accessible_styles_variable_should_be_inherited_to_SubClass (line 61) | def test_self_accessible_styles_variable_should_be_inherited_to_SubClass
method test_self_accessible_styles_variables_of_SubClass_should_not_interfere_mutually (line 70) | def test_self_accessible_styles_variables_of_SubClass_should_not_inter...
method test_read_internal_style_should_return_style_of_styles_when_style_is_found_in_styles (line 80) | def test_read_internal_style_should_return_style_of_styles_when_style_...
method test_read_internal_style_should_return_style_of_base_when_style_is_not_found_in_styles (line 87) | def test_read_internal_style_should_return_style_of_base_when_style_is...
method test_write_internal_style_should_properly_set_style_to_the_styles (line 92) | def test_write_internal_style_should_properly_set_style_to_the_styles
method test_has_style_asker_should_return_true_when_specified_style_method_is_accessible (line 99) | def test_has_style_asker_should_return_true_when_specified_style_metho...
method test_has_style_asker_should_return_false_when_specified_style_method_is_not_accessible (line 106) | def test_has_style_asker_should_return_false_when_specified_style_meth...
method test_verify_style_value_should_raise_when_value_is_not_included_in_list (line 113) | def test_verify_style_value_should_raise_when_value_is_not_included_in...
method test_verify_style_value_should_not_raise_when_value_is_found_in_list (line 119) | def test_verify_style_value_should_not_raise_when_value_is_found_in_list
method test_reader_method_caller_should_properly_delegate_to_real_method (line 125) | def test_reader_method_caller_should_properly_delegate_to_real_method
method test_writer_method_caller_should_properly_delegate_to_real_method (line 133) | def test_writer_method_caller_should_properly_delegate_to_real_method
method test_reader_method_caller_should_raise_when_style_is_not_accessible (line 142) | def test_reader_method_caller_should_raise_when_style_is_not_accessible
method test_writer_method_caller_should_raise_when_style_is_not_accessible (line 148) | def test_writer_method_caller_should_raise_when_style_is_not_accessible
method test_copy_should_return_the_instance_of_the_same_class_as_itself (line 154) | def test_copy_should_return_the_instance_of_the_same_class_as_itself
method test_styles_of_copied_style_should_not_same_the_styles_of_original (line 159) | def test_styles_of_copied_style_should_not_same_the_styles_of_original
method test_styles_of_copied_style_should_equal_the_style_of_original (line 164) | def test_styles_of_copied_style_should_equal_the_style_of_original
method test_identifier_should_return_empty_string_when_the_style_is_not_set (line 170) | def test_identifier_should_return_empty_string_when_the_style_is_not_set
method test_identifier_should_return_the_same_as_hash_value_of_styles_when_style_is_set_something (line 175) | def test_identifier_should_return_the_same_as_hash_value_of_styles_whe...
method test_finalized_styles (line 182) | def test_finalized_styles
FILE: test/basic_report/units/core/shape/styles/test_basic.rb
class Thinreports::BasicReport::Core::Shape::Style::TestBasic (line 5) | class Thinreports::BasicReport::Core::Shape::Style::TestBasic < Minitest...
method create_basic_style (line 8) | def create_basic_style(format_config = {})
method test_visible_should_return_visibility_of_format_as_default (line 13) | def test_visible_should_return_visibility_of_format_as_default
method test_visible_should_properly_set_visibility (line 18) | def test_visible_should_properly_set_visibility
FILE: test/basic_report/units/core/shape/styles/test_graphic.rb
class Thinreports::BasicReport::Core::Shape::Style::TestGraphic (line 5) | class Thinreports::BasicReport::Core::Shape::Style::TestGraphic < Minite...
method test_border_color (line 8) | def test_border_color
method test_border_width (line 17) | def test_border_width
method test_fill_color (line 26) | def test_fill_color
method test_border (line 35) | def test_border
method create_graphic_style (line 46) | def create_graphic_style(default_style = {})
FILE: test/basic_report/units/core/shape/styles/test_text.rb
class Thinreports::BasicReport::Core::Shape::Style::TestText (line 5) | class Thinreports::BasicReport::Core::Shape::Style::TestText < Minitest:...
method test_color (line 8) | def test_color
method test_font_size (line 17) | def test_font_size
method test_initialize_font_style (line 26) | def test_initialize_font_style
method test_bold (line 34) | def test_bold
method test_italic (line 43) | def test_italic
method test_underline (line 52) | def test_underline
method test_linethrough (line 61) | def test_linethrough
method test_align (line 70) | def test_align
method test_valign (line 79) | def test_valign
method create_text_style (line 93) | def create_text_style(default_style = {})
FILE: test/basic_report/units/core/shape/text/test_format.rb
class Thinreports::BasicReport::Core::Shape::Text::TestFormat (line 5) | class Thinreports::BasicReport::Core::Shape::Text::TestFormat < Minitest...
method test_attribute_readers (line 37) | def test_attribute_readers
FILE: test/basic_report/units/core/shape/text/test_internal.rb
class Thinreports::BasicReport::Core::Shape::Text::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::Text::TestInternal < Minite...
method create_internal (line 10) | def create_internal(format_config = {})
method test_type_of? (line 15) | def test_type_of?
FILE: test/basic_report/units/core/shape/text_block/formatter/test_basic.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestBasic (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestB...
method test_apply_simple_format (line 11) | def test_apply_simple_format
method test_apply_multiple_format (line 18) | def test_apply_multiple_format
FILE: test/basic_report/units/core/shape/text_block/formatter/test_datetime.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestDatetime (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestD...
method setup (line 12) | def setup
method text_block_format (line 17) | def text_block_format(format = {})
method test_apply_datetime_format_without_basic_format (line 22) | def test_apply_datetime_format_without_basic_format
method test_apply_datetime_format_with_basic_format (line 29) | def test_apply_datetime_format_with_basic_format
method test_not_apply_datetime_format_and_return_raw_value (line 37) | def test_not_apply_datetime_format_and_return_raw_value
FILE: test/basic_report/units/core/shape/text_block/formatter/test_number.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestNumber (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestN...
method init_formatter (line 11) | def init_formatter(expect_formats)
method test_apply_precision_formats (line 18) | def test_apply_precision_formats
method test_apply_precision_format_with_basic_format (line 38) | def test_apply_precision_format_with_basic_format
method test_apply_delimiter_formats (line 45) | def test_apply_delimiter_formats
method test_apply_delimiter_format_with_basic_format (line 63) | def test_apply_delimiter_format_with_basic_format
method test_apply_all_format (line 70) | def test_apply_all_format
FILE: test/basic_report/units/core/shape/text_block/formatter/test_padding.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestPadding (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::Formatter::TestP...
method init_formatter (line 11) | def init_formatter(expect_formats)
method test_apply_padding_formats_with_left_direction (line 19) | def test_apply_padding_formats_with_left_direction
method test_apply_padding_formats_should_not_apply_when_character_length_is_short (line 27) | def test_apply_padding_formats_should_not_apply_when_character_length_...
method test_apply_padding_formats_with_right_direction (line 34) | def test_apply_padding_formats_with_right_direction
method test_apply_padding_format_with_basic_format (line 42) | def test_apply_padding_format_with_basic_format
method test_return_raw_value_when_length_is_0 (line 50) | def test_return_raw_value_when_length_is_0
method test_return_raw_value_when_char_is_empty (line 64) | def test_return_raw_value_when_char_is_empty
FILE: test/basic_report/units/core/shape/text_block/test_format.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::TestFormat (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::TestFormat < Min...
method test_attribute_readers (line 45) | def test_attribute_readers
method test_has_reference? (line 57) | def test_has_reference?
method test_has_format? (line 65) | def test_has_format?
method test_number_format_attribute_readers (line 77) | def test_number_format_attribute_readers
method test_datetime_format_attribute_readers (line 91) | def test_datetime_format_attribute_readers
method test_padding_format_attribute_readers (line 103) | def test_padding_format_attribute_readers
method test_format_padding_length (line 118) | def test_format_padding_length
method test_format_padding_rdir? (line 144) | def test_format_padding_rdir?
FILE: test/basic_report/units/core/shape/text_block/test_formatter.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::TestFormatter (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::TestFormatter < ...
method test_initialize_formatter_by_type (line 11) | def test_initialize_formatter_by_type
FILE: test/basic_report/units/core/shape/text_block/test_interface.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::TestInterface (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::TestInterface < ...
method create_interface (line 11) | def create_interface(format_config = {})
method test_format_enabled_asker_should_operate_as_delegator_of_internal (line 18) | def test_format_enabled_asker_should_operate_as_delegator_of_internal
method test_format_enabled_should_properly_set_value_to_internal (line 23) | def test_format_enabled_should_properly_set_value_to_internal
method test_set_should_properly_set_a_value (line 30) | def test_set_should_properly_set_a_value
method test_set_should_properly_set_styles (line 37) | def test_set_should_properly_set_styles
method test_value= (line 49) | def test_value=
FILE: test/basic_report/units/core/shape/text_block/test_internal.rb
class Thinreports::BasicReport::Core::Shape::TextBlock::TestInternal (line 5) | class Thinreports::BasicReport::Core::Shape::TextBlock::TestInternal < M...
method create_parent (line 11) | def create_parent
method create_internal (line 22) | def create_internal(format_config = {})
method test_multiple_asker_should_operate_as_delegator_of_format (line 26) | def test_multiple_asker_should_operate_as_delegator_of_format
method test_style_should_return_the_instance_of_Style_Text (line 31) | def test_style_should_return_the_instance_of_Style_Text
method test_read_value_should_return_the_format_value_as_default (line 35) | def test_read_value_should_return_the_format_value_as_default
method test_read_value_should_return_the_value_of_referenced_shape (line 40) | def test_read_value_should_return_the_value_of_referenced_shape
method test_read_value_should_return_the_value_stored_in_states (line 45) | def test_read_value_should_return_the_value_stored_in_states
method test_write_value_should_properly_set_the_specified_value_to_states (line 52) | def test_write_value_should_properly_set_the_specified_value_to_states
method test_write_value_should_show_warnings_when_tblock_has_reference (line 59) | def test_write_value_should_show_warnings_when_tblock_has_reference
method test_real_value_should_return_the_formatted_value_when_tblock_has_any_format (line 68) | def test_real_value_should_return_the_formatted_value_when_tblock_has_...
method test_real_value_should_return_the_raw_value_when_tblock_has_no_format (line 76) | def test_real_value_should_return_the_raw_value_when_tblock_has_no_format
method test_format_enabled_should_properly_set_value_to_states_as_format_enabled (line 83) | def test_format_enabled_should_properly_set_value_to_states_as_format_...
method test_format_enabled_asker_should_return_true_when_format_has_any_type (line 90) | def test_format_enabled_asker_should_return_true_when_format_has_any_type
method test_format_enabled_asker_should_return_true_when_base_of_format_has_any_value (line 96) | def test_format_enabled_asker_should_return_true_when_base_of_format_h...
method test_format_enabled_asker_should_return_false_when_format_has_no_type_and_base_has_not_value (line 102) | def test_format_enabled_asker_should_return_false_when_format_has_no_t...
method test_format_enabled_asker_should_return_true_constantly_when_tblock_is_multiple_mode (line 106) | def test_format_enabled_asker_should_return_true_constantly_when_tbloc...
method test_type_of_asker_should_return_true_when_value_is_tblock (line 115) | def test_type_of_asker_should_return_true_when_value_is_tblock
method test_type_of_asker_should_return_true_when_value_is_block (line 119) | def test_type_of_asker_should_return_true_when_value_is_block
method test_formatter_should_return_instance_of_FormatterBasic_when_format_is_enable (line 123) | def test_formatter_should_return_instance_of_FormatterBasic_when_forma...
FILE: test/basic_report/units/core/test_shape.rb
class Thinreports::BasicReport::Core::TestShape (line 5) | class Thinreports::BasicReport::Core::TestShape < Minitest::Test
method test_find_by_type_should_return_PageNumber (line 11) | def test_find_by_type_should_return_PageNumber
method test_find_by_type_should_return_ImageBlock (line 15) | def test_find_by_type_should_return_ImageBlock
method test_find_by_type_should_return_TextBlock (line 19) | def test_find_by_type_should_return_TextBlock
method test_find_by_type_should_return_List (line 23) | def test_find_by_type_should_return_List
method test_find_by_type_should_return_Text (line 27) | def test_find_by_type_should_return_Text
method test_find_by_type_should_return_Basic_as_Image (line 31) | def test_find_by_type_should_return_Basic_as_Image
method test_find_by_type_should_return_Basic_as_Line (line 35) | def test_find_by_type_should_return_Basic_as_Line
method test_find_by_type_should_return_Basic_as_Rect (line 39) | def test_find_by_type_should_return_Basic_as_Rect
method test_find_by_type_should_return_Basic_as_Ellipse (line 43) | def test_find_by_type_should_return_Basic_as_Ellipse
method test_find_by_type_should_raise (line 47) | def test_find_by_type_should_raise
FILE: test/basic_report/units/core/test_utils.rb
class Thinreports::BasicReport::Core::TestShape (line 5) | class Thinreports::BasicReport::Core::TestShape < Minitest::Test
method test_call_block_in (line 9) | def test_call_block_in
method test_deep_copy_in_unsupported_object (line 17) | def test_deep_copy_in_unsupported_object
method test_deep_copy_in_Array (line 25) | def test_deep_copy_in_Array
method test_deep_copy_in_Hash (line 37) | def test_deep_copy_in_Hash
method test_blank_value_in_String (line 49) | def test_blank_value_in_String
method test_blank_value_in_NilClass (line 59) | def test_blank_value_in_NilClass
method test_blank_value_in_other_classes (line 63) | def test_blank_value_in_other_classes
FILE: test/basic_report/units/generator/pdf/document/graphics/test_attributes.rb
class Thinreports::BasicReport::Generator::PDF::Graphics::TestAttributes (line 5) | class Thinreports::BasicReport::Generator::PDF::Graphics::TestAttributes...
method setup (line 8) | def setup
method test_build_graphic_attributes (line 12) | def test_build_graphic_attributes
method test_build_text_attributes (line 34) | def test_build_text_attributes
method test_font_family (line 90) | def test_font_family
method test_font_styles (line 95) | def test_font_styles
method test_letter_spacing (line 100) | def test_letter_spacing
method test_text_align (line 106) | def test_text_align
method test_text_valign (line 114) | def test_text_valign
method test_text_overflow (line 122) | def test_text_overflow
method test_word_wrap (line 130) | def test_word_wrap
method test_line_height (line 136) | def test_line_height
method test_image_position_x (line 142) | def test_image_position_x
method test_image_position_y (line 150) | def test_image_position_y
method test_overflow_wrap (line 158) | def test_overflow_wrap
method text_overflow_wrap_fallback_to_word_wrap (line 167) | def text_overflow_wrap_fallback_to_word_wrap
method test_migrate_overflow_wrap_from_word_wrap (line 174) | def test_migrate_overflow_wrap_from_word_wrap
FILE: test/basic_report/units/generator/pdf/document/graphics/test_basic.rb
class Thinreports::BasicReport::Generator::PDF::Graphics::TestBasic (line 5) | class Thinreports::BasicReport::Generator::PDF::Graphics::TestBasic < Mi...
method setup (line 8) | def setup
method test_build_stroke_styles (line 12) | def test_build_stroke_styles
method test_build_fill_styles (line 41) | def test_build_fill_styles
FILE: test/basic_report/units/generator/pdf/document/graphics/test_image.rb
class Thinreports::BasicReport::Generator::PDF::Graphics::TestImage (line 6) | class Thinreports::BasicReport::Generator::PDF::Graphics::TestImage < Mi...
method setup (line 9) | def setup
method test_image (line 16) | def test_image
method test_base64image (line 24) | def test_base64image
method test_image_box (line 31) | def test_image_box
method test_clean_temp_images (line 39) | def test_clean_temp_images
method each_image (line 57) | def each_image(&block)
FILE: test/basic_report/units/generator/pdf/document/graphics/test_text.rb
class Thinreports::BasicReport::Generator::PDF::Graphics::TestText (line 5) | class Thinreports::BasicReport::Generator::PDF::Graphics::TestText < Min...
method setup (line 8) | def setup
method exec_with_font_styles (line 13) | def exec_with_font_styles(attrs = nil, font = nil, &block)
method exec_with_text_styles (line 20) | def exec_with_text_styles(attrs = {}, &block)
method test_with_text_styles_should_not_operate_when_color_is_none (line 27) | def test_with_text_styles_should_not_operate_when_color_is_none
method test_with_text_styles_should_set_leading_via_line_height_attribute (line 33) | def test_with_text_styles_should_set_leading_via_line_height_attribute
method test_with_text_styles_should_not_set_leading_when_line_height_is_not_specified (line 42) | def test_with_text_styles_should_not_set_leading_when_line_height_is_n...
method test_with_text_styles_should_set_character_spacing_via_letter_spacing_attribute (line 48) | def test_with_text_styles_should_set_character_spacing_via_letter_spac...
method test_with_text_styles_should_not_set_character_spacing_when_letter_spacing_is_not_specified (line 54) | def test_with_text_styles_should_not_set_character_spacing_when_letter...
method test_with_text_styles_should_parse_color (line 60) | def test_with_text_styles_should_parse_color
method test_with_font_styles_should_set_fill_color_using_color_of_font (line 66) | def test_with_font_styles_should_set_fill_color_using_color_of_font
method test_with_font_styles_should_perform_manual_style_when_bold_style_cannot_be_applied (line 72) | def test_with_font_styles_should_perform_manual_style_when_bold_style_...
method test_with_font_styles_should_perform_manual_style_when_italic_style_cannot_be_applied (line 78) | def test_with_font_styles_should_perform_manual_style_when_italic_styl...
method test_with_font_styles_should_set_stroke_color_using_color_of_font_when_bold_style_cannot_be_applied (line 84) | def test_with_font_styles_should_set_stroke_color_using_color_of_font_...
method test_with_font_styles_should_set_line_width_calculated_from_font_size_when_bold_style_cannot_be_applied (line 90) | def test_with_font_styles_should_set_line_width_calculated_from_font_s...
method test_with_font_styles_should_set_mode_to_fill_stroke_when_bold_style_cannot_be_applied (line 96) | def test_with_font_styles_should_set_mode_to_fill_stroke_when_bold_sty...
method test_with_font_styles_should_not_perform_a_manual_style_when_bold_style_can_be_applied (line 102) | def test_with_font_styles_should_not_perform_a_manual_style_when_bold_...
method test_with_font_styles_should_not_perform_a_manual_style_when_italic_style_can_be_applied (line 108) | def test_with_font_styles_should_not_perform_a_manual_style_when_itali...
method test_text_line_leading_should_return_a_specified_leading_value_minus_the_font_height (line 114) | def test_text_line_leading_should_return_a_specified_leading_value_min...
method test_replace_space_to_nbsp_should_replace_the_spaces_NBSP (line 121) | def test_replace_space_to_nbsp_should_replace_the_spaces_NBSP
method test_text_box_should_not_raise_PrawnCannotFitError (line 125) | def test_text_box_should_not_raise_PrawnCannotFitError
method test_text_box_attrs_should_return_a_Hash_containing_a_at_and_width_options (line 133) | def test_text_box_attrs_should_return_a_Hash_containing_a_at_and_width...
method test_text_box_attrs_should_return_a_Hash_which_doesnt_contain_the_single_line_option_when_single_is_true_but_overflow_is_expand (line 140) | def test_text_box_attrs_should_return_a_Hash_which_doesnt_contain_the_...
method test_text_box_attrs_should_return_a_Hash_containing_a_single_line_option_when_single_is_true_and_overflow_isnot_expand (line 145) | def test_text_box_attrs_should_return_a_Hash_containing_a_single_line_...
method test_text_box_attrs_should_return_a_Hash_which_does_not_contain_a_height_option_when_single_is_true (line 150) | def test_text_box_attrs_should_return_a_Hash_which_does_not_contain_a_...
method test_text_box_attrs_should_return_a_Hash_which_does_not_contain_a_single_line_option_when_single_is_not_specified (line 155) | def test_text_box_attrs_should_return_a_Hash_which_does_not_contain_a_...
method test_text_box_attrs_should_return_a_Hash_containing_a_height_optin_when_single_is_not_specified (line 160) | def test_text_box_attrs_should_return_a_Hash_containing_a_height_optin...
method test_text (line 165) | def test_text
FILE: test/basic_report/units/generator/pdf/document/test_font.rb
class Thinreports::BasicReport::Generator::PDF::TestFont (line 5) | class Thinreports::BasicReport::Generator::PDF::TestFont < Minitest::Test
method teardown (line 10) | def teardown
method test_setup_fonts (line 17) | def test_setup_fonts
method test_setup_fonts_with_custom_fallback_fonts (line 38) | def test_setup_fonts_with_custom_fallback_fonts
method test_setup_fonts_with_unknown_custom_fallback_fonts (line 64) | def test_setup_fonts_with_unknown_custom_fallback_fonts
method test_default_family (line 74) | def test_default_family
method test_default_family_if_mmissing (line 78) | def test_default_family_if_mmissing
method test_font_has_style? (line 83) | def test_font_has_style?
method document (line 106) | def document
FILE: test/basic_report/units/generator/pdf/document/test_graphics.rb
class Thinreports::BasicReport::Generator::PDF::TestGraphics (line 5) | class Thinreports::BasicReport::Generator::PDF::TestGraphics < Minitest:...
class TestGraphics (line 8) | class TestGraphics
method setup (line 13) | def setup
method test_setup_custom_graphic_states (line 18) | def test_setup_custom_graphic_states
method test_line_width (line 25) | def test_line_width
method test_save_graphics_state (line 33) | def test_save_graphics_state
method test_restore_graphics_state (line 38) | def test_restore_graphics_state
FILE: test/basic_report/units/generator/pdf/document/test_page.rb
class Thinreports::BasicReport::Generator::PDF::Document::TestPage (line 5) | class Thinreports::BasicReport::Generator::PDF::Document::TestPage < Min...
method create_pdf (line 8) | def create_pdf
method test_JIS_page_size (line 12) | def test_JIS_page_size
method test_B4_paper_size_should_returns_size_as_B4_JIS (line 18) | def test_B4_paper_size_should_returns_size_as_B4_JIS
method test_B4_ISO_paper_size_should_be_converted_to_B4 (line 28) | def test_B4_ISO_paper_size_should_be_converted_to_B4
method test_change_page_format_should_return_true_at_first_time (line 38) | def test_change_page_format_should_return_true_at_first_time
method test_change_page_format_should_return_false_when_given_the_same_format (line 45) | def test_change_page_format_should_return_false_when_given_the_same_fo...
method test_change_page_format_should_return_true_when_given_the_other_format (line 53) | def test_change_page_format_should_return_true_when_given_the_other_fo...
method test_new_basic_page_options (line 62) | def test_new_basic_page_options
method test_new_basic_page_options_when_the_layout_has_customize_size (line 70) | def test_new_basic_page_options_when_the_layout_has_customize_size
method test_start_new_page_should_create_stamp (line 80) | def test_start_new_page_should_create_stamp
method test_start_new_page_should_not_create_stamp (line 88) | def test_start_new_page_should_not_create_stamp
method test_start_new_page_should_stamp_constantly (line 97) | def test_start_new_page_should_stamp_constantly
method test_add_blank_page_should_create_an_A4_size_page_in_first_page (line 106) | def test_add_blank_page_should_create_an_A4_size_page_in_first_page
method test_add_blank_page_should_call_with_no_arguments_since_second_page (line 113) | def test_add_blank_page_should_call_with_no_arguments_since_second_page
FILE: test/basic_report/units/generator/pdf/document/test_parse_color.rb
class Thinreports::BasicReport::Generator::PDF::TestParseColor (line 5) | class Thinreports::BasicReport::Generator::PDF::TestParseColor < Minites...
class TestColorParser (line 8) | class TestColorParser
method setup (line 12) | def setup
method test_parse_color_with_hexcolor (line 16) | def test_parse_color_with_hexcolor
method test_parse_color_with_colorname (line 21) | def test_parse_color_with_colorname
method test_parse_color_with_colorname_raise_when_unknown_name_given (line 25) | def test_parse_color_with_colorname_raise_when_unknown_name_given
FILE: test/basic_report/units/generator/pdf/prawn_ext/test_calc_image_dimensions.rb
class Thinreports::BasicReport::Generator::PrawnExt::TestCalcImageDimensions (line 5) | class Thinreports::BasicReport::Generator::PrawnExt::TestCalcImageDimens...
class Klass (line 6) | class Klass
method calc_image_dimensions (line 9) | def calc_image_dimensions(options)
method setup (line 14) | def setup
method test_calc_image_dimensions (line 18) | def test_calc_image_dimensions
FILE: test/basic_report/units/generator/pdf/prawn_ext/test_width_of.rb
class Thinreports::BasicReport::Generator::PrawnExt::TestWidthOf (line 5) | class Thinreports::BasicReport::Generator::PrawnExt::TestWidthOf < Minit...
method setup (line 6) | def setup
method test_width_of (line 10) | def test_width_of
FILE: test/basic_report/units/generator/pdf/test_document.rb
class Thinreports::BasicReport::Generator::PDF::TestDocument (line 5) | class Thinreports::BasicReport::Generator::PDF::TestDocument < Minitest:...
method test_new (line 11) | def test_new
FILE: test/basic_report/units/generator/test_pdf.rb
class Thinreports::BasicReport::Generator::TestPDF (line 5) | class Thinreports::BasicReport::Generator::TestPDF < Minitest::Test
method test_default_layout (line 10) | def test_default_layout
method test_initialize (line 18) | def test_initialize
FILE: test/basic_report/units/layout/test_base.rb
class Thinreports::BasicReport::Layout::TestBase (line 5) | class Thinreports::BasicReport::Layout::TestBase < Minitest::Test
method test_load_format (line 10) | def test_load_format
method test_new (line 17) | def test_new
method test_id (line 26) | def test_id
method test_default? (line 34) | def test_default?
FILE: test/basic_report/units/layout/test_format.rb
class Thinreports::BasicReport::Layout::TestFormat (line 5) | class Thinreports::BasicReport::Layout::TestFormat < Minitest::Test
method test_attribute_readers (line 33) | def test_attribute_readers
method test_user_paper_type? (line 44) | def test_user_paper_type?
method test_build (line 58) | def test_build
method test_build_legacy_layout (line 68) | def test_build_legacy_layout
method test_initialize_items (line 85) | def test_initialize_items
method layout_schema (line 97) | def layout_schema(version = Thinreports::VERSION)
FILE: test/basic_report/units/layout/test_legacy_schema.rb
class Thinreports::BasicReport::Layout::TestLegacySchema (line 5) | class Thinreports::BasicReport::Layout::TestLegacySchema < Minitest::Test
method test_upgrade (line 10) | def test_upgrade
method test_text_item_schema (line 50) | def test_text_item_schema
method test_rect_item_schema (line 96) | def test_rect_item_schema
method test_line_item_schema (line 131) | def test_line_item_schema
method test_ellipse_item_schema (line 162) | def test_ellipse_item_schema
method test_image_item_schema (line 195) | def test_image_item_schema
method test_page_number_item_schema (line 223) | def test_page_number_item_schema
method test_image_block_item_schema (line 266) | def test_image_block_item_schema
method test_text_block_schema (line 295) | def test_text_block_schema
method test_list_item_schema (line 405) | def test_list_item_schema
method test_image_position_y (line 502) | def test_image_position_y
method test_display (line 508) | def test_display
method test_font_style (line 513) | def test_font_style
method test_text_align (line 527) | def test_text_align
method test_vertical_align (line 533) | def test_vertical_align
method test_line_height (line 541) | def test_line_height
method test_letter_spacing (line 547) | def test_letter_spacing
method test_extract_item_schemas (line 553) | def test_extract_item_schemas
method test_cleanup_svg (line 565) | def test_cleanup_svg
method layout_legacy_schema (line 573) | def layout_legacy_schema
FILE: test/basic_report/units/layout/test_version.rb
class Thinreports::BasicReport::Layout::TestVersion (line 5) | class Thinreports::BasicReport::Layout::TestVersion < Minitest::Test
method test_compatible? (line 11) | def test_compatible?
method test_legacy? (line 22) | def test_legacy?
FILE: test/basic_report/units/report/test_base.rb
class Thinreports::BasicReport::Report::TestBase (line 5) | class Thinreports::BasicReport::Report::TestBase < Minitest::Test
method setup (line 10) | def setup
method test_on_page_create_callback (line 15) | def test_on_page_create_callback
method test_initialize_should_register_layout_as_default_when_layout_is_specified_as_the_option (line 30) | def test_initialize_should_register_layout_as_default_when_layout_is_s...
method test_initialize_should_initialize_new_Report_without_default_layout (line 35) | def test_initialize_should_initialize_new_Report_without_default_layout
method test_use_layout_should_register_default_layout_when_default_property_is_omitted (line 39) | def test_use_layout_should_register_default_layout_when_default_proper...
method test_use_layout_should_register_default_layout_when_default_property_is_true (line 45) | def test_use_layout_should_register_default_layout_when_default_proper...
method test_start_new_page_should_properly_create_a_new_Page_and_return (line 51) | def test_start_new_page_should_properly_create_a_new_Page_and_return
method test_start_new_page_should_raise_when_the_layout_has_not_been_registered_yet (line 57) | def test_start_new_page_should_raise_when_the_layout_has_not_been_regi...
method test_start_new_page_should_create_a_new_page_using_a_default_layout (line 63) | def test_start_new_page_should_create_a_new_page_using_a_default_layout
method test_start_new_page_should_create_a_new_page_using_a_layout_with_specified_id (line 69) | def test_start_new_page_should_create_a_new_page_using_a_layout_with_s...
method test_start_new_page_should_create_a_new_page_using_a_specified_layoutfile (line 76) | def test_start_new_page_should_create_a_new_page_using_a_specified_lay...
method test_start_new_page_with_count_option (line 81) | def test_start_new_page_with_count_option
method test_add_blank_page_should_properly_create_a_new_blank_page (line 97) | def test_add_blank_page_should_properly_create_a_new_blank_page
method test_layout_should_return_the_default_layout_with_no_arguments (line 103) | def test_layout_should_return_the_default_layout_with_no_arguments
method test_layout_should_raise_when_the_specified_layout_is_not_found (line 109) | def test_layout_should_raise_when_the_specified_layout_is_not_found
method test_layout_should_return_the_layout_with_specified_id (line 115) | def test_layout_should_return_the_layout_with_specified_id
method test_generate (line 121) | def test_generate
method test_generate_when_title_argument_is_specified (line 137) | def test_generate_when_title_argument_is_specified
method test_page_should_return_the_current_page (line 144) | def test_page_should_return_the_current_page
method test_page_count_should_return_total_page_count (line 151) | def test_page_count_should_return_total_page_count
method test_finalize_should_finalize_report (line 158) | def test_finalize_should_finalize_report
method test_finalized_asker_should_return_false_when_report_has_not_been_finalized_yet (line 163) | def test_finalized_asker_should_return_false_when_report_has_not_been_...
method test_finalized_asker_should_return_true_when_report_is_already_finalized (line 167) | def test_finalized_asker_should_return_true_when_report_is_already_fin...
method test_list_should_create_new_page_when_page_is_not_created (line 172) | def test_list_should_create_new_page_when_page_is_not_created
method test_list_should_create_new_page_when_page_is_finalized (line 179) | def test_list_should_create_new_page_when_page_is_finalized
method test_list_should_properly_return_shape_with_the_specified_id (line 190) | def test_list_should_properly_return_shape_with_the_specified_id
method test_start_page_number (line 196) | def test_start_page_number
method test_Base_create_should_finalize_report (line 202) | def test_Base_create_should_finalize_report
method test_Base_create_should_raise_when_no_block_given (line 209) | def test_Base_create_should_raise_when_no_block_given
method test_Base_generate_should_raise_when_no_block_given (line 215) | def test_Base_generate_should_raise_when_no_block_given
method test_Base_generate_with_deprecated_arguments (line 221) | def test_Base_generate_with_deprecated_arguments
method test_Base_generate_argument_priority (line 238) | def test_Base_generate_argument_priority
method test_Base_generate_when_title_argument_is_specified (line 258) | def test_Base_generate_when_title_argument_is_specified
FILE: test/basic_report/units/report/test_internal.rb
class Thinreports::BasicReport::Report::TestInternal (line 5) | class Thinreports::BasicReport::Report::TestInternal < Minitest::Test
method setup (line 10) | def setup
method report (line 14) | def report
method test_layout_specified_in_new_method_should_be_defined_as_default_layout (line 18) | def test_layout_specified_in_new_method_should_be_defined_as_default_l...
method test_pathname_layout_specified_in_new_method_should_be_defined_as_default_layout (line 23) | def test_pathname_layout_specified_in_new_method_should_be_defined_as_...
method test_register_layout_should_be_set_as_default_layout_when_options_are_omitted (line 28) | def test_register_layout_should_be_set_as_default_layout_when_options_...
method test_register_layout_should_be_set_as_default_layout_when_default_option_is_true (line 35) | def test_register_layout_should_be_set_as_default_layout_when_default_...
method test_register_layout_should_be_able_to_change_the_default_layout (line 42) | def test_register_layout_should_be_able_to_change_the_default_layout
method test_register_layout_should_be_set_as_with_id_when_id_option_is_set (line 49) | def test_register_layout_should_be_set_as_with_id_when_id_option_is_set
method test_register_layout_should_raise_an_error_when_id_is_already_registered (line 56) | def test_register_layout_should_raise_an_error_when_id_is_already_regi...
method test_add_page_should_finalize_the_current_page (line 65) | def test_add_page_should_finalize_the_current_page
method test_add_page_should_return_the_current_page (line 75) | def test_add_page_should_return_the_current_page
method test_add_page_should_add_the_initialized_page (line 84) | def test_add_page_should_add_the_initialized_page
method test_add_page_should_count_up_the_total_page_count (line 94) | def test_add_page_should_count_up_the_total_page_count
method test_add_page_should_switch_to_a_reference_to_the_current_page (line 103) | def test_add_page_should_switch_to_a_reference_to_the_current_page
method test_add_blank_page_should_not_count_up_the_total_page_count_when_count_is_disabled (line 119) | def test_add_blank_page_should_not_count_up_the_total_page_count_when_...
method test_add_blank_page_should_count_up_the_total_page_count_when_count_is_enabled (line 126) | def test_add_blank_page_should_count_up_the_total_page_count_when_coun...
method test_finalize_should_finalize_the_report (line 133) | def test_finalize_should_finalize_the_report
method test_finalize_should_not_work_when_report_is_already_finalized (line 140) | def test_finalize_should_not_work_when_report_is_already_finalized
method test_finalized_should_return_true_when_report_is_already_finalized (line 149) | def test_finalized_should_return_true_when_report_is_already_finalized
method test_load_layout_with_String (line 156) | def test_load_layout_with_String
method test_load_layout_with_id (line 163) | def test_load_layout_with_id
method test_load_layout_with_unknown_id (line 171) | def test_load_layout_with_unknown_id
method test_load_layout_should_set_default_layout_when_default_layout_is_nil (line 176) | def test_load_layout_should_set_default_layout_when_default_layout_is_nil
method test_load_layout_should_raise_error_when_invalid_value_set (line 184) | def test_load_layout_should_raise_error_when_invalid_value_set
method test_copy_page_should_finalize_current_page (line 192) | def test_copy_page_should_finalize_current_page
method test_copy_page_should_add_the_copied_page (line 202) | def test_copy_page_should_add_the_copied_page
FILE: test/basic_report/units/test_layout.rb
class Thinreports::BasicReport::TestLayout (line 5) | class Thinreports::BasicReport::TestLayout < Minitest::Test
method test_new (line 8) | def test_new
FILE: test/basic_report/units/test_report.rb
class Thinreports::BasicReport::TestReport (line 5) | class Thinreports::BasicReport::TestReport < Minitest::Test
method test_new (line 11) | def test_new
method test_create (line 16) | def test_create
method test_generate (line 21) | def test_generate
FILE: test/feature_test.rb
type Thinreports (line 10) | module Thinreports
type FeatureTest (line 11) | module FeatureTest
function [] (line 12) | def self.[](base_dir)
class Base (line 22) | class Base < Minitest::Test
method feature (line 24) | def feature(&block)
method dir (line 29) | def dir
method path_of (line 33) | def path_of(filename)
method assert_pdf (line 37) | def assert_pdf(actual)
method template_path (line 49) | def template_path(filename = 'template.tlf')
method actual_pdf (line 55) | def actual_pdf
method expect_pdf (line 59) | def expect_pdf
FILE: test/main/test_config.rb
class Thinreports::TestConfig (line 5) | class Thinreports::TestConfig < Minitest::Test
method test_config_should_return_configuration_of_thinreports (line 6) | def test_config_should_return_configuration_of_thinreports
method test_configure_should_exec_an_given_block_with_config_which_instance_of_Configuration (line 10) | def test_configure_should_exec_an_given_block_with_config_which_instan...
method test_fallback_fonts (line 16) | def test_fallback_fonts
FILE: test/section_report/features/basic/test_feature.rb
class Thinreports::SectionReport::TestBasicFeature (line 5) | class Thinreports::SectionReport::TestBasicFeature < Thinreports::Featur...
method setup (line 6) | def setup
method build_details (line 35) | def build_details
method initialize_data (line 60) | def initialize_data
FILE: test/section_report/features/item_follow_stretch/test_feature.rb
class Thinreports::SectionReport::TestItemFollowStretchFeature (line 5) | class Thinreports::SectionReport::TestItemFollowStretchFeature < Thinrep...
FILE: test/section_report/features/item_parameters/test_feature.rb
class Thinreports::SectionReport::TestItemParametersFeature (line 5) | class Thinreports::SectionReport::TestItemParametersFeature < Thinreport...
method image_block_jpg (line 118) | def image_block_jpg
FILE: test/section_report/features/multiple_groups/test_feature.rb
class Thinreports::SectionReport::TestMultipleGroupsFeature (line 5) | class Thinreports::SectionReport::TestMultipleGroupsFeature < Thinreport...
FILE: test/section_report/features/nonexistent_id/test_feature.rb
class Thinreports::SectionReport::TestNonExistentIdFeature (line 5) | class Thinreports::SectionReport::TestNonExistentIdFeature < Thinreports...
FILE: test/section_report/features/section_auto_stretch/test_feature.rb
class Thinreports::SectionReport::TestSectionAutoStretchFeature (line 5) | class Thinreports::SectionReport::TestSectionAutoStretchFeature < Thinre...
method image50x50 (line 94) | def image50x50
FILE: test/section_report/features/section_bottom_margin/test_feature.rb
class Thinreports::SectionReport::TestSectionBottomMarginFeature (line 5) | class Thinreports::SectionReport::TestSectionBottomMarginFeature < Thinr...
FILE: test/section_report/features/section_parameters/test_feature.rb
class Thinreports::SectionReport::TestSectionParametersFeature (line 5) | class Thinreports::SectionReport::TestSectionParametersFeature < Thinrep...
FILE: test/section_report/features/stack_view/test_feature.rb
class Thinreports::SectionReport::TestStackViewFeature (line 5) | class Thinreports::SectionReport::TestStackViewFeature < Thinreports::Fe...
FILE: test/section_report/features/stack_view_row_auto_stretch/test_feature.rb
class Thinreports::SectionReport::TestStackViewRowAutoStretchFeature (line 5) | class Thinreports::SectionReport::TestStackViewRowAutoStretchFeature < T...
method image50x50 (line 75) | def image50x50
FILE: test/section_report/features/stack_view_row_bottom_margin/test_feature.rb
class Thinreports::SectionReport::TestStackViewRowBottomMarginFeature (line 5) | class Thinreports::SectionReport::TestStackViewRowBottomMarginFeature < ...
FILE: test/section_report/features/stack_view_row_parameters/test_feature.rb
class Thinreports::SectionReport::TestStackViewRowParametersFeature (line 5) | class Thinreports::SectionReport::TestStackViewRowParametersFeature < Th...
FILE: test/section_report/features/stack_view_with_floating_item/test_feature.rb
class Thinreports::SectionReport::TestStackViewWithFloatingItemFeature (line 5) | class Thinreports::SectionReport::TestStackViewWithFloatingItemFeature <...
method image50x50 (line 50) | def image50x50
FILE: test/section_report/features/text_block_vertical_align/test_feature.rb
class Thinreports::SectionReport::TestTextBlockVerticalAlignFeature (line 5) | class Thinreports::SectionReport::TestTextBlockVerticalAlignFeature < Th...
Condensed preview — 271 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (983K chars).
[
{
"path": ".github/CONTRIBUTING.md",
"chars": 209,
"preview": "We only accept bug reports and pull requests in GitHub.\nIf you have a support question about how to use thinreports, ple"
},
{
"path": ".github/dependabot.yml",
"chars": 434,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/workflows/test.yml",
"chars": 1088,
"preview": "name: Test\n\non:\n push:\n branches:\n - main\n - \"dev**\"\n pull_request:\n\njobs:\n setup:\n name: Ruby ${{ ma"
},
{
"path": ".gitignore",
"chars": 68,
"preview": "Gemfile.lock\n*.gem\n*.pdf\n.bundle\n.yardoc\ndoc\n!/test/**/*/expect.pdf\n"
},
{
"path": "CHANGELOG.md",
"chars": 12393,
"preview": "## main (Unreleased)\n\n## 0.14.2\n\nChanges:\n\n* Add base64 and bigdecimal to the gemspec #133\n* Remove matrix gem version c"
},
{
"path": "Gemfile",
"chars": 411,
"preview": "# frozen_string_literal: true\n\nsource 'https://rubygems.org'\ngit_source(:github) { |repo| \"https://github.com/#{repo}.gi"
},
{
"path": "LICENSE.txt",
"chars": 1084,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Matsukei Co.,Ltd.\n\nPermission is hereby granted, free of charge, to any person"
},
{
"path": "README.md",
"chars": 7947,
"preview": "# Thinreports Generator\n\n[](http://badge.fury.io/rb/thinreports)"
},
{
"path": "Rakefile",
"chars": 742,
"preview": "require 'bundler/gem_tasks'\nrequire 'rake/testtask'\n\ntask default: :test\n\nRake::TestTask.new do |t|\n t.name = 'test:mai"
},
{
"path": "fonts/IPA_Font_License_Agreement_v1.0.txt",
"chars": 13118,
"preview": "--------------------------------------------------\r\nIPA Font License Agreement v1.0 <Japanese/English>\r\n---------------"
},
{
"path": "gemfiles/prawn-2.4.gemfile",
"chars": 76,
"preview": "source 'https://rubygems.org'\n\ngem 'prawn', '~> 2.4.0'\n\ngemspec path: '../'\n"
},
{
"path": "gemfiles/prawn-2.5.gemfile",
"chars": 77,
"preview": "source 'https://rubygems.org'\n\ngem 'prawn', '~> 2.5.0'\n\ngemspec path: '../'\n\n"
},
{
"path": "lib/thinreports/basic_report/core/errors.rb",
"chars": 1582,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Errors\n class Basic < ::StandardE"
},
{
"path": "lib/thinreports/basic_report/core/format/base.rb",
"chars": 2356,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Format\n # @ab"
},
{
"path": "lib/thinreports/basic_report/core/shape/base/interface.rb",
"chars": 1195,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/base/internal.rb",
"chars": 1259,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/base.rb",
"chars": 121,
"preview": "# frozen_string_literal: true\n\nrequire 'forwardable'\n\nrequire_relative 'base/internal'\nrequire_relative 'base/interface'"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic/block_format.rb",
"chars": 258,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic/block_interface.rb",
"chars": 776,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic/block_internal.rb",
"chars": 743,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic/format.rb",
"chars": 541,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic/interface.rb",
"chars": 2346,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic/internal.rb",
"chars": 585,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/basic.rb",
"chars": 446,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/image_block/format.rb",
"chars": 230,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/image_block/interface.rb",
"chars": 574,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/image_block/internal.rb",
"chars": 378,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/image_block.rb",
"chars": 328,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/format.rb",
"chars": 2950,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/manager.rb",
"chars": 8040,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/page.rb",
"chars": 4062,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/page_state.rb",
"chars": 1064,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/section_format.rb",
"chars": 964,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/section_interface.rb",
"chars": 1622,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list/section_internal.rb",
"chars": 714,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/list.rb",
"chars": 447,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/manager/format.rb",
"chars": 673,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/manager/internal.rb",
"chars": 3425,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/manager/target.rb",
"chars": 3985,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/manager.rb",
"chars": 135,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'manager/format'\nrequire_relative 'manager/target'\nrequire_relative 'man"
},
{
"path": "lib/thinreports/basic_report/core/shape/page_number/format.rb",
"chars": 756,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/page_number/interface.rb",
"chars": 725,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/page_number/internal.rb",
"chars": 1429,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/page_number.rb",
"chars": 328,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/stack_view/format.rb",
"chars": 566,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/stack_view/interface.rb",
"chars": 367,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/stack_view/internal.rb",
"chars": 466,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/stack_view/row_format.rb",
"chars": 1038,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/stack_view.rb",
"chars": 372,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/style/base.rb",
"chars": 4487,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/style/basic.rb",
"chars": 524,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/style/graphic.rb",
"chars": 1189,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/style/text.rb",
"chars": 3780,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/style.rb",
"chars": 155,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'style/base'\nrequire_relative 'style/basic'\nrequire_relative 'style/grap"
},
{
"path": "lib/thinreports/basic_report/core/shape/text/format.rb",
"chars": 372,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text/interface.rb",
"chars": 445,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text/internal.rb",
"chars": 493,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text.rb",
"chars": 294,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/format.rb",
"chars": 1574,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/formatter/basic.rb",
"chars": 838,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/formatter/datetime.rb",
"chars": 567,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/formatter/number.rb",
"chars": 1996,
"preview": "# frozen_string_literal: true\n\nrequire 'bigdecimal'\n\nmodule Thinreports\n module BasicReport\n module Core\n modul"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb",
"chars": 707,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/formatter.rb",
"chars": 1094,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/interface.rb",
"chars": 957,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block/internal.rb",
"chars": 1853,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape/text_block.rb",
"chars": 363,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n module"
},
{
"path": "lib/thinreports/basic_report/core/shape.rb",
"chars": 1222,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Core\n module Shape\n def In"
},
{
"path": "lib/thinreports/basic_report/core/utils.rb",
"chars": 888,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Utils\n def self.included(klass)\n "
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/draw_shape.rb",
"chars": 4417,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb",
"chars": 2389,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/font.rb",
"chars": 2686,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/graphics/attributes.rb",
"chars": 5624,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/graphics/basic.rb",
"chars": 4294,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/graphics/image.rb",
"chars": 3225,
"preview": "# frozen_string_literal: true\n\nrequire 'tempfile'\nrequire 'base64'\nrequire 'digest/md5'\n\nmodule Thinreports\n module Bas"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/graphics/text.rb",
"chars": 6640,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/graphics.rb",
"chars": 1069,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/page.rb",
"chars": 3052,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document/parse_color.rb",
"chars": 1356,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/document.rb",
"chars": 3611,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'document/font'\nrequire_relative 'document/parse_color'\nrequire_relative"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/drawer/base.rb",
"chars": 1488,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/drawer/list.rb",
"chars": 2238,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/drawer/list_section.rb",
"chars": 1542,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/drawer/page.rb",
"chars": 3884,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n class PDF\n modu"
},
{
"path": "lib/thinreports/basic_report/generator/pdf/prawn_ext/calc_image_dimensions.rb",
"chars": 1138,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n module PrawnExt\n "
},
{
"path": "lib/thinreports/basic_report/generator/pdf/prawn_ext/width_of.rb",
"chars": 814,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Generator\n module PrawnExt\n "
},
{
"path": "lib/thinreports/basic_report/generator/pdf/prawn_ext.rb",
"chars": 163,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'prawn_ext/width_of'\nrequire_relative 'prawn_ext/calc_image_dimensions'\n"
},
{
"path": "lib/thinreports/basic_report/generator/pdf.rb",
"chars": 1742,
"preview": "# frozen_string_literal: true\n\nrequire 'prawn'\nrequire 'prawn/disable_word_break'\n\nPrawn::DisableWordBreak.config.defaul"
},
{
"path": "lib/thinreports/basic_report/layout/base.rb",
"chars": 1337,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Layout\n class Base\n EXT_NA"
},
{
"path": "lib/thinreports/basic_report/layout/format.rb",
"chars": 2004,
"preview": "# frozen_string_literal: true\n\nrequire 'json'\n\nmodule Thinreports\n module BasicReport\n module Layout\n class For"
},
{
"path": "lib/thinreports/basic_report/layout/legacy_schema.rb",
"chars": 13999,
"preview": "# frozen_string_literal: true\n\nrequire 'json'\nrequire 'rexml/document'\n\nmodule Thinreports\n module BasicReport\n modu"
},
{
"path": "lib/thinreports/basic_report/layout/version.rb",
"chars": 902,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Layout\n class Version\n COM"
},
{
"path": "lib/thinreports/basic_report/layout.rb",
"chars": 398,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Layout\n # @see Thinreports::Basic"
},
{
"path": "lib/thinreports/basic_report/report/base.rb",
"chars": 6389,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Report\n class Base\n extend"
},
{
"path": "lib/thinreports/basic_report/report/internal.rb",
"chars": 2824,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Report\n class Internal\n at"
},
{
"path": "lib/thinreports/basic_report/report/page.rb",
"chars": 2479,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Report\n class BlankPage\n #"
},
{
"path": "lib/thinreports/basic_report/report.rb",
"chars": 620,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module BasicReport\n module Report\n # @see Thinreports::Basic"
},
{
"path": "lib/thinreports/basic_report.rb",
"chars": 463,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'basic_report/core/utils'\nrequire_relative 'basic_report/core/errors'\nre"
},
{
"path": "lib/thinreports/config.rb",
"chars": 914,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n # @yield [config]\n # @yieldparam [Thinreports::Configuration] confi"
},
{
"path": "lib/thinreports/section_report/build.rb",
"chars": 756,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'schema/loader'\nrequire_relative 'builder/report_builder'\n\nmodule Thinre"
},
{
"path": "lib/thinreports/section_report/builder/item_builder.rb",
"chars": 1179,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'stack_view_builder'\n\nmodule Thinreports\n module SectionReport\n modu"
},
{
"path": "lib/thinreports/section_report/builder/report_builder.rb",
"chars": 2539,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'report_data'\nrequire_relative 'item_builder'\n\nmodule Thinreports\n modu"
},
{
"path": "lib/thinreports/section_report/builder/report_data.rb",
"chars": 301,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module SectionReport\n module Builder\n module ReportData\n "
},
{
"path": "lib/thinreports/section_report/builder/stack_view_builder.rb",
"chars": 1367,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'stack_view_data'\n\nmodule Thinreports\n module SectionReport\n module "
},
{
"path": "lib/thinreports/section_report/builder/stack_view_data.rb",
"chars": 201,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module SectionReport\n module Builder\n module StackViewData\n "
},
{
"path": "lib/thinreports/section_report/generate.rb",
"chars": 499,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'build'\nrequire_relative 'pdf/render'\n\nmodule Thinreports\n module Secti"
},
{
"path": "lib/thinreports/section_report/pdf/render.rb",
"chars": 451,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'renderer/group_renderer'\n\nmodule Thinreports\n module SectionReport\n "
},
{
"path": "lib/thinreports/section_report/pdf/renderer/draw_item.rb",
"chars": 2774,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module SectionReport\n module Renderer\n module DrawItem\n "
},
{
"path": "lib/thinreports/section_report/pdf/renderer/group_renderer.rb",
"chars": 1782,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'section_renderer'\n\nmodule Thinreports\n module SectionReport\n module"
},
{
"path": "lib/thinreports/section_report/pdf/renderer/section_height.rb",
"chars": 3925,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module SectionReport\n module Renderer\n module SectionHeight\n"
},
{
"path": "lib/thinreports/section_report/pdf/renderer/section_renderer.rb",
"chars": 882,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'stack_view_renderer'\nrequire_relative 'section_height'\nrequire_relative"
},
{
"path": "lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb",
"chars": 1442,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'stack_view_row_renderer'\n\nmodule Thinreports\n module SectionReport\n "
},
{
"path": "lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb",
"chars": 856,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'section_height'\nrequire_relative 'draw_item'\n\nmodule Thinreports\n modu"
},
{
"path": "lib/thinreports/section_report/schema/loader.rb",
"chars": 497,
"preview": "# frozen_string_literal: true\n\nrequire_relative 'parser'\n\nmodule Thinreports\n module SectionReport\n module Schema\n "
},
{
"path": "lib/thinreports/section_report/schema/parser.rb",
"chars": 1603,
"preview": "# frozen_string_literal: true\n\nrequire 'json'\n\nrequire_relative 'report'\nrequire_relative 'section'\n\nmodule Thinreports\n"
},
{
"path": "lib/thinreports/section_report/schema/report.rb",
"chars": 881,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module SectionReport\n module Schema\n class Report < Core::Sh"
},
{
"path": "lib/thinreports/section_report/schema/section.rb",
"chars": 1071,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n module SectionReport\n module Schema\n module Section\n "
},
{
"path": "lib/thinreports/section_report.rb",
"chars": 291,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n Core = BasicReport::Core\n Generator = BasicReport::Generator\n\n def"
},
{
"path": "lib/thinreports/version.rb",
"chars": 75,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports\n VERSION = '0.14.2'\nend\n"
},
{
"path": "lib/thinreports.rb",
"chars": 318,
"preview": "# frozen_string_literal: true\n\nrequire 'pathname'\n\nmodule Thinreports\n def self.root\n @root ||= Pathname.new(__FILE_"
},
{
"path": "test/basic_report/data/legacy_layout/all-items.tlf",
"chars": 35263,
"preview": "{\"version\":\"0.8.2\",\"config\":{\"title\":\"Report Title\",\"option\":{},\"page\":{\"paper-type\":\"A4\",\"orientation\":\"portrait\",\"marg"
},
{
"path": "test/basic_report/features/dynamic_style/templates/styles.tlf",
"chars": 39472,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/dynamic_style/templates/styles_in_list.tlf",
"chars": 8445,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"list\",\n \"type\": \"list\",\n \"display\": true,\n \"descr"
},
{
"path": "test/basic_report/features/dynamic_style/test_feature.rb",
"chars": 5486,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestDynamicStyleFeature < Thinrepo"
},
{
"path": "test/basic_report/features/eudc/template.tlf",
"chars": 3764,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/eudc/test_feature.rb",
"chars": 639,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestEudcFeature < Thinreports::Fea"
},
{
"path": "test/basic_report/features/graphics/template.tlf",
"chars": 6243,
"preview": "{\n \"version\": \"0.10.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"rect\",\n \"display\": true,\n \"descript"
},
{
"path": "test/basic_report/features/graphics/test_feature.rb",
"chars": 295,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestGraphicsFeature < Thinreports:"
},
{
"path": "test/basic_report/features/hidden_item/template.tlf",
"chars": 35739,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"rect\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/hidden_item/test_feature.rb",
"chars": 314,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestHiddenItemFeature < Thinreport"
},
{
"path": "test/basic_report/features/image_block/template.tlf",
"chars": 13662,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"rect\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/image_block/test_feature.rb",
"chars": 1008,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\nrequire 'open-uri'\nrequire 'openssl'\n\nclass Thinreports::BasicRepor"
},
{
"path": "test/basic_report/features/list_events/template.tlf",
"chars": 8779,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"default\",\n \"type\": \"list\",\n \"display\": true,\n \"de"
},
{
"path": "test/basic_report/features/list_events/test_feature.rb",
"chars": 909,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestListEventsFeature < Thinreport"
},
{
"path": "test/basic_report/features/list_manually/template.tlf",
"chars": 2999,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"default\",\n \"type\": \"list\",\n \"display\": true,\n \"de"
},
{
"path": "test/basic_report/features/list_manually/test_feature.rb",
"chars": 607,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestListManuallyFeature < Thinrepo"
},
{
"path": "test/basic_report/features/page_number/template.tlf",
"chars": 4307,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"pageno\",\n \"type\": \"page-number\",\n \"display\": true,\n "
},
{
"path": "test/basic_report/features/page_number/test_feature.rb",
"chars": 658,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestPageNumberFeature < Thinreport"
},
{
"path": "test/basic_report/features/page_number_with_list/template.tlf",
"chars": 5541,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"default\",\n \"type\": \"list\",\n \"display\": true,\n \"de"
},
{
"path": "test/basic_report/features/page_number_with_list/test_feature.rb",
"chars": 507,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestPageNumberWithListFeature < Th"
},
{
"path": "test/basic_report/features/palleted_png/template.tlf",
"chars": 1415,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"image\",\n \"display\": true,\n \"descript"
},
{
"path": "test/basic_report/features/palleted_png/test_feature.rb",
"chars": 374,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestPalletedPngFeature < Thinrepor"
},
{
"path": "test/basic_report/features/report_callbacks/template.tlf",
"chars": 3033,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"text1\",\n \"type\": \"text-block\",\n \"display\": true,\n "
},
{
"path": "test/basic_report/features/report_callbacks/test_feature.rb",
"chars": 434,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestReportCallbacksFeature < Thinr"
},
{
"path": "test/basic_report/features/text_align/template.tlf",
"chars": 4713,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/text_align/test_feature.rb",
"chars": 296,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextAlignFeature < Thinreports"
},
{
"path": "test/basic_report/features/text_block_formatting/template.tlf",
"chars": 19913,
"preview": "{\n \"version\": \"0.10.0\",\n \"items\": [\n {\n \"id\": \"basic\",\n \"type\": \"text-block\",\n \"display\": true,\n "
},
{
"path": "test/basic_report/features/text_block_formatting/test_feature.rb",
"chars": 1440,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\nrequire 'date'\n\nclass Thinreports::BasicReport::TestTextBlockFormat"
},
{
"path": "test/basic_report/features/text_block_overflow/template.tlf",
"chars": 11425,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"rect\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/text_block_overflow/test_feature.rb",
"chars": 1003,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextBlockOverflowFeature < Thi"
},
{
"path": "test/basic_report/features/text_block_singleline/template.tlf",
"chars": 3501,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"fallback_to_ipafont\",\n \"type\": \"text-block\",\n \"display"
},
{
"path": "test/basic_report/features/text_block_singleline/test_feature.rb",
"chars": 455,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextBlockSinglelineFeature < T"
},
{
"path": "test/basic_report/features/text_block_style/templates/basic_styles.tlf",
"chars": 18839,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/text_block_style/templates/font_size.tlf",
"chars": 7992,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/text_block_style/test_feature.rb",
"chars": 1803,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextBlockStyleFeature < Thinre"
},
{
"path": "test/basic_report/features/text_character_spacing/template.tlf",
"chars": 5687,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descripti"
},
{
"path": "test/basic_report/features/text_character_spacing/test_feature.rb",
"chars": 307,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextCharacterSpacingFeature < "
},
{
"path": "test/basic_report/features/text_overflow_wrap/template.tlf",
"chars": 5067,
"preview": "{\n \"version\": \"0.12.0\",\n \"items\": [\n {\n \"id\": \"\",\n \"type\": \"text\",\n \"display\": true,\n \"descript"
},
{
"path": "test/basic_report/features/text_overflow_wrap/test_feature.rb",
"chars": 634,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextOverflowWrapFeature < Thin"
},
{
"path": "test/basic_report/features/text_word_wrap/template.tlf",
"chars": 6159,
"preview": "{\n \"version\": \"0.9.0\",\n \"items\": [\n {\n \"id\": \"single_none\",\n \"type\": \"text-block\",\n \"display\": true,"
},
{
"path": "test/basic_report/features/text_word_wrap/test_feature.rb",
"chars": 902,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::TestTextWordWrapFeature < Thinrepo"
},
{
"path": "test/basic_report/schema_helper.rb",
"chars": 3419,
"preview": "# frozen_string_literal: true\n\nmodule Thinreports::BasicReport::SchemaHelper\n BASIC_SCHEMA_JSON = <<-EOF\n {\n \"versi"
},
{
"path": "test/basic_report/test_helper.rb",
"chars": 1122,
"preview": "# frozen_string_literal: true\n\nrequire 'minitest/autorun'\nrequire 'minitest/spec'\nrequire 'minitest/unit'\nrequire 'mocha"
},
{
"path": "test/basic_report/units/core/format/test_base.rb",
"chars": 3701,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Format::BaseTest < Minitest:"
},
{
"path": "test/basic_report/units/core/shape/base/test_internal.rb",
"chars": 2750,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Base::TestInternal < "
},
{
"path": "test/basic_report/units/core/shape/basic/test_block_format.rb",
"chars": 516,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Basic::TestBlockForma"
},
{
"path": "test/basic_report/units/core/shape/basic/test_block_interface.rb",
"chars": 859,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Basic::TestBlockInter"
},
{
"path": "test/basic_report/units/core/shape/basic/test_block_internal.rb",
"chars": 1724,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Basic::TestBlockInter"
},
{
"path": "test/basic_report/units/core/shape/basic/test_format.rb",
"chars": 876,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Basic::TestFormat < M"
},
{
"path": "test/basic_report/units/core/shape/basic/test_interface.rb",
"chars": 3259,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Basic::TestInterface "
},
{
"path": "test/basic_report/units/core/shape/basic/test_internal.rb",
"chars": 1744,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Basic::TestInternal <"
},
{
"path": "test/basic_report/units/core/shape/image_block/test_interface.rb",
"chars": 681,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::ImageBlock::TestInter"
},
{
"path": "test/basic_report/units/core/shape/image_block/test_internal.rb",
"chars": 932,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::ImageBlock::TestInter"
},
{
"path": "test/basic_report/units/core/shape/list/test_format.rb",
"chars": 3289,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestFormat < Mi"
},
{
"path": "test/basic_report/units/core/shape/list/test_manager.rb",
"chars": 1978,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestManager < M"
},
{
"path": "test/basic_report/units/core/shape/list/test_page.rb",
"chars": 4015,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestPage < Mini"
},
{
"path": "test/basic_report/units/core/shape/list/test_page_state.rb",
"chars": 662,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestPageState <"
},
{
"path": "test/basic_report/units/core/shape/list/test_section_format.rb",
"chars": 1001,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestSectionForm"
},
{
"path": "test/basic_report/units/core/shape/list/test_section_interface.rb",
"chars": 2159,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestSectionInte"
},
{
"path": "test/basic_report/units/core/shape/list/test_section_internal.rb",
"chars": 1332,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::List::TestSectionInte"
},
{
"path": "test/basic_report/units/core/shape/manager/test_format.rb",
"chars": 1253,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Manager::TestFormat <"
},
{
"path": "test/basic_report/units/core/shape/manager/test_internal.rb",
"chars": 4640,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Manager::TestInternal"
},
{
"path": "test/basic_report/units/core/shape/manager/test_target.rb",
"chars": 4345,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Manager::TestTarget <"
},
{
"path": "test/basic_report/units/core/shape/page_number/test_format.rb",
"chars": 1533,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::PageNumber::TestForma"
},
{
"path": "test/basic_report/units/core/shape/page_number/test_interface.rb",
"chars": 863,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::PageNumber::TestInter"
},
{
"path": "test/basic_report/units/core/shape/page_number/test_internal.rb",
"chars": 2112,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::PageNumber::TestInter"
},
{
"path": "test/basic_report/units/core/shape/styles/test_base.rb",
"chars": 6020,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Style::TestBase < Min"
},
{
"path": "test/basic_report/units/core/shape/styles/test_basic.rb",
"chars": 721,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Style::TestBasic < Mi"
},
{
"path": "test/basic_report/units/core/shape/styles/test_graphic.rb",
"chars": 1492,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Style::TestGraphic < "
},
{
"path": "test/basic_report/units/core/shape/styles/test_text.rb",
"chars": 2644,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Style::TestText < Min"
},
{
"path": "test/basic_report/units/core/shape/text/test_format.rb",
"chars": 1095,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Text::TestFormat < Mi"
},
{
"path": "test/basic_report/units/core/shape/text/test_internal.rb",
"chars": 572,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::Text::TestInternal < "
},
{
"path": "test/basic_report/units/core/shape/text_block/formatter/test_basic.rb",
"chars": 715,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::Formatter:"
},
{
"path": "test/basic_report/units/core/shape/text_block/formatter/test_datetime.rb",
"chars": 1437,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::Formatter:"
},
{
"path": "test/basic_report/units/core/shape/text_block/formatter/test_number.rb",
"chars": 2617,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::Formatter:"
},
{
"path": "test/basic_report/units/core/shape/text_block/formatter/test_padding.rb",
"chars": 2640,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::Formatter:"
},
{
"path": "test/basic_report/units/core/shape/text_block/test_format.rb",
"chars": 4689,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::TestFormat"
},
{
"path": "test/basic_report/units/core/shape/text_block/test_formatter.rb",
"chars": 845,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::TestFormat"
},
{
"path": "test/basic_report/units/core/shape/text_block/test_interface.rb",
"chars": 1907,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::TestInterf"
},
{
"path": "test/basic_report/units/core/shape/text_block/test_internal.rb",
"chars": 4404,
"preview": "# frozen_string_literal: true\n\nrequire 'test_helper'\n\nclass Thinreports::BasicReport::Core::Shape::TextBlock::TestIntern"
}
]
// ... and 71 more files (download for full content)
About this extraction
This page contains the full source code of the thinreports/thinreports-generator GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 271 files (857.7 KB), approximately 251.6k tokens, and a symbol index with 1586 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.