impulse 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -94,6 +94,12 @@ Default parameters...
94
94
  All can be configured on a per graph basis.
95
95
 
96
96
 
97
+ == QUICK NOTE
98
+
99
+ Yes, this is hacky as anything, it has no tests and does some stuff in a really bad way.
100
+
101
+ This is meant as a very dirty first release, feel free to make changes and pull request.
102
+
97
103
  == INSTALL:
98
104
 
99
105
  gem install impulse
data/impulse.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Lloyd Pick"]
10
10
  s.email = ["lloydpick+impulse@gmail.com"]
11
- s.homepage = ""
11
+ s.homepage = "https://github.com/lloydpick/impulse"
12
12
  s.summary = %q{RubyGem to help make very quick RRDTool graphs}
13
13
  s.description = %q{Ability to make RRDTool graphs with zero thought}
14
14
 
@@ -1,3 +1,3 @@
1
1
  module Impulse
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/impulse.rb CHANGED
@@ -28,15 +28,15 @@ module Impulse
28
28
  c = 0
29
29
  name.each do |k,v|
30
30
  v = { :color => '#FF0000', :data => :data }.merge(v)
31
- cmd << "DEF:d#{c}=./#{v[:name]}.rrd:#{v[:data].to_s}:MAX"
31
+ cmd << "DEF:d#{c}=#{v[:name]}.rrd:#{v[:data].to_s}:MAX"
32
32
  cmd << "LINE1:d#{c}#{v[:color]}:'#{k}' GPRINT:d#{c}:LAST:\"Last\\:%8.0lf\" GPRINT:d#{c}:MIN:\" Min\\:%8.0lf\" GPRINT:d#{c}:AVERAGE:\" Avg\\:%8.0lf\" GPRINT:d#{c}:MAX:\" Max\\:%8.0lf\\n\""
33
33
  c += 1
34
34
  end
35
35
  else
36
- cmd << "DEF:average=./#{name}.rrd:data:MAX"
36
+ cmd << "DEF:average=#{name}.rrd:data:MAX"
37
37
  cmd << "LINE1:average#FF0000:'#{params[:legend]}' GPRINT:average:LAST:\"Last\\:%8.0lf\" GPRINT:average:MIN:\" Min\\:%8.0lf\" GPRINT:average:AVERAGE:\" Avg\\:%8.0lf\" GPRINT:average:MAX:\" Max\\:%8.0lf\\n\""
38
38
  end
39
-
39
+
40
40
  system cmd.join(" ")
41
41
  end
42
42
 
@@ -58,7 +58,7 @@ module Impulse
58
58
  end
59
59
 
60
60
  def push_to_rrd(name, data)
61
- unless File.exist?(name + ".rrd")
61
+ if File.exist?(name + ".rrd")
62
62
  puts 'Updating RRD' if @debug
63
63
  system "rrdtool update #{name}.rrd #{Time.now.to_i}:#{data}"
64
64
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impulse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lloyd Pick
@@ -35,7 +35,7 @@ files:
35
35
  - impulse.gemspec
36
36
  - lib/impulse.rb
37
37
  - lib/impulse/version.rb
38
- homepage: ""
38
+ homepage: https://github.com/lloydpick/impulse
39
39
  licenses: []
40
40
 
41
41
  post_install_message: