X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a95f899d7ac84f29b3d019aa410d265bb40833e5..5a32827d1f5ada007f83f5d5bb9b2d12526f2755:/sdk/ruby/lib/arvados.rb diff --git a/sdk/ruby/lib/arvados.rb b/sdk/ruby/lib/arvados.rb index 7a3f4b4226..a89c21b017 100644 --- a/sdk/ruby/lib/arvados.rb +++ b/sdk/ruby/lib/arvados.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + require 'rubygems' require 'active_support/inflector' require 'json' @@ -11,18 +15,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 +255,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