7709: Fix warning while suppressing warnings.
authorTom Clegg <tom@curoverse.com>
Mon, 27 Mar 2017 17:51:04 +0000 (13:51 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 27 Mar 2017 17:51:04 +0000 (13:51 -0400)
sdk/ruby/lib/arvados.rb

index 7a3f4b4226210646cbdd098d5594ff354f42778e..8b0406539f0c13343211418fa3bf3000890d0113 100644 (file)
@@ -11,18 +11,7 @@ ActiveSupport::Inflector.inflections do |inflect|
   inflect.irregular 'human', 'humans'
 end
 
-module Kernel
-  def suppress_warnings
-    original_verbosity = $VERBOSE
-    $VERBOSE = nil
-    result = yield
-    $VERBOSE = original_verbosity
-    return result
-  end
-end
-
 class Arvados
-
   class TransactionFailedError < StandardError
   end
 
@@ -262,4 +251,16 @@ class Arvados
       @attributes = j
     end
   end
+
+  protected
+
+  def suppress_warnings
+    original_verbosity = $VERBOSE
+    begin
+      $VERBOSE = nil
+      yield
+    ensure
+      $VERBOSE = original_verbosity
+    end
+  end
 end