Skip to content

Commit 2624338

Browse files
committed
Rename compare_versions to compare_api_versions
1 parent 067fe29 commit 2624338

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/dtutils.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dtutils.libdoc.functions["check_min_api_version"] = {
6161

6262
function dtutils.check_min_api_version(min_api, script_name)
6363
local current_api = dt.configuration.api_version_string
64-
if dtutils.compare_versions(min_api, current_api) > 0 then
64+
if dtutils.compare_api_versions(min_api, current_api) > 0 then
6565
dt.print_error("This application is written for lua api version " .. min_api .. " or later.")
6666
dt.print_error("The current lua api version is " .. current_api)
6767
dt.print("ERROR: " .. script_name .. " failed to load. Lua API version " .. min_api .. " or later required.")
@@ -96,7 +96,7 @@ dtutils.libdoc.functions["check_max_api_version"] = {
9696

9797
function dtutils.check_max_api_version(max_api, script_name)
9898
local current_api = dt.configuration.api_version_string
99-
if dtutils.compare_versions(current_api, max_api) > 0 then
99+
if dtutils.compare_api_versions(current_api, max_api) > 0 then
100100
dt.print_error("This application is written for lua api version " .. max_api .. " or earlier.")
101101
dt.print_error("The current lua api version is " .. current_api)
102102
dt.print("ERROR: " .. script_name .. " failed to load. Lua API version " .. max_api .. " or earlier required.")
@@ -427,26 +427,26 @@ function dtutils.gen_uuid(case)
427427
return uuid
428428
end
429429

430-
dtutils.libdoc.functions["compare_versions"] = {
431-
Name = [[compare_versions]],
432-
Synopsis = [[compare two version strings]],
430+
dtutils.libdoc.functions["compare_api_versions"] = {
431+
Name = [[compare_api_versions]],
432+
Synopsis = [[compare two API version strings]],
433433
Usage = [[local du = require "lib/dtutils"
434434
435-
local result = du.compare_versions(version1, version2)
435+
local result = du.compare_api_versions(version1, version2)
436436
version1 - string - the first version string to compare (example: "5.0.0")
437437
version2 - string - the second version string to compare (example: "5.1.0")]],
438-
Description = [[compare_versions compares two version strings and returns 1 if version1 is greater,
438+
Description = [[compare_api_versions compares two version strings and returns 1 if version1 is greater,
439439
-1 if version2 is greater, and 0 if they are equal.]],
440440
Return_Value = [[result - 1 if version1 is greater, -1 if version2 is greater, 0 if they are equal.]],
441441
Limitations = [[]],
442-
Example = [[compare_versions("5.0.0", "5.1.0") returns -1]],
442+
Example = [[compare_api_versions("5.0.0", "5.1.0") returns -1]],
443443
See_Also = [[]],
444444
Reference = [[]],
445445
License = [[]],
446446
Copyright = [[]],
447447
}
448448

449-
function dtutils.compare_versions(version1, version2)
449+
function dtutils.compare_api_versions(version1, version2)
450450
local v1 = {}
451451
for num in version1:gmatch("%d+") do table.insert(v1, tonumber(num)) end
452452
local v2 = {}

0 commit comments

Comments
 (0)