to_histogram 1.0.15 → 1.0.16
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 +4 -4
- data/lib/stdout_print.rb +6 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9f9630dbdff3b9465ee3696e6d5a8d73d3a5e5e
|
4
|
+
data.tar.gz: 3121fc6706557f2c124357c44909ff87756caec6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bb9704b379519eb81d97954179bd2d730d8a021a0238ef3b1546f252513570c66875f0d34ede5d2bc45c1d0892c671021fd78c09c0027bd013147cdf5e34b7c
|
7
|
+
data.tar.gz: 0928606f6d502f7dc9f6bced7d56bce330a29203c443aaed0ba7e9b782279b90acc420b9c43fb631ab71b4b1c55e38a1fc444f4e7829d9c284b5dba82ff111dd
|
data/lib/stdout_print.rb
CHANGED
@@ -13,22 +13,17 @@ module ToHistogram
|
|
13
13
|
def invoke
|
14
14
|
if @histogram.length == 0
|
15
15
|
@stdout.puts "You have no histogram data"
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
if (@histogram.length == 1 && (@histogram[0].from == 0 && @histogram[0].to == -1))
|
16
|
+
elsif (@histogram.length == 1 && (@histogram[0].from == 0 && @histogram[0].to == -1))
|
20
17
|
@stdout.puts "The data you have provided is not histogram-able"
|
21
|
-
|
18
|
+
else
|
19
|
+
print_header
|
20
|
+
print_body
|
22
21
|
end
|
23
|
-
|
24
|
-
print_header
|
25
|
-
|
26
|
-
print_body
|
27
22
|
end
|
28
23
|
|
29
24
|
private
|
30
25
|
def print_header
|
31
|
-
@stdout.
|
26
|
+
@stdout.print "\r**************************************************************\n"
|
32
27
|
@stdout.puts "Results for #to_histogram(num_buckets: #{@histogram.num_buckets}, bucket_width: #{@histogram.bucket_width}, percentile: #{@histogram.percentile}, print_info: true)"
|
33
28
|
|
34
29
|
@stdout.puts "\n"
|
@@ -55,6 +50,7 @@ module ToHistogram
|
|
55
50
|
stars = ''
|
56
51
|
|
57
52
|
percentage.ceil.times { |x| stars << '*' }
|
53
|
+
stars.length.upto(100) { |x| stars << ' ' }
|
58
54
|
|
59
55
|
if(i == (@histogram.length - 1))
|
60
56
|
if(b.contents[-1] - b.contents[0] != 0 && (b.contents[-1] - b.contents[0] > @histogram.bucket_width))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_histogram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Sykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Adds #to_histogram to Array. Returns a histogram distribution object
|
14
14
|
from an Array and optionally prints detailed info to stdout.'
|
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
45
|
rubyforge_project:
|
46
|
-
rubygems_version: 2.
|
46
|
+
rubygems_version: 2.5.0
|
47
47
|
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: Creates a simple histogram output on the command line
|