Class: Karafka::Licenser
- Inherits:
-
Object
- Object
- Karafka::Licenser
- Defined in:
- lib/karafka/licenser.rb
Overview
Checks the license presence for pro and loads pro components when needed (if any)
Class Method Summary collapse
-
.detect ⇒ Object
Tries to load the license and yields if successful.
-
.prepare_and_verify(license_config) ⇒ Object
Tries to prepare license and verifies it.
Class Method Details
.detect ⇒ Object
Tries to load the license and yields if successful
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/karafka/licenser.rb', line 13 def detect # If required, do not require again require('karafka-license') unless const_defined?('::Karafka::License') yield true rescue LoadError false end |
.prepare_and_verify(license_config) ⇒ Object
Tries to prepare license and verifies it
27 28 29 30 31 32 33 |
# File 'lib/karafka/licenser.rb', line 27 def prepare_and_verify(license_config) # If license is not loaded, nothing to do return unless const_defined?('::Karafka::License') prepare(license_config) verify(license_config) end |