visage-app 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
data/bin/visage CHANGED
@@ -4,7 +4,7 @@ require 'pathname'
4
4
 
5
5
  require 'socket'
6
6
  fqdn = Socket.gethostbyname(Socket.gethostname).first
7
-
7
+ $stdout.sync = true
8
8
  @root = Pathname.new(File.dirname(__FILE__)).parent.expand_path
9
9
  action = ARGV[0]
10
10
 
@@ -22,6 +22,9 @@ when "start"
22
22
  puts
23
23
  puts "will be running at http://#{fqdn}:9292/"
24
24
  puts
25
+ require @root.join('lib/visage-app')
26
+ puts "Looking for RRDs in #{Visage::Config.rrddir}"
27
+ puts
25
28
 
26
29
  config = @root.join('lib/visage/config.ru').to_s
27
30
  server = Rack::Server.new(:config => config, :Port => 9292)
@@ -9,3 +9,9 @@ Feature: command line utility
9
9
  When I start the visage server helper with "visage start"
10
10
  Then a visage web server should be running
11
11
 
12
+ Scenario: Seeing where Visage is getting its data from
13
+ Given the "visage" gem is installed
14
+ When I start the visage server helper with "visage start"
15
+ Then I should see "Looking for RRDs in /.*collectd" on the terminal
16
+
17
+
@@ -51,13 +51,13 @@ Feature: Export data
51
51
  And each plugin instance should have a different color
52
52
 
53
53
  Examples:
54
- | path |
55
- | cpu-0/cpu-user |
56
- | df/df-root |
54
+ | path |
55
+ | cpu-0/cpu-user |
56
+ | memory/memory-used |
57
57
 
58
58
  Scenario: Retrieve single plugin instance with a color definition
59
59
  Given a list of hosts exist
60
- When I visit "swap/swap-used" on the first available host
60
+ When I visit "load/load" on the first available host
61
61
  Then the request should succeed
62
62
  Then I should receive valid JSON
63
63
  And the plugin instance should have a color
@@ -6,15 +6,20 @@ When /^I start the visage server helper with "([^"]*)"$/ do |cmd|
6
6
  @root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path
7
7
  command = "#{@root.join('bin')}/#{cmd}"
8
8
 
9
- pipe = IO.popen(command)
9
+ @pipe = IO.popen(command, "r")
10
10
  sleep 2 # so the visage server has a chance to boot
11
11
 
12
12
  # clean up the visage server when the tests finish
13
13
  at_exit do
14
- Process.kill("KILL", pipe.pid)
14
+ Process.kill("KILL", @pipe.pid)
15
15
  end
16
16
  end
17
17
 
18
18
  Then /^a visage web server should be running$/ do
19
19
  `ps -eo cmd |grep ^visage`.size.should > 0
20
20
  end
21
+
22
+ Then /^I should see "([^"]*)" on the terminal$/ do |string|
23
+ output = @pipe.read(250)
24
+ output.should =~ /#{string}/
25
+ end
@@ -126,7 +126,7 @@ class CollectdJSON
126
126
  attr_writer :rrddir
127
127
 
128
128
  def rrddir
129
- @rrddir || @rrddir = "/var/lib/collectd/rrd"
129
+ @rrddir ||= Visage::Config.rrddir
130
130
  end
131
131
 
132
132
  def hosts
@@ -10,7 +10,7 @@ module Visage
10
10
 
11
11
  class << self
12
12
  def rrddir
13
- @rrddir = "/var/lib/collectd/rrd"
13
+ @rrddir ||= Visage::Config.rrddir
14
14
  end
15
15
 
16
16
  def hosts(opts={})
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 4
9
- version: 0.2.4
8
+ - 5
9
+ version: 0.2.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lindsay Holmwood
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-19 00:00:00 +10:00
17
+ date: 2010-08-11 00:00:00 +10:00
18
18
  default_executable: visage
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -101,6 +101,7 @@ files:
101
101
  - Rakefile
102
102
  - VERSION
103
103
  - bin/visage
104
+ - features/cli.feature
104
105
  - features/json.feature
105
106
  - features/site.feature
106
107
  - features/step_definitions/form_steps.rb
@@ -110,7 +111,6 @@ files:
110
111
  - features/step_definitions/visage_steps.rb
111
112
  - features/step_definitions/webrat_steps.rb
112
113
  - features/support/env.rb
113
- - features/visage.feature
114
114
  - lib/visage-app.rb
115
115
  - lib/visage/collectd/json.rb
116
116
  - lib/visage/collectd/profile.rb