From 18ccdbba44249e3b8e646aff89c7850155a706a2 Mon Sep 17 00:00:00 2001 From: radekg Date: Mon, 16 Dec 2013 22:46:53 +0100 Subject: [PATCH] [general] Merge Forg.interval and Fog.timeout into a single file. --- lib/fog/core.rb | 3 +-- lib/fog/core/timeout.rb | 11 ----------- lib/fog/core/{interval.rb => wait_for_defaults.rb} | 10 ++++++++++ 3 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 lib/fog/core/timeout.rb rename lib/fog/core/{interval.rb => wait_for_defaults.rb} (52%) diff --git a/lib/fog/core.rb b/lib/fog/core.rb index c70de8ffd..890f24892 100644 --- a/lib/fog/core.rb +++ b/lib/fog/core.rb @@ -20,7 +20,6 @@ require 'fog/core/current_machine' require 'fog/core/deprecation' require 'fog/core/errors' require 'fog/core/hmac' -require 'fog/core/interval' require 'fog/core/logger' require 'fog/core/model' require 'fog/core/mock' @@ -29,8 +28,8 @@ require 'fog/core/service' require 'fog/core/ssh' require 'fog/core/scp' require 'fog/core/time' -require 'fog/core/timeout' require 'fog/core/wait_for' +require 'fog/core/wait_for_defaults' require 'fog/core/class_from_string' require 'fog/core/uuid' diff --git a/lib/fog/core/timeout.rb b/lib/fog/core/timeout.rb deleted file mode 100644 index 32d43d851..000000000 --- a/lib/fog/core/timeout.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Fog - @timeout = 600 - def self.timeout - @timeout - end - - def self.timeout=(timeout) - raise ArgumentError, "timeout must be non-negative" unless timeout >= 0 - @timeout = timeout - end -end diff --git a/lib/fog/core/interval.rb b/lib/fog/core/wait_for_defaults.rb similarity index 52% rename from lib/fog/core/interval.rb rename to lib/fog/core/wait_for_defaults.rb index bc670f520..e2b224e8e 100644 --- a/lib/fog/core/interval.rb +++ b/lib/fog/core/wait_for_defaults.rb @@ -8,4 +8,14 @@ module Fog raise ArgumentError, "interval must be non-negative" unless interval >= 0 @interval = interval end + + @timeout = 600 + def self.timeout + @timeout + end + + def self.timeout=(timeout) + raise ArgumentError, "timeout must be non-negative" unless timeout >= 0 + @timeout = timeout + end end