tricle 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tricle/aggregation.rb +1 -1
- data/lib/tricle/templates/email.html.erb +6 -6
- data/lib/tricle/version.rb +1 -1
- data/spec/unit/aggregation_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0460bda7f826c939acd97c2e0334932b9f0ea64
|
4
|
+
data.tar.gz: 2d54ea7afaa2b7de1d75f281a4a875ebf3096501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0578353886fe5153797d77ef3082e2e90a741812a0381fa1e14844d865a23ec967f3ccfc169032317cff2e8b9d073b86fdccf5950aefea051be67c6bb14b6e88
|
7
|
+
data.tar.gz: be52787ddabd878a279254dcee7e529b7f300cdcac285cbfb89a652ee85d87f21bcd0dfee2e6760cf454ebcefa1f8cfe1a7d2a5d04d830872a7e7a38663c0e7e
|
data/lib/tricle/aggregation.rb
CHANGED
@@ -15,29 +15,29 @@
|
|
15
15
|
<tr>
|
16
16
|
<th><!--Title--></th>
|
17
17
|
<th>
|
18
|
-
<div>
|
19
|
-
<%=
|
18
|
+
<div>Quarterly average</div>
|
19
|
+
<%= quarter_dates_cell %>
|
20
20
|
</th>
|
21
21
|
<th>
|
22
22
|
<div>Previous week</div>
|
23
23
|
<%= previous_week_dates_cell %>
|
24
24
|
</th>
|
25
25
|
<th>
|
26
|
-
<div>
|
27
|
-
<%=
|
26
|
+
<div>Last week</div>
|
27
|
+
<%= last_week_dates_cell %>
|
28
28
|
</th>
|
29
29
|
</tr>
|
30
30
|
<% section.metrics.each do |metric| %>
|
31
31
|
<tr>
|
32
32
|
<th class="metric-title" rowspan="2"><%= metric.title %></th>
|
33
|
+
<%= percent_change_cell(metric.last_week, metric.week_average_this_quarter, metric.better) %>
|
34
|
+
<%= percent_change_cell(metric.last_week, metric.weeks_ago(2), metric.better) %>
|
33
35
|
<td>
|
34
36
|
<div><%= format_number(metric.last_week) %></div>
|
35
37
|
<% if metric.total? %>
|
36
38
|
<div><%= format_number(metric.total) %> (total)</div>
|
37
39
|
<% end %>
|
38
40
|
</td>
|
39
|
-
<%= percent_change_cell(metric.last_week, metric.weeks_ago(2), metric.better) %>
|
40
|
-
<%= percent_change_cell(metric.last_week, metric.week_average_this_quarter, metric.better) %>
|
41
41
|
</tr>
|
42
42
|
<tr>
|
43
43
|
<td colspan="3">
|
data/lib/tricle/version.rb
CHANGED
@@ -32,6 +32,13 @@ describe Tricle::Aggregation do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
describe '#weekly_values' do
|
36
|
+
it "should return the values by week ascending" do
|
37
|
+
expect(metric).to receive(:weeks_ago) {|n| n }.exactly(5).times
|
38
|
+
expect(metric.weekly_values(5)).to eq([5,4,3,2,1])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
35
42
|
describe '#week_average_this_quarter' do
|
36
43
|
it "should average the values provided by #size_for_range" do
|
37
44
|
expect(metric).to receive(:size_for_range).exactly(13).times.and_return(1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tricle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aidan Feldman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|