Class: Atatus::Spies::SneakersSpy Private

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/atatus/spies/sneakers.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Middleware

Constant Summary

Constants included from Logging

Logging::LEVELS, Logging::PREFIX

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logging

#debug, #error, #fatal, #info, #warn

Class Method Details

.supported_version?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


27
28
29
# File 'lib/atatus/spies/sneakers.rb', line 27

def self.supported_version?
  Gem.loaded_specs['sneakers'].version >= Gem::Version.create('2.12.0')
end

Instance Method Details

#installObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
34
35
36
37
38
39
40
# File 'lib/atatus/spies/sneakers.rb', line 31

def install
  unless SneakersSpy.supported_version?
    warn(
      'Sneakers version is below 2.12.0. Sneakers spy installation failed'
    )
    return
  end

  Sneakers.middleware.use(Middleware, nil)
end