avm-gitlab 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/gitlab/rest_api/base_entity.rb +4 -0
- data/lib/avm/gitlab/rest_api/group.rb +6 -2
- data/lib/avm/gitlab/rest_api/node.rb +4 -0
- data/lib/avm/gitlab/rest_api/nodes_set.rb +8 -1
- data/lib/avm/gitlab/rest_api/project.rb +6 -2
- data/lib/avm/gitlab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f90e5a9bbaabf5d7f0891a15656004820061f35ae9531c0a4bf4e8ff5aa4dad7
|
4
|
+
data.tar.gz: deab5906bfff0b215757337cbef0ecf5317f43b7a1506186d4a883e9b586d7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf36c5d3e24e29fb211beb11b57f9b239be50e0ce92f2bd420ea72466b5a92ddb85e6d2c6f3e674f5c39af87645736b5c6562f01c89fee74499959dbfd1b4dd
|
7
|
+
data.tar.gz: db7271ec1343ecfdd399c9b36f7107435210fcfef5b99c183c2935759f8a7cb568d5b813007cf9d1bd3a7830b98d3a2d8c98fd119a0f357ae14fb5667e01521a
|
@@ -20,6 +20,10 @@ module Avm
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def api_prefix
|
24
|
+
"/groups/#{encode_id(id)}"
|
25
|
+
end
|
26
|
+
|
23
27
|
def to_s
|
24
28
|
full_path
|
25
29
|
end
|
@@ -28,14 +32,14 @@ module Avm
|
|
28
32
|
|
29
33
|
def members_uncached
|
30
34
|
fetch_entities(
|
31
|
-
"
|
35
|
+
"#{api_prefix}/members",
|
32
36
|
::Avm::Gitlab::RestApi::Member
|
33
37
|
)
|
34
38
|
end
|
35
39
|
|
36
40
|
def projects_uncached
|
37
41
|
fetch_entities(
|
38
|
-
"
|
42
|
+
"#{api_prefix}/projects?order_by=path&sort=asc&per_page=9999",
|
39
43
|
::Avm::Gitlab::RestApi::Project
|
40
44
|
)
|
41
45
|
end
|
@@ -29,6 +29,7 @@ module Avm
|
|
29
29
|
end
|
30
30
|
|
31
31
|
attr_reader :rest_api
|
32
|
+
attr_writer :no_groups
|
32
33
|
|
33
34
|
def initialize(rest_api, *ids)
|
34
35
|
self.rest_api = rest_api
|
@@ -53,7 +54,13 @@ module Avm
|
|
53
54
|
|
54
55
|
# @return [Array<Avm::Gitlab::RestApi::Node>]
|
55
56
|
def nodes
|
56
|
-
|
57
|
+
r = nodes_set
|
58
|
+
r = r.reject { |g| g.is_a?(::Avm::Gitlab::RestApi::Group) } if no_groups?
|
59
|
+
r.sort_by { |p| [p.full_path] }
|
60
|
+
end
|
61
|
+
|
62
|
+
def no_groups?
|
63
|
+
@no_groups ? true : false
|
57
64
|
end
|
58
65
|
|
59
66
|
private
|
@@ -31,13 +31,17 @@ module Avm
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def api_prefix
|
35
|
+
"/projects/#{encode_id(id)}"
|
36
|
+
end
|
37
|
+
|
34
38
|
def full_path
|
35
39
|
path_with_namespace
|
36
40
|
end
|
37
41
|
|
38
42
|
def file(path)
|
39
43
|
fetch_entity(
|
40
|
-
"
|
44
|
+
"#{api_prefix}/repository/files/#{encode_id(path)}?ref=#{default_branch}",
|
41
45
|
::Avm::Gitlab::RestApi::File,
|
42
46
|
'404 File Not Found'
|
43
47
|
)
|
@@ -51,7 +55,7 @@ module Avm
|
|
51
55
|
|
52
56
|
def members_uncached
|
53
57
|
fetch_entities(
|
54
|
-
"
|
58
|
+
"#{api_prefix}/members",
|
55
59
|
::Avm::Gitlab::RestApi::Member
|
56
60
|
)
|
57
61
|
end
|
data/lib/avm/gitlab/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-gitlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_ruby_utils
|