@@ -273,34 +273,54 @@ def substring_evaluator(condition)
273
273
end
274
274
275
275
def semver_equal_evaluator ( condition )
276
+ # Evaluate the given semantic version equal match target version for the user version.
277
+ # Returns boolean true if the user version is equal to the target version,
278
+ # false if the user version is not equal to the target version
279
+
276
280
target_version = condition [ 'value' ]
277
281
user_version = @user_attributes [ condition [ 'name' ] ]
278
282
279
283
SemanticVersion . compare_user_version_with_target_version ( target_version , user_version ) . zero?
280
284
end
281
285
282
286
def semver_greater_than_evaluator ( condition )
287
+ # Evaluate the given semantic version greater than match target version for the user version.
288
+ # Returns boolean true if the user version is greater than the target version,
289
+ # false if the user version is less than or equal to the target version
290
+
283
291
target_version = condition [ 'value' ]
284
292
user_version = @user_attributes [ condition [ 'name' ] ]
285
293
286
294
SemanticVersion . compare_user_version_with_target_version ( target_version , user_version ) . positive?
287
295
end
288
296
289
297
def semver_greater_than_or_equal_evaluator ( condition )
298
+ # Evaluate the given semantic version greater than or equal to match target version for the user version.
299
+ # Returns boolean true if the user version is greater than or equal to the target version,
300
+ # false if the user version is less than the target version
301
+
290
302
target_version = condition [ 'value' ]
291
303
user_version = @user_attributes [ condition [ 'name' ] ]
292
304
293
305
SemanticVersion . compare_user_version_with_target_version ( target_version , user_version ) >= 0
294
306
end
295
307
296
308
def semver_less_than_evaluator ( condition )
309
+ # Evaluate the given semantic version less than match target version for the user version.
310
+ # Returns boolean true if the user version is less than the target version,
311
+ # false if the user version is greater than or equal to the target version
312
+
297
313
target_version = condition [ 'value' ]
298
314
user_version = @user_attributes [ condition [ 'name' ] ]
299
315
300
316
SemanticVersion . compare_user_version_with_target_version ( target_version , user_version ) . negative?
301
317
end
302
318
303
319
def semver_less_than_or_equal_evaluator ( condition )
320
+ # Evaluate the given semantic version less than or equal to match target version for the user version.
321
+ # Returns boolean true if the user version is less than or equal to the target version,
322
+ # false if the user version is greater than the target version
323
+
304
324
target_version = condition [ 'value' ]
305
325
user_version = @user_attributes [ condition [ 'name' ] ]
306
326
0 commit comments