From 80e520d733e2b84f6ef12b8c6ed7b374d9d02a3e Mon Sep 17 00:00:00 2001 From: Tom Werner Date: Fri, 10 Aug 2007 17:42:19 -0700 Subject: [PATCH] update manifest --- Manifest.txt | 3 +++ lib/god/conditions/lambda.rb | 28 ++++++++++++++-------------- test/test_sugar.rb | 4 ++++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Manifest.txt b/Manifest.txt index 9e22a3f..3b512c3 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -14,6 +14,7 @@ lib/god/behaviors/clean_pid_file.rb lib/god/condition.rb lib/god/conditions/always.rb lib/god/conditions/cpu_usage.rb +lib/god/conditions/lambda.rb lib/god/conditions/memory_usage.rb lib/god/conditions/process_exits.rb lib/god/conditions/process_running.rb @@ -29,6 +30,7 @@ lib/god/process.rb lib/god/registry.rb lib/god/reporter.rb lib/god/server.rb +lib/god/sugar.rb lib/god/system/process.rb lib/god/timer.rb lib/god/watch.rb @@ -46,6 +48,7 @@ test/test_process.rb test/test_registry.rb test/test_reporter.rb test/test_server.rb +test/test_sugar.rb test/test_system_process.rb test/test_timeline.rb test/test_timer.rb diff --git a/lib/god/conditions/lambda.rb b/lib/god/conditions/lambda.rb index 06f1778..3d299cd 100644 --- a/lib/god/conditions/lambda.rb +++ b/lib/god/conditions/lambda.rb @@ -1,19 +1,19 @@ module God - module Conditions - - class Lambda < PollCondition - attr_accessor :lambda + module Conditions + + class Lambda < PollCondition + attr_accessor :lambda - def valid? - valid = true - valid &= complain("You must specify the 'lambda' attribute for :custom") if self.lambda.nil? - valid - end + def valid? + valid = true + valid &= complain("You must specify the 'lambda' attribute for :lambda") if self.lambda.nil? + valid + end - def test - return self.lambda.call() - end - end + def test + self.lambda.call() + end + end - end + end end \ No newline at end of file diff --git a/test/test_sugar.rb b/test/test_sugar.rb index 5daa02c..95131f2 100644 --- a/test/test_sugar.rb +++ b/test/test_sugar.rb @@ -40,4 +40,8 @@ class TestSugar < Test::Unit::TestCase assert_equal 1024 ** 3, 1.gigabytes assert_equal 1024 ** 3, 1.gigabyte end + + def test_percent + assert_equal 1, 1.percent + end end -- 2.11.4.GIT