0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Common Reporting Actions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 1.17
>= 5.0
>= 12.0
 Project Readme

ReportAction

tests

A collection of tools for structuring and building simple reports, which can be extracted as a structure or as text with html.

Installation

Add this line to your application's Gemfile:

gem 'report_action'

And then execute:

$ bundle

Or install it yourself as:

$ gem install report_action

Usage

First, initialize a new report structure:

my_report = ReportAction::Report.new

Then add items to your report using this syntax:

my_report.report_item(process, group, message)

For example:

my_report.report_item('Full Task Report', 'Tasks', 'This is a task')
my_report.report_item('Full Task Report', 'Tasks', 'This is another task')
my_report.report_item('Full Task Report', 'Results', 'This is a result.')
my_report.report_item('User Task Report For Ralph', 'Tasks', 'This is a different task.')

Build a report for a single process as text with html headers and paragraphs:

my_report.build_report('Full Task Report')

which returns:

<h1>Tasks</h1><p>This is a task</p><p>This is another task</p><h1>Results</h1><p>This is a result.</p>

List all processes in a report:

my_report.list_report_processes

Retrieve the full report structure:

structure = my_report.retrieve_report_structure

See if a report has messages for a given process and group:

my_report.has_messages?('Full Task Report', 'Tasks')

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, merge changes into main, pull changes locally into then main branch and then 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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/CraigJZ/report_action.

License

The gem is available as open source under the terms of the MIT License.