Top Level Namespace

Defined Under Namespace

Modules: Karafka, Rimless Classes: ApplicationConsumer, CustomConsumer, FakeConfluentSchemaRegistryServer

Instance Method Summary collapse

Instance Method Details

#rimless_gem_version?(gem_name, expected) ⇒ Boolean

Check the actual (currently loaded) gem version against the expected (given) version. It returns true when the expected version matches the actual one. The version check is patch-level independent.

Parameters:

  • expected (String)

    the expected gem version (eg. ‘~> 5.1’)

Returns:

  • (Boolean)

    whenever the version is loaded or not



9
10
11
12
# File 'lib/rimless/initializers/compatibility.rb', line 9

def rimless_gem_version?(gem_name, expected)
  actual = Gem.loaded_specs[gem_name].version
  Gem::Dependency.new('', expected.to_s).match?('', actual)
end