| nice Readme and History - reportable - Fork of reportable required by WarVox, f… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 947a3fec849491b5d2a242632151639589465ae7 | |
| parent ebb214c3a963311dd2eafa9cdc5796468603c504 | |
| Author: Marco Otte-Witte <[email protected]> | |
| Date: Thu, 25 Feb 2010 20:39:50 +0100 | |
| nice Readme and History | |
| Diffstat: | |
| M HISTORY.md | 4 ++-- | |
| M README.md | 88 +++++++++++++++++++++++++++++… | |
| 2 files changed, 88 insertions(+), 4 deletions(-) | |
| --- | |
| diff --git a/HISTORY.md b/HISTORY.md | |
| @@ -1,4 +1,4 @@ | |
| v1.0.0 | |
| ------ | |
| -* Initial release of the new Reportable gem (this was formerly ReportsAsSparkl… | |
| -\ No newline at end of file | |
| +* Initial release of the new Reportable gem (formerly known as the ReportsAsSp… | |
| +\ No newline at end of file | |
| diff --git a/README.md b/README.md | |
| @@ -1,4 +1,88 @@ | |
| Reportable | |
| ========== | |
| -Former ReportsAsSparkline; expect new features, cleaner code etc. in the next … | |
| -\ No newline at end of file | |
| +Reportable allows for the easy creation of reports based on `ActiveRecord` mod… | |
| + | |
| + | |
| +Usage | |
| +----- | |
| + | |
| +Usage is pretty easy. To declare a report on a model, simply define that the m… | |
| + | |
| + class User < ActiveRecord::Base | |
| + | |
| + reportable :registrations, :aggregation => :count | |
| + | |
| + end | |
| + | |
| +The `reportable` method takes a bunch more options which are described in the … | |
| +the number of updated users records per second or the number of registrations … | |
| + | |
| + class User < ActiveRecord::Base | |
| + | |
| + reportable :last_name_starting_with_a_registrations, :aggregation => :co… | |
| + | |
| + reportable :updated_per_second, :aggregation => :count, :grouping => :se… | |
| + | |
| + end | |
| + | |
| +For every declared report a method is generated on the model that returns the … | |
| + | |
| + User.registrations_report | |
| + | |
| + User.last_name_starting_with_a_registrations_report | |
| + | |
| + User.updated_per_second_report | |
| + | |
| + | |
| +Working with the data | |
| +--------------------- | |
| + | |
| +The data is returned as an `Array` of `Array`s of `DateTime`s and `Float`s, e.… | |
| + | |
| + [ | |
| + [DateTime.now, 1.0], | |
| + [DateTime.now - 1.day, 2.0], | |
| + [DateTime.now - 2.days, 3.0] | |
| + ] | |
| + | |
| +Reportable provides a helper method to generate a sparkline image from this da… | |
| + | |
| + <%= sparkline_tag(User.registrations_report) %> | |
| + | |
| + | |
| +Installation | |
| +------------ | |
| + | |
| +To install Reportable, simply run | |
| + | |
| + [sudo] gem install reportable | |
| + | |
| +and add it to your application's dependencies in your `environment.rb`: | |
| + | |
| + config.gem 'reportable', :lib => 'saulabs/reportable' | |
| + | |
| +When you installed the gem, you have to generate the migration that creates Re… | |
| + | |
| + ./script/generate reportable_migration create_reportable_cache | |
| + | |
| +and migrate: | |
| + | |
| + rake db:migrate | |
| + | |
| + | |
| +Plans | |
| +----- | |
| + | |
| +* add support for Oracle and MSSQL | |
| +* add support for DataMapper | |
| +* add more options to generate graphs from the data | |
| +* add the option to generate textual reports on the command line | |
| + | |
| + | |
| +Authors | |
| +------- | |
| + | |
| +© 2008-2010 Marco Otte-Witte (<http://simplabs.com>), Martin Kavalar (<http:/… | |
| + | |
| +Released under the MIT license | |
| +\ No newline at end of file |