Skip to content

Commit 0d64fcb

Browse files
committed
Prep for next release, and update my CPAN build setup.
1 parent 56ab573 commit 0d64fcb

File tree

10 files changed

+403
-655
lines changed

10 files changed

+403
-655
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{pm,pl,t}]
8+
indent_style = space
9+
indent_size = 2

.lvimrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Aran Clary Deltac <bluefeet@gmail.com> Aran Clary Deltac <aran@bluefeet.dev>
22
Aran Clary Deltac <bluefeet@gmail.com> Aran Deltac <aran@ziprecruiter.com>
33
Luc Didry <luc@didry.org> Luc Didry <luc@framasoft.org>
4+
Aran Clary Deltac <bluefeet@gmail.com> Aran Deltac <bluefeet@gmail.com>

Changes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ Revision history for Perl extension GitLab-API-v4.
22

33
{{$NEXT}}
44

5+
- Changed licensing terms to be the same as Perl 5.
6+
- Add the user_memeberships method.
7+
- Remove file renaming before upload.
8+
- Provide a .editorconfig instead of .lvimrc.
9+
510
0.25 2020-02-12T22:20:48Z
611

712
- Add the delete_pipeline method.

LICENSE

Lines changed: 338 additions & 634 deletions
Large diffs are not rendered by default.

META.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"Aran Clary Deltac <bluefeet@gmail.com>"
55
],
66
"dynamic_config" : 0,
7-
"generated_by" : "Minilla/v3.1.4, CPAN::Meta::Converter version 2.150010",
7+
"generated_by" : "Minilla/v3.1.11, CPAN::Meta::Converter version 2.150010",
88
"license" : [
9-
"gpl_3"
9+
"perl_5"
1010
],
1111
"meta-spec" : {
1212
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
@@ -35,7 +35,7 @@
3535
"requires" : {
3636
"Test::CPAN::Meta" : "0",
3737
"Test::MinimumVersion::Fast" : "0.04",
38-
"Test::PAUSE::Permissions" : "0.04",
38+
"Test::PAUSE::Permissions" : "0.07",
3939
"Test::Pod" : "1.41",
4040
"Test::Spellunker" : "v0.2.7"
4141
}
@@ -93,6 +93,7 @@
9393
"Dave Webb <github@d5ve.com>",
9494
"Dmitry Frolov <dmitry.frolov@gmail.com>",
9595
"Dotan Dimet <dotan@corky.net>",
96+
"Graham Knop <haarg@haarg.org>",
9697
"José Joaquín Atria <jjatria@gmail.com>",
9798
"Kieren Diment <kieren.diment@staples.com.au>",
9899
"Luc Didry <luc@didry.org>",
@@ -104,6 +105,6 @@
104105
"royce55 <royce@ecs.vuw.ac.nz>",
105106
"trunov-ms <trunov.ms@gmail.com>"
106107
],
107-
"x_serialization_backend" : "JSON::PP version 4.04",
108+
"x_serialization_backend" : "JSON::PP version 4.02",
108109
"x_static_install" : 1
109110
}

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface (CLI).
2626

2727
## Upgrading
2828

29-
If you are upgrading from [GitLab::API::v3](https://metacpan.org/pod/GitLab::API::v3) make sure you read:
29+
If you are upgrading from [GitLab::API::v3](https://metacpan.org/pod/GitLab%3A%3AAPI%3A%3Av3) make sure you read:
3030

3131
[https://docs.gitlab.com/ce/api/v3\_to\_v4.html](https://docs.gitlab.com/ce/api/v3_to_v4.html)
3232

@@ -59,7 +59,7 @@ don't want them to.
5959
## Constants
6060

6161
The GitLab API, in rare cases, uses a hard-coded value to represent a state.
62-
To make life easier the [GitLab::API::v4::Constants](https://metacpan.org/pod/GitLab::API::v4::Constants) module exposes
62+
To make life easier the [GitLab::API::v4::Constants](https://metacpan.org/pod/GitLab%3A%3AAPI%3A%3Av4%3A%3AConstants) module exposes
6363
these states as named variables.
6464

6565
## Exceptions
@@ -70,11 +70,11 @@ an unsuccessful response is received from the API. That is except for
7070
for methods that return a value.
7171

7272
If you'd like to catch and handle these exceptions consider using
73-
[Try::Tiny](https://metacpan.org/pod/Try::Tiny).
73+
[Try::Tiny](https://metacpan.org/pod/Try%3A%3ATiny).
7474

7575
## Logging
7676

77-
This module uses [Log::Any](https://metacpan.org/pod/Log::Any) and produces some debug messages here
77+
This module uses [Log::Any](https://metacpan.org/pod/Log%3A%3AAny) and produces some debug messages here
7878
and there, but the most useful bits are the info messages produced
7979
just before each API call.
8080

@@ -121,14 +121,14 @@ See [https://docs.gitlab.com/ce/api/#sudo](https://docs.gitlab.com/ce/api/#sudo)
121121

122122
## rest\_client
123123

124-
An instance of [GitLab::API::v4::RESTClient](https://metacpan.org/pod/GitLab::API::v4::RESTClient) (or whatever ["rest\_client\_class"](#rest_client_class)
124+
An instance of [GitLab::API::v4::RESTClient](https://metacpan.org/pod/GitLab%3A%3AAPI%3A%3Av4%3A%3ARESTClient) (or whatever ["rest\_client\_class"](#rest_client_class)
125125
is set to). Typically you will not be setting this as it defaults to a new
126126
instance and customization should not be necessary.
127127

128128
## rest\_client\_class
129129

130130
The class to use when constructing the ["rest\_client"](#rest_client).
131-
Defaults to [GitLab::API::v4::RESTClient](https://metacpan.org/pod/GitLab::API::v4::RESTClient).
131+
Defaults to [GitLab::API::v4::RESTClient](https://metacpan.org/pod/GitLab%3A%3AAPI%3A%3Av4%3A%3ARESTClient).
132132

133133
# UTILITY METHODS
134134

@@ -155,7 +155,7 @@ my $all_open_issues = $api->paginator(
155155
```
156156

157157
Given a method who supports the `page` and `per_page` parameters,
158-
and returns an array ref, this will return a [GitLab::API::v4::Paginator](https://metacpan.org/pod/GitLab::API::v4::Paginator)
158+
and returns an array ref, this will return a [GitLab::API::v4::Paginator](https://metacpan.org/pod/GitLab%3A%3AAPI%3A%3Av4%3A%3APaginator)
159159
object that will allow you to walk the records one page or one record
160160
at a time.
161161

@@ -165,7 +165,7 @@ at a time.
165165
$api->sudo('fred')->create_issue(...);
166166
```
167167

168-
Returns a new instance of [GitLab::API::v4](https://metacpan.org/pod/GitLab::API::v4) with the ["sudo\_user"](#sudo_user) argument
168+
Returns a new instance of [GitLab::API::v4](https://metacpan.org/pod/GitLab%3A%3AAPI%3A%3Av4) with the ["sudo\_user"](#sudo_user) argument
169169
set.
170170

171171
See [https://docs.gitlab.com/ce/api/#sudo](https://docs.gitlab.com/ce/api/#sudo).
@@ -5390,6 +5390,17 @@ See [https://docs.gitlab.com/ce/api/users.html](https://docs.gitlab.com/ce/api/u
53905390
53915391
Sends a `GET` request to `user/activities` and returns the decoded response content.
53925392
5393+
- user\_memberships
5394+
5395+
```perl
5396+
my $memberships = $api->user_memberships(
5397+
$user_id,
5398+
\%params,
5399+
);
5400+
```
5401+
5402+
Sends a `GET` request to `users/:user_id/memberships` and returns the decoded response content.
5403+
53935404
## Validate the .gitlab-ci.yml
53945405
53955406
See [https://docs.gitlab.com/ce/api/lint.html](https://docs.gitlab.com/ce/api/lint.html).
@@ -5523,6 +5534,7 @@ Luc Didry <luc@didry.org>
55235534
Kieren Diment <kieren.diment@staples.com.au>
55245535
Dmitry Frolov <dmitry.frolov@gmail.com>
55255536
Thomas Klausner <domm@plix.at>
5537+
Graham Knop <haarg@haarg.org>
55265538
```
55275539
55285540
# COPYRIGHT AND LICENSE

author/footer.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ development this distribution would not exist.
4747
Kieren Diment <kieren.diment@staples.com.au>
4848
Dmitry Frolov <dmitry.frolov@gmail.com>
4949
Thomas Klausner <domm@plix.at>
50+
Graham Knop <haarg@haarg.org>
5051
5152
=head1 COPYRIGHT AND LICENSE
5253

lib/GitLab/API/v4.pm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10551,6 +10551,28 @@ sub all_user_activities {
1055110551
return $self->_call_rest_client( 'GET', 'user/activities', [@_], $options );
1055210552
}
1055310553

10554+
=item user_memberships
10555+
10556+
my $memberships = $api->user_memberships(
10557+
$user_id,
10558+
\%params,
10559+
);
10560+
10561+
Sends a C<GET> request to C<users/:user_id/memberships> and returns the decoded response content.
10562+
10563+
=cut
10564+
10565+
sub user_memberships {
10566+
my $self = shift;
10567+
croak 'user_memberships must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2;
10568+
croak 'The #1 argument ($user_id) to user_memberships must be a scalar' if ref($_[0]) or (!defined $_[0]);
10569+
croak 'The last argument (\%params) to user_memberships must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH';
10570+
my $params = (@_ == 2) ? pop() : undef;
10571+
my $options = {};
10572+
$options->{query} = $params if defined $params;
10573+
return $self->_call_rest_client( 'GET', 'users/:user_id/memberships', [@_], $options );
10574+
}
10575+
1055410576
=back
1055510577
1055610578
=head2 Validate the .gitlab-ci.yml
@@ -10773,6 +10795,7 @@ development this distribution would not exist.
1077310795
Kieren Diment <kieren.diment@staples.com.au>
1077410796
Dmitry Frolov <dmitry.frolov@gmail.com>
1077510797
Thomas Klausner <domm@plix.at>
10798+
Graham Knop <haarg@haarg.org>
1077610799
1077710800
=head1 COPYRIGHT AND LICENSE
1077810801

minil.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name = "GitLab-API-v4"
22
authority="cpan:BLUEFEET"
33
markdown_maker = "Pod::Markdown::Github"
4-
license = "gpl_3"
4+
license = "perl_5"

0 commit comments

Comments
 (0)