daily 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,8 +34,59 @@ class Metric
34
34
  val = settings[key.to_sym]
35
35
  val.blank? ? default : val
36
36
  end
37
+
38
+ def before_table
39
+
40
+ end
41
+
42
+ def before_creation
43
+
44
+ end
45
+
46
+ def column_names
47
+ []
48
+ end
37
49
 
50
+ def table_options
51
+ out = {}
52
+ cols = self.column_names
53
+ out[:column_names] = cols if cols and not cols.empty?
54
+ out
55
+ end
56
+
57
+ def create_table
58
+ Ruport::Data::Table.new(table_options)
59
+ end
60
+
61
+ def after_creation(table)
62
+
63
+ end
64
+
65
+ def before_rows(table)
66
+
67
+ end
68
+
69
+ def add_rows(table)
70
+
71
+ end
72
+
73
+ def after_rows(table)
74
+
75
+ end
76
+
77
+ def after_table(table)
78
+
79
+ end
80
+
38
81
  def result
39
- raise("Metrics must override result")
82
+ before_table
83
+ before_creation
84
+ out = create_table
85
+ after_creation(out)
86
+ before_rows(out)
87
+ add_rows(out)
88
+ after_rows(out)
89
+ after_table(out)
90
+ out
40
91
  end
41
92
  end
Binary file
@@ -1,3 +1,3 @@
1
1
  module Daily
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daily
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Leonard
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-11 00:00:00 -08:00
18
+ date: 2012-01-12 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency