gfspark 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/gfspark/config.rb +1 -1
- data/lib/gfspark/graph.rb +8 -8
- data/lib/gfspark/version.rb +1 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -45,7 +45,7 @@ Or install it yourself as:
|
|
45
45
|
-h, --height=VALUE graph height (default 10
|
46
46
|
-w, --width=VALUE graph width (default is deteced from $COLUMNS)
|
47
47
|
-c, --color=VALUE Color of graph bar (black/red/green/yellow/blue/magenta/cyan/white)
|
48
|
-
-
|
48
|
+
-x, --x-axis-label=VALUE Show x axis labels (hide/show/simple: default is show)
|
49
49
|
-n, --non-fullwidth-font Show bar symbol as fullwidth
|
50
50
|
--sslnoverify don't verify SSL
|
51
51
|
--sslcacert=v SSL CA CERT
|
data/lib/gfspark/config.rb
CHANGED
@@ -123,7 +123,7 @@ module Gfspark::Config
|
|
123
123
|
opts.on("-h=VALUE", "--height=VALUE", "graph height (default 10"){|v| @options[:height] = v}
|
124
124
|
opts.on("-w=VALUE", "--width=VALUE", "graph width (default is deteced from $COLUMNS)"){|v| @options[:width] = v}
|
125
125
|
opts.on("-c=VALUE", "--color=VALUE", "Color of graph bar (#{COLORS.join("/")})"){|v| @options[:color] = v if COLORS.include?(v.to_sym)}
|
126
|
-
opts.on("-
|
126
|
+
opts.on("-x=VALUE", "--x-axis-label=VALUE", "Show x axis labels (hide/show/simple: default is show)"){|v| @options[:x_axis_label] = v}
|
127
127
|
opts.on("-n", "--non-fullwidth-font", "Show bar symbol as fullwidth"){ @options[:non_fullwidth_font] = true }
|
128
128
|
opts.on("--sslnoverify", "don't verify SSL"){|v| @options[:sslNoVerify] = true}
|
129
129
|
opts.on("--sslcacert=v", "SSL CA CERT"){|v| @options[:sslCaCert] = v}
|
data/lib/gfspark/graph.rb
CHANGED
@@ -63,7 +63,7 @@ module Gfspark::Graph
|
|
63
63
|
end
|
64
64
|
puts result.join("\n")
|
65
65
|
|
66
|
-
|
66
|
+
render_x_axis_labels(rows, start_timestamp, step)
|
67
67
|
|
68
68
|
puts ""
|
69
69
|
|
@@ -71,21 +71,21 @@ module Gfspark::Graph
|
|
71
71
|
puts " #{sprintf("cur: %.1f ave: %.1f max: %.1f min %.1f", *sums)}"
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
75
|
-
|
74
|
+
def render_x_axis_labels(rows, start_timestamp, step)
|
75
|
+
x_axis_labels = rows.length.times.select{|n| n % 4 == 0}. map{|n|
|
76
76
|
t = Time.at(start_timestamp + (n * step)).localtime
|
77
77
|
sprintf("%-8s", to_axis_label(t))
|
78
78
|
}.join
|
79
|
-
|
79
|
+
x_axis_arrows= rows.length.times.select{|n| n % 4 == 0}. map{|n|
|
80
80
|
" / "
|
81
81
|
}.join
|
82
82
|
|
83
|
-
case @options[:
|
83
|
+
case @options[:x_axis_label]
|
84
84
|
when "show"
|
85
|
-
puts sprintf("%10s%s", "",
|
86
|
-
puts sprintf("%10s%s", "",
|
85
|
+
puts sprintf("%10s%s", "", x_axis_arrows)
|
86
|
+
puts sprintf("%10s%s", "", x_axis_labels)
|
87
87
|
when "simple"
|
88
|
-
puts sprintf("%10s%s", "",
|
88
|
+
puts sprintf("%10s%s", "", x_axis_labels)
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
data/lib/gfspark/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gfspark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2013-05-30 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70099750960100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70099750960100
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: term-ansicolor
|
27
|
-
requirement: &
|
27
|
+
requirement: &70099750959560 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70099750959560
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70099750959140 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70099750959140
|
47
47
|
description: GrowthForecast on Terminal
|
48
48
|
email:
|
49
49
|
- ozaki@yuroyoro.com
|