to_bar_graph 0.0.1 → 0.0.2
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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 092d59cfa67889a5aa4600a6ff0d6233c42f2c82
|
4
|
+
data.tar.gz: d67e8d5c77e6373df077e00023baabf6b3b04fcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92c8d374e739d6d8bd7590b304c6d310e298980bb6a799833194840c0213db07b437fb5f6afbc5d8a6c048f4e82489f50034dde5f861cd8a2c85773d4738678
|
7
|
+
data.tar.gz: 3fad59c01191bd9cecc094d4589ec60eacabadef2bbdecc96cde2e26de1e246725e68f908675e19c7b3168a1dfd80ba0a64325d1a8fe12e32510a7f181a27f22
|
data/lib/stdout_print.rb
CHANGED
@@ -10,22 +10,17 @@ module ToBarGraph
|
|
10
10
|
def invoke
|
11
11
|
if @bar_graph.length == 0
|
12
12
|
@stdout.puts "You have no bar graph data"
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
unless @bar_graph.buckets.is_a?(Hash)
|
13
|
+
elsif !(@bar_graph.buckets.is_a?(Hash))
|
17
14
|
@stdout.puts "The data you have provided is not bargraph-able"
|
18
|
-
|
15
|
+
else
|
16
|
+
print_header
|
17
|
+
print_body
|
19
18
|
end
|
20
|
-
|
21
|
-
print_header
|
22
|
-
|
23
|
-
print_body
|
24
19
|
end
|
25
20
|
|
26
21
|
private
|
27
22
|
def print_header
|
28
|
-
@stdout.
|
23
|
+
@stdout.print "\r**************************************************************\n"
|
29
24
|
@stdout.puts "Results for #to_bar_graph(print_info: true)"
|
30
25
|
@stdout.puts "\n"
|
31
26
|
|
@@ -62,6 +57,7 @@ module ToBarGraph
|
|
62
57
|
stars = ''
|
63
58
|
|
64
59
|
percentage.ceil.times { |x| stars << '*' }
|
60
|
+
stars.length.upto(100) { |x| stars << ' ' }
|
65
61
|
|
66
62
|
@stdout.printf("#{cata} | #{freq} | #{prec} | #{star} \n", ("#{cata_sig}" % category), frequency, ('%.4f' % percentage), stars)
|
67
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_bar_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Sykes
|
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.5.0
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: Creates a simple bar graph on the command line
|