minor fixes - reportable - Fork of reportable required by WarVox, from hdm/reportable.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 5fdb546b7974b9d166ff4e19bea82e7f3194287c
(DIR) parent 2779f214514f20de3c3d995f230e3155bd69740b
(HTM) Author: Marco Otte-Witte <marco.otte-witte@simplabs.com>
Date: Wed, 24 Feb 2010 21:51:39 +0100
minor fixes
Diffstat:
M Rakefile | 15 +++------------
M lib/saulabs/reportable.rb | 2 +-
M lib/saulabs/reportable/grouping.rb | 4 ++--
M lib/saulabs/reportable/report.rb | 2 +-
M lib/saulabs/reportable/report_cach… | 4 ++--
M lib/saulabs/reportable/reporting_p… | 20 ++++++++++----------
M lib/saulabs/reportable/sparkline_t… | 2 +-
7 files changed, 20 insertions(+), 29 deletions(-)
---
(DIR) diff --git a/Rakefile b/Rakefile
@@ -5,20 +5,11 @@ require 'spec/rake/spectask'
desc 'Default: run specs.'
task :default => :spec
-desc 'Run the specs on the CI server.'
-Spec::Rake::SpecTask.new(:ci) do |t|
- t.spec_opts << '--format=specdoc'
- t.spec_files = FileList['spec/**/*_spec.rb']
-end
-
desc 'Run the specs'
Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts << '--color'
- t.spec_opts << '--format=html:doc/spec.html'
- t.spec_opts << '--format=specdoc'
- t.rcov = true
- t.rcov_opts << '--exclude "gems/*,spec/*,init.rb"'
- t.rcov_dir = 'doc/coverage'
+ t.rcov_opts << '--exclude "gems/*,spec/*,init.rb"'
+ t.rcov = true
+ t.rcov_dir = 'doc/coverage'
t.spec_files = FileList['spec/**/*_spec.rb']
end
(DIR) diff --git a/lib/saulabs/reportable.rb b/lib/saulabs/reportable.rb
@@ -2,7 +2,7 @@ module Saulabs
module Reportable
- # Includes the {Saulabs::Reportable.reportable} method into +base+.
+ # Extends the {Saulabs::Reportable::ClassMethods#reportable} method into +base+.
#
def self.included(base)
base.extend ClassMethods
(DIR) diff --git a/lib/saulabs/reportable/grouping.rb b/lib/saulabs/reportable/grouping.rb
@@ -18,7 +18,7 @@ module Saulabs
# Gets the identifier of the grouping.
#
- # @returns [Symbol]
+ # @return [Symbol]
# the identifier of the grouping.
#
def identifier
@@ -30,7 +30,7 @@ module Saulabs
# @param [String] db_string
# the DB string to get the date parts from
#
- # @returns [Array<Fixnum>]
+ # @return [Array<Fixnum>]
# array of numbers that represent the values of the date
#
def date_parts_from_db_string(db_string)
(DIR) diff --git a/lib/saulabs/reportable/report.rb b/lib/saulabs/reportable/report.rb
@@ -90,7 +90,7 @@ module Saulabs
# @option options [DateTime, Boolean] :end_date (false)
# when specified, the report will only include data for the +:limit+ reporting periods until this date.
#
- # @returns [Array<Array<DateTime, Float>>]
+ # @return [Array<Array<DateTime, Float>>]
# the result of the report as pairs of {DateTime}s and {Float}s
#
def run(options = {})
(DIR) diff --git a/lib/saulabs/reportable/report_cache.rb b/lib/saulabs/reportable/report_cache.rb
@@ -2,7 +2,7 @@ module Saulabs
module Reportable
- # The +ReportCache+ class is a regular {ActiveRecord} model and represents cached results for single {Saulabs::Reportable::ReportingPeriod}s.
+ # The +ReportCache+ class is a regular +ActiveRecord+ model and represents cached results for single {Saulabs::Reportable::ReportingPeriod}s.
# +ReportCache+ instances are identified by the combination of +model_name+, +report_name+, +grouping+, +aggregation+ and +reporting_period+.
#
class ReportCache < ActiveRecord::Base
@@ -51,7 +51,7 @@ module Saulabs
# @option options [DateTime, Boolean] :end_date (false)
# when specified, the report will only include data for the +:limit+ reporting periods until this date.
#
- # @returns [Array<Array<DateTime, Float>>]
+ # @return [Array<Array<DateTime, Float>>]
# the result of the report as pairs of {DateTime}s and {Float}s
#
def self.process(report, options, &block)
(DIR) diff --git a/lib/saulabs/reportable/reporting_period.rb b/lib/saulabs/reportable/reporting_period.rb
@@ -6,7 +6,7 @@ module Saulabs
#
class ReportingPeriod
- # The actual {DateTime} the reporting period represents
+ # The actual +DateTime the reporting period represents
#
attr_reader :date_time
@@ -19,7 +19,7 @@ module Saulabs
# @param [Saulabs::Reportable::Grouping] grouping
# the grouping the generate the reporting period for
# @param [DateTime] date_time
- # the {DateTime} to generate the reporting period for
+ # the +DateTime+ to generate the reporting period for
#
def initialize(grouping, date_time = nil)
@grouping = grouping
@@ -31,7 +31,7 @@ module Saulabs
# @param [Fixnum] offset
# the offset to get the reporting period for
#
- # @returns [Saulabs::Reportable::ReportingPeriod]
+ # @return [Saulabs::Reportable::ReportingPeriod]
# the reporting period relative by offset to the current one
#
# @example Getting the reporting period one week later
@@ -52,7 +52,7 @@ module Saulabs
# @param [DateTime] end_date
# the end date to get the first reporting period for (the first reporting period is then +end_date+ - +limit+ * +grouping+)
#
- # @returns [Saulabs::Reportable::ReportingPeriod]
+ # @return [Saulabs::Reportable::ReportingPeriod]
# the first reporting period for the grouping, limit and optionally end date
#
def self.first(grouping, limit, end_date = nil)
@@ -66,7 +66,7 @@ module Saulabs
# @param [String] db_string
# the DB string to parse and get the reporting period for
#
- # @returns [Saulabs::Reportable::ReportingPeriod]
+ # @return [Saulabs::Reportable::ReportingPeriod]
# the reporting period for the {Saulabs::Reportable::Grouping} as parsed from the db string
#
def self.from_db_string(grouping, db_string)
@@ -86,7 +86,7 @@ module Saulabs
# Gets the next reporting period.
#
- # @returns [Saulabs::Reportable::ReportingPeriod]
+ # @return [Saulabs::Reportable::ReportingPeriod]
# the reporting period after the current one
#
def next
@@ -95,7 +95,7 @@ module Saulabs
# Gets the previous reporting period.
#
- # @returns [Saulabs::Reportable::ReportingPeriod]
+ # @return [Saulabs::Reportable::ReportingPeriod]
# the reporting period before the current one
#
def previous
@@ -107,7 +107,7 @@ module Saulabs
# @param [Saulabs::Reportable::ReportingPeriod] other
# the reporting period to check for whether it is equal to the current one
#
- # @returns [Boolean]
+ # @return [Boolean]
# true if +other+ is equal to the current reporting period, false otherwise
#
def ==(other)
@@ -125,7 +125,7 @@ module Saulabs
# @param [Saulabs::Reportable::ReportingPeriod] other
# the reporting period to check for whether it is smaller to the current one
#
- # @returns [Boolean]
+ # @return [Boolean]
# true if +other+ is smaller to the current reporting period, false otherwise
#
def <(other)
@@ -141,7 +141,7 @@ module Saulabs
# Gets the latest point in time that is included the reporting period. The latest point in time included in a reporting period
# for grouping hour would be that hour and 59 minutes and 59 seconds.
#
- # @returns [DateTime]
+ # @return [DateTime]
# the latest point in time that is included in the reporting period
#
def last_date_time
(DIR) diff --git a/lib/saulabs/reportable/sparkline_tag_helper.rb b/lib/saulabs/reportable/sparkline_tag_helper.rb
@@ -26,7 +26,7 @@ module Saulabs
# @option options [String] :title ('')
# the title attribute for the generated image
#
- # @returns [String]
+ # @return [String]
# an image tag showing a sparkline for the passed +data+
#
# @example Rendering a sparkline tag for report data