jzimmek-reportme 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.3
1
+ 0.5.4
@@ -2,6 +2,7 @@ module Reportme
2
2
  class Report
3
3
 
4
4
  attr_accessor :name
5
+ attr_accessor :setup_callback
5
6
 
6
7
  def initialize(report_factory, name, temporary=false)
7
8
 
@@ -39,6 +40,10 @@ module Reportme
39
40
  @depends_on
40
41
  end
41
42
 
43
+ def setup(&block)
44
+ @setup_callback = block
45
+ end
46
+
42
47
  def sql(von, bis, period_name)
43
48
  raw = @source.call(von, bis, period_name)
44
49
 
@@ -58,7 +63,7 @@ module Reportme
58
63
  "#{prefix}#{name}_#{period}"
59
64
  end
60
65
 
61
-
66
+ def exec(sql); @report_factory.exec(sql); end
62
67
  def select_value(sql); @report_factory.select_value(sql); end
63
68
  def select_values(sql); @report_factory.select_values(sql); end
64
69
  def select_all(sql); @report_factory.select_all(sql); end
@@ -83,6 +83,8 @@ module Reportme
83
83
  exec("alter table #{table_name} add _day date after von;")
84
84
  exec("alter table #{table_name} add index(_day);")
85
85
  end
86
+
87
+ report.setup_callback.call(period_name) if report.setup_callback
86
88
  end
87
89
 
88
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jzimmek-reportme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Zimmek
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-06 00:00:00 -07:00
12
+ date: 2009-07-22 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15