blackbeard 0.0.5.0 → 0.0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07e955101ffdd9c1bfe155e1916ebfc0a9911f4d
4
- data.tar.gz: eaab8a527217bc44eaadf13665a230cd46e8ae65
3
+ metadata.gz: fa44763d398c47b3063551c73926ec687539f3c7
4
+ data.tar.gz: e79c73df961507fc06858312fe91ed5c3a1caa1e
5
5
  SHA512:
6
- metadata.gz: d16393da029f3e584a1b632332582b20645dd1857b7b845012546bd0b939a99251969c6ec5e658fb425e61cb5cdf4ad2588461883a5128541f0a18ea66ca54d8
7
- data.tar.gz: 5f5154181ac58db415657199eddb3f6e19ff236e999bf21bd74fc597903ab63350f783face5647bd534b5dd1b6c8580ffbe439616a5b812fc77320af3325e838
6
+ metadata.gz: 56daa5b7823b2b5c3ca4ef2380d0c9e9fea8221f40aa03e274f7a43bd640488938e57f3d012fcb45b319cbbaa720a7e5675b0b6b33ddaf8b95a341f84617c3ef
7
+ data.tar.gz: 552061f079c0f531a850f8f9b62e4f9675d9df8867f3ffe4f2ef0d84bfa3cbaf69c1c12d2b77378e796e1200387dc4d4480d884284d99cbc07b37b16f12b96aa
@@ -42,7 +42,13 @@ module Blackbeard
42
42
  end
43
43
 
44
44
  def ensure_charts
45
- @charts = []
45
+ @charts = [chartable.recent_hours_chart, chartable.recent_days_chart]
46
+ end
47
+
48
+ def chartable
49
+ return GroupMetric.new(@group, @metric) if @group
50
+ return CohortMetric.new(@cohort, @metric) if @cohort
51
+ return @metric
46
52
  end
47
53
 
48
54
  end
@@ -1,5 +1,5 @@
1
1
  <div class="page-header">
2
- <h1><span id="editable-name"><%= @cohort.name %></span> <small>Group</small></h1>
2
+ <h1><span id="editable-name"><%= @cohort.name %></span> <small>Cohort</small></h1>
3
3
  <p id="editable-description"><%= @cohort.description %></p>
4
4
  </div>
5
5
 
@@ -29,7 +29,7 @@ module Blackbeard
29
29
  :dom_id => 'recent_hour_chart',
30
30
  :title => title,
31
31
  :columns => ['Hour']+chartable_segments,
32
- :rows => data.map{ |metric_hour| metric_hour.result_rows(chartable_segments) }
32
+ :rows => data.reverse.map{ |metric_hour| metric_hour.result_rows(chartable_segments) }
33
33
  )
34
34
  end
35
35
 
@@ -39,7 +39,7 @@ module Blackbeard
39
39
  :dom_id => 'recent_days_chart',
40
40
  :title => "Last #{count} Days",
41
41
  :columns => ['Day']+chartable_segments,
42
- :rows => data.map{ |metric_date| metric_date.result_rows(chartable_segments) }
42
+ :rows => data.reverse.map{ |metric_date| metric_date.result_rows(chartable_segments) }
43
43
  )
44
44
  end
45
45
 
@@ -1,5 +1,6 @@
1
1
  module Blackbeard
2
2
  class CohortMetric
3
+ include ConfigurationMethods
3
4
  include Chartable
4
5
 
5
6
  attr_reader :cohort, :metric
@@ -24,7 +25,7 @@ module Blackbeard
24
25
  end
25
26
 
26
27
  def chartable_segments
27
- metric_data.map{|s| "avg #{s}" }
28
+ metric_data.segments.map{|s| "avg #{s}" }
28
29
  end
29
30
 
30
31
  def chartable_result_for_hour(hour)
@@ -1,5 +1,6 @@
1
1
  module Blackbeard
2
2
  class GroupMetric
3
+ include ConfigurationMethods
3
4
  include Chartable
4
5
 
5
6
  attr_reader :group, :metric
@@ -13,7 +13,7 @@ module Blackbeard
13
13
  end
14
14
 
15
15
  def result_rows(segments)
16
- [@date] + results_for(segments)
16
+ [@date.to_s] + results_for(segments)
17
17
  end
18
18
 
19
19
 
@@ -12,7 +12,7 @@ module Blackbeard
12
12
  end
13
13
 
14
14
  def result_rows(segments)
15
- [@hours] + results_for(segments)
15
+ [@hour.strftime("%l%P")] + results_for(segments)
16
16
  end
17
17
 
18
18
  private
@@ -1,3 +1,3 @@
1
1
  module Blackbeard
2
- VERSION = "0.0.5.0"
2
+ VERSION = "0.0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackbeard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.0
4
+ version: 0.0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Graff