Module: Karafka::Constraints
- Defined in:
- lib/karafka/constraints.rb
Overview
Module used to check some constraints that cannot be easily defined by Bundler At the moment we use it to ensure, that if Karafka is used, it operates with the expected web ui version and that older versions of Web UI that would not be compatible with the API changes in karafka are not used.
We can make Web UI require certain karafka version range, but at the moment we do not have a strict 1:1 release pattern matching those two.
Class Method Summary collapse
-
.verify! ⇒ Object
Verifies that optional requirements are met.
Class Method Details
.verify! ⇒ Object
Verifies that optional requirements are met.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/karafka/constraints.rb', line 14 def verify! # Skip verification if web is not used at all return unless require_version('karafka/web') # All good if version higher than 0.9.0.rc3 because we expect 0.9.0.rc3 or higher return if version(Karafka::Web::VERSION) >= version('0.9.0.rc3') # If older web-ui used, we cannot allow it raise( Errors::DependencyConstraintsError, 'karafka-web < 0.9.0 is not compatible with this karafka version' ) end |