Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Roman Lacko
gitlab_api
Commits
c89bbd79
Commit
c89bbd79
authored
Jan 08, 2018
by
Roman Lacko
Browse files
add API version test in GitLab::API
parent
4edc8590
Changes
1
Hide whitespace changes
Inline
Side-by-side
GitLab/API.pm
View file @
c89bbd79
...
...
@@ -22,7 +22,7 @@ use GitLab::API::Iterator;
use
parent
"
Exporter
";
our
$VERSION
=
8.1
2.
1
;
our
$VERSION
=
10.
2.
4
;
my
%defaults
=
(
per_page
=>
50
,
...
...
@@ -49,6 +49,15 @@ sub new {
$args
{
URL
}
=
"
$s
://
$args
{Host}/api/v
$v
";
}
my
(
$req_version
)
=
(
$args
{
URL
}
=~
m!api/v(\d+)!
);
if
(
!
defined
$req_version
)
{
carp
"
Cannot determine requested version of API
";
}
elsif
(
$req_version
<
4
)
{
carp
"
API version
$req_version
is deprecated
";
}
elsif
(
$req_version
>
4
)
{
croak
"
API version
$req_version
is not supported
";
}
$log
->
debug
("
initializing GitLab::API for
\"
$args
{URL}
\"
");
my
$self
=
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment