Top Level Namespace

Defined Under Namespace

Modules: AdsCommon

Constant Summary collapse

Gem::Version.new('2.1')

Instance Method Summary collapse

Instance Method Details

#check_version(logger) ⇒ Object

Checks current ruby version to make sure it’s supported.



25
26
27
28
29
30
31
32
33
# File 'lib/ads_common/env_check.rb', line 25

def check_version(logger)
  if Gem::Version.new(RUBY_VERSION.dup()) < MIN_RUBY_RECOMMENDED_VERSION
    logger.warn(
        ('You are using a deprecated version of Ruby (%s). ' +
        'Consider upgrading to a fully supported version %s or later') %
        [RUBY_VERSION, MIN_RUBY_RECOMMENDED_VERSION]
    )
  end
end