audc-gerry 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +62 -62
  3. data/Rakefile +7 -7
  4. data/lib/gerry/api/access.rb +17 -17
  5. data/lib/gerry/api/accounts.rb +38 -38
  6. data/lib/gerry/api/branches.rb +45 -45
  7. data/lib/gerry/api/changes.rb +38 -38
  8. data/lib/gerry/api/groups.rb +72 -72
  9. data/lib/gerry/api/projects.rb +73 -73
  10. data/lib/gerry/api/request.rb +86 -86
  11. data/lib/gerry/client.rb +58 -58
  12. data/lib/gerry/version.rb +5 -5
  13. data/lib/gerry.rb +11 -11
  14. data/spec/access_spec.rb +15 -15
  15. data/spec/accounts_spec.rb +35 -35
  16. data/spec/branches_spec.rb +36 -36
  17. data/spec/changes_spec.rb +55 -55
  18. data/spec/fixtures/README.md.json +2 -2
  19. data/spec/fixtures/access_rights.json +250 -250
  20. data/spec/fixtures/account_groups.json +32 -32
  21. data/spec/fixtures/branch_access.json +50 -50
  22. data/spec/fixtures/capabilities.json +7 -7
  23. data/spec/fixtures/changes.json +30 -30
  24. data/spec/fixtures/changes_batch_0.json +18 -18
  25. data/spec/fixtures/changes_batch_1.json +18 -18
  26. data/spec/fixtures/changes_batch_2.json +17 -17
  27. data/spec/fixtures/group_members.json +14 -14
  28. data/spec/fixtures/groups.json +68 -68
  29. data/spec/fixtures/open_changes.json +16 -16
  30. data/spec/fixtures/project_branch.json +6 -6
  31. data/spec/fixtures/project_branches.json +21 -21
  32. data/spec/fixtures/project_head.json +2 -2
  33. data/spec/fixtures/projects.json +9 -9
  34. data/spec/fixtures/query_capabilities.json +4 -4
  35. data/spec/groups_spec.rb +92 -92
  36. data/spec/projects_spec.rb +90 -90
  37. data/spec/request_spec.rb +46 -46
  38. data/spec/spec_helper.rb +49 -49
  39. metadata +52 -54
data/spec/changes_spec.rb CHANGED
@@ -1,55 +1,55 @@
1
- require 'spec_helper'
2
-
3
- describe '.changes' do
4
- it 'should fetch all changes' do
5
- stub = stub_get('/changes/', 'changes.json')
6
-
7
- client = MockGerry.new
8
- changes = client.changes
9
-
10
- expect(stub).to have_been_requested
11
-
12
- expect(changes[0]['project']).to eq('awesome')
13
- expect(changes[0]['branch']).to eq('master')
14
-
15
- expect(changes[1]['project']).to eq('clean')
16
- expect(changes[1]['subject']).to eq('Refactor code')
17
- expect(changes[1]['owner']['name']).to eq('Batman')
18
- end
19
-
20
- it 'should fetch all changes in batches' do
21
- stub_batch_0 = stub_get('/changes/', 'changes_batch_0.json')
22
- stub_batch_1 = stub_get('/changes/?S=1', 'changes_batch_1.json')
23
- stub_batch_2 = stub_get('/changes/?S=2', 'changes_batch_2.json')
24
-
25
- client = MockGerry.new
26
- changes = client.changes
27
-
28
- expect(stub_batch_0).to have_been_requested
29
- expect(stub_batch_1).to have_been_requested
30
-
31
- expect(changes[0]['project']).to eq('awesome')
32
- expect(changes[0]['branch']).to eq('master')
33
- expect(changes[0]['owner']['name']).to eq('The Duke')
34
-
35
- expect(changes[1]['project']).to eq('clean')
36
- expect(changes[1]['subject']).to eq('Refactor code')
37
- expect(changes[1]['owner']['name']).to eq('Batman')
38
-
39
- expect(changes[2]['project']).to eq('X')
40
- expect(changes[2]['subject']).to eq('Remove unused imports')
41
- expect(changes[2]['owner']['name']).to eq('Bill')
42
- end
43
-
44
- it 'should fetch all open changes' do
45
- stub = stub_get('/changes/?q=is:open+owner:self', 'open_changes.json')
46
-
47
- client = MockGerry.new
48
- changes = client.changes(['q=is:open+owner:self'])
49
-
50
- expect(stub).to have_been_requested
51
-
52
- expect(changes[0]['status']).to eq('OPEN')
53
- expect(changes[0]['owner']['name']).to eq('The Duke')
54
- end
55
- end
1
+ require 'spec_helper'
2
+
3
+ describe '.changes' do
4
+ it 'should fetch all changes' do
5
+ stub = stub_get('/changes/', 'changes.json')
6
+
7
+ client = MockGerry.new
8
+ changes = client.changes
9
+
10
+ expect(stub).to have_been_requested
11
+
12
+ expect(changes[0]['project']).to eq('awesome')
13
+ expect(changes[0]['branch']).to eq('master')
14
+
15
+ expect(changes[1]['project']).to eq('clean')
16
+ expect(changes[1]['subject']).to eq('Refactor code')
17
+ expect(changes[1]['owner']['name']).to eq('Batman')
18
+ end
19
+
20
+ it 'should fetch all changes in batches' do
21
+ stub_batch_0 = stub_get('/changes/', 'changes_batch_0.json')
22
+ stub_batch_1 = stub_get('/changes/?S=1', 'changes_batch_1.json')
23
+ stub_batch_2 = stub_get('/changes/?S=2', 'changes_batch_2.json')
24
+
25
+ client = MockGerry.new
26
+ changes = client.changes
27
+
28
+ expect(stub_batch_0).to have_been_requested
29
+ expect(stub_batch_1).to have_been_requested
30
+
31
+ expect(changes[0]['project']).to eq('awesome')
32
+ expect(changes[0]['branch']).to eq('master')
33
+ expect(changes[0]['owner']['name']).to eq('The Duke')
34
+
35
+ expect(changes[1]['project']).to eq('clean')
36
+ expect(changes[1]['subject']).to eq('Refactor code')
37
+ expect(changes[1]['owner']['name']).to eq('Batman')
38
+
39
+ expect(changes[2]['project']).to eq('X')
40
+ expect(changes[2]['subject']).to eq('Remove unused imports')
41
+ expect(changes[2]['owner']['name']).to eq('Bill')
42
+ end
43
+
44
+ it 'should fetch all open changes' do
45
+ stub = stub_get('/changes/?q=is:open+owner:self', 'open_changes.json')
46
+
47
+ client = MockGerry.new
48
+ changes = client.changes(['q=is:open+owner:self'])
49
+
50
+ expect(stub).to have_been_requested
51
+
52
+ expect(changes[0]['status']).to eq('OPEN')
53
+ expect(changes[0]['owner']['name']).to eq('The Duke')
54
+ end
55
+ end
@@ -1,2 +1,2 @@
1
- )]}'
2
- "Hello World!"
1
+ )]}'
2
+ "Hello World!"
@@ -1,250 +1,250 @@
1
- )]}'
2
- {
3
- "All-Projects": {
4
- "revision": "edd453d18e08640e67a8c9a150cec998ed0ac9aa",
5
- "local": {
6
- "GLOBAL_CAPABILITIES": {
7
- "permissions": {
8
- "priority": {
9
- "rules": {
10
- "15bfcd8a6de1a69c50b30cedcdcc951c15703152": {
11
- "action": "BATCH"
12
- }
13
- }
14
- },
15
- "streamEvents": {
16
- "rules": {
17
- "15bfcd8a6de1a69c50b30cedcdcc951c15703152": {
18
- "action": "ALLOW"
19
- }
20
- }
21
- },
22
- "administrateServer": {
23
- "rules": {
24
- "53a4f647a89ea57992571187d8025f830625192a": {
25
- "action": "ALLOW"
26
- }
27
- }
28
- }
29
- }
30
- },
31
- "refs/meta/config": {
32
- "permissions": {
33
- "submit": {
34
- "rules": {
35
- "53a4f647a89ea57992571187d8025f830625192a": {
36
- "action": "ALLOW"
37
- },
38
- "global:Project-Owners": {
39
- "action": "ALLOW"
40
- }
41
- }
42
- },
43
- "label-Code-Review": {
44
- "label": "Code-Review",
45
- "rules": {
46
- "53a4f647a89ea57992571187d8025f830625192a": {
47
- "action": "ALLOW",
48
- "min": -2,
49
- "max": 2
50
- },
51
- "global:Project-Owners": {
52
- "action": "ALLOW",
53
- "min": -2,
54
- "max": 2
55
- }
56
- }
57
- },
58
- "read": {
59
- "exclusive": true,
60
- "rules": {
61
- "53a4f647a89ea57992571187d8025f830625192a": {
62
- "action": "ALLOW"
63
- },
64
- "global:Project-Owners": {
65
- "action": "ALLOW"
66
- }
67
- }
68
- },
69
- "push": {
70
- "rules": {
71
- "53a4f647a89ea57992571187d8025f830625192a": {
72
- "action": "ALLOW"
73
- },
74
- "global:Project-Owners": {
75
- "action": "ALLOW"
76
- }
77
- }
78
- }
79
- }
80
- },
81
- "refs/for/refs/*": {
82
- "permissions": {
83
- "pushMerge": {
84
- "rules": {
85
- "global:Registered-Users": {
86
- "action": "ALLOW"
87
- }
88
- }
89
- },
90
- "push": {
91
- "rules": {
92
- "global:Registered-Users": {
93
- "action": "ALLOW"
94
- }
95
- }
96
- }
97
- }
98
- },
99
- "refs/tags/*": {
100
- "permissions": {
101
- "pushSignedTag": {
102
- "rules": {
103
- "53a4f647a89ea57992571187d8025f830625192a": {
104
- "action": "ALLOW"
105
- },
106
- "global:Project-Owners": {
107
- "action": "ALLOW"
108
- }
109
- }
110
- },
111
- "pushTag": {
112
- "rules": {
113
- "53a4f647a89ea57992571187d8025f830625192a": {
114
- "action": "ALLOW"
115
- },
116
- "global:Project-Owners": {
117
- "action": "ALLOW"
118
- }
119
- }
120
- }
121
- }
122
- },
123
- "refs/heads/*": {
124
- "permissions": {
125
- "forgeCommitter": {
126
- "rules": {
127
- "53a4f647a89ea57992571187d8025f830625192a": {
128
- "action": "ALLOW"
129
- },
130
- "global:Project-Owners": {
131
- "action": "ALLOW"
132
- }
133
- }
134
- },
135
- "forgeAuthor": {
136
- "rules": {
137
- "global:Registered-Users": {
138
- "action": "ALLOW"
139
- }
140
- }
141
- },
142
- "submit": {
143
- "rules": {
144
- "53a4f647a89ea57992571187d8025f830625192a": {
145
- "action": "ALLOW"
146
- },
147
- "global:Project-Owners": {
148
- "action": "ALLOW"
149
- }
150
- }
151
- },
152
- "editTopicName": {
153
- "rules": {
154
- "53a4f647a89ea57992571187d8025f830625192a": {
155
- "action": "ALLOW",
156
- "force": true
157
- },
158
- "global:Project-Owners": {
159
- "action": "ALLOW",
160
- "force": true
161
- }
162
- }
163
- },
164
- "label-Code-Review": {
165
- "label": "Code-Review",
166
- "rules": {
167
- "global:Registered-Users": {
168
- "action": "ALLOW",
169
- "min": -1,
170
- "max": 1
171
- },
172
- "53a4f647a89ea57992571187d8025f830625192a": {
173
- "action": "ALLOW",
174
- "min": -2,
175
- "max": 2
176
- },
177
- "global:Project-Owners": {
178
- "action": "ALLOW",
179
- "min": -2,
180
- "max": 2
181
- }
182
- }
183
- },
184
- "create": {
185
- "rules": {
186
- "53a4f647a89ea57992571187d8025f830625192a": {
187
- "action": "ALLOW"
188
- },
189
- "global:Project-Owners": {
190
- "action": "ALLOW"
191
- }
192
- }
193
- },
194
- "push": {
195
- "rules": {
196
- "53a4f647a89ea57992571187d8025f830625192a": {
197
- "action": "ALLOW"
198
- },
199
- "global:Project-Owners": {
200
- "action": "ALLOW"
201
- }
202
- }
203
- }
204
- }
205
- },
206
- "refs/*": {
207
- "permissions": {
208
- "read": {
209
- "rules": {
210
- "global:Anonymous-Users": {
211
- "action": "ALLOW"
212
- },
213
- "53a4f647a89ea57992571187d8025f830625192a": {
214
- "action": "ALLOW"
215
- }
216
- }
217
- }
218
- }
219
- }
220
- },
221
- "is_owner": true,
222
- "owner_of": [
223
- "GLOBAL_CAPABILITIES",
224
- "refs/meta/config",
225
- "refs/for/refs/*",
226
- "refs/tags/*",
227
- "refs/heads/*",
228
- "refs/*"
229
- ],
230
- "can_upload": true,
231
- "can_add": true,
232
- "config_visible": true
233
- },
234
- "MyProject": {
235
- "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
236
- "inherits_from": {
237
- "id": "All-Projects",
238
- "name": "All-Projects",
239
- "description": "Access inherited by all other projects."
240
- },
241
- "local": {},
242
- "is_owner": true,
243
- "owner_of": [
244
- "refs/*"
245
- ],
246
- "can_upload": true,
247
- "can_add": true,
248
- "config_visible": true
249
- }
250
- }
1
+ )]}'
2
+ {
3
+ "All-Projects": {
4
+ "revision": "edd453d18e08640e67a8c9a150cec998ed0ac9aa",
5
+ "local": {
6
+ "GLOBAL_CAPABILITIES": {
7
+ "permissions": {
8
+ "priority": {
9
+ "rules": {
10
+ "15bfcd8a6de1a69c50b30cedcdcc951c15703152": {
11
+ "action": "BATCH"
12
+ }
13
+ }
14
+ },
15
+ "streamEvents": {
16
+ "rules": {
17
+ "15bfcd8a6de1a69c50b30cedcdcc951c15703152": {
18
+ "action": "ALLOW"
19
+ }
20
+ }
21
+ },
22
+ "administrateServer": {
23
+ "rules": {
24
+ "53a4f647a89ea57992571187d8025f830625192a": {
25
+ "action": "ALLOW"
26
+ }
27
+ }
28
+ }
29
+ }
30
+ },
31
+ "refs/meta/config": {
32
+ "permissions": {
33
+ "submit": {
34
+ "rules": {
35
+ "53a4f647a89ea57992571187d8025f830625192a": {
36
+ "action": "ALLOW"
37
+ },
38
+ "global:Project-Owners": {
39
+ "action": "ALLOW"
40
+ }
41
+ }
42
+ },
43
+ "label-Code-Review": {
44
+ "label": "Code-Review",
45
+ "rules": {
46
+ "53a4f647a89ea57992571187d8025f830625192a": {
47
+ "action": "ALLOW",
48
+ "min": -2,
49
+ "max": 2
50
+ },
51
+ "global:Project-Owners": {
52
+ "action": "ALLOW",
53
+ "min": -2,
54
+ "max": 2
55
+ }
56
+ }
57
+ },
58
+ "read": {
59
+ "exclusive": true,
60
+ "rules": {
61
+ "53a4f647a89ea57992571187d8025f830625192a": {
62
+ "action": "ALLOW"
63
+ },
64
+ "global:Project-Owners": {
65
+ "action": "ALLOW"
66
+ }
67
+ }
68
+ },
69
+ "push": {
70
+ "rules": {
71
+ "53a4f647a89ea57992571187d8025f830625192a": {
72
+ "action": "ALLOW"
73
+ },
74
+ "global:Project-Owners": {
75
+ "action": "ALLOW"
76
+ }
77
+ }
78
+ }
79
+ }
80
+ },
81
+ "refs/for/refs/*": {
82
+ "permissions": {
83
+ "pushMerge": {
84
+ "rules": {
85
+ "global:Registered-Users": {
86
+ "action": "ALLOW"
87
+ }
88
+ }
89
+ },
90
+ "push": {
91
+ "rules": {
92
+ "global:Registered-Users": {
93
+ "action": "ALLOW"
94
+ }
95
+ }
96
+ }
97
+ }
98
+ },
99
+ "refs/tags/*": {
100
+ "permissions": {
101
+ "pushSignedTag": {
102
+ "rules": {
103
+ "53a4f647a89ea57992571187d8025f830625192a": {
104
+ "action": "ALLOW"
105
+ },
106
+ "global:Project-Owners": {
107
+ "action": "ALLOW"
108
+ }
109
+ }
110
+ },
111
+ "pushTag": {
112
+ "rules": {
113
+ "53a4f647a89ea57992571187d8025f830625192a": {
114
+ "action": "ALLOW"
115
+ },
116
+ "global:Project-Owners": {
117
+ "action": "ALLOW"
118
+ }
119
+ }
120
+ }
121
+ }
122
+ },
123
+ "refs/heads/*": {
124
+ "permissions": {
125
+ "forgeCommitter": {
126
+ "rules": {
127
+ "53a4f647a89ea57992571187d8025f830625192a": {
128
+ "action": "ALLOW"
129
+ },
130
+ "global:Project-Owners": {
131
+ "action": "ALLOW"
132
+ }
133
+ }
134
+ },
135
+ "forgeAuthor": {
136
+ "rules": {
137
+ "global:Registered-Users": {
138
+ "action": "ALLOW"
139
+ }
140
+ }
141
+ },
142
+ "submit": {
143
+ "rules": {
144
+ "53a4f647a89ea57992571187d8025f830625192a": {
145
+ "action": "ALLOW"
146
+ },
147
+ "global:Project-Owners": {
148
+ "action": "ALLOW"
149
+ }
150
+ }
151
+ },
152
+ "editTopicName": {
153
+ "rules": {
154
+ "53a4f647a89ea57992571187d8025f830625192a": {
155
+ "action": "ALLOW",
156
+ "force": true
157
+ },
158
+ "global:Project-Owners": {
159
+ "action": "ALLOW",
160
+ "force": true
161
+ }
162
+ }
163
+ },
164
+ "label-Code-Review": {
165
+ "label": "Code-Review",
166
+ "rules": {
167
+ "global:Registered-Users": {
168
+ "action": "ALLOW",
169
+ "min": -1,
170
+ "max": 1
171
+ },
172
+ "53a4f647a89ea57992571187d8025f830625192a": {
173
+ "action": "ALLOW",
174
+ "min": -2,
175
+ "max": 2
176
+ },
177
+ "global:Project-Owners": {
178
+ "action": "ALLOW",
179
+ "min": -2,
180
+ "max": 2
181
+ }
182
+ }
183
+ },
184
+ "create": {
185
+ "rules": {
186
+ "53a4f647a89ea57992571187d8025f830625192a": {
187
+ "action": "ALLOW"
188
+ },
189
+ "global:Project-Owners": {
190
+ "action": "ALLOW"
191
+ }
192
+ }
193
+ },
194
+ "push": {
195
+ "rules": {
196
+ "53a4f647a89ea57992571187d8025f830625192a": {
197
+ "action": "ALLOW"
198
+ },
199
+ "global:Project-Owners": {
200
+ "action": "ALLOW"
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "refs/*": {
207
+ "permissions": {
208
+ "read": {
209
+ "rules": {
210
+ "global:Anonymous-Users": {
211
+ "action": "ALLOW"
212
+ },
213
+ "53a4f647a89ea57992571187d8025f830625192a": {
214
+ "action": "ALLOW"
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ },
221
+ "is_owner": true,
222
+ "owner_of": [
223
+ "GLOBAL_CAPABILITIES",
224
+ "refs/meta/config",
225
+ "refs/for/refs/*",
226
+ "refs/tags/*",
227
+ "refs/heads/*",
228
+ "refs/*"
229
+ ],
230
+ "can_upload": true,
231
+ "can_add": true,
232
+ "config_visible": true
233
+ },
234
+ "MyProject": {
235
+ "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
236
+ "inherits_from": {
237
+ "id": "All-Projects",
238
+ "name": "All-Projects",
239
+ "description": "Access inherited by all other projects."
240
+ },
241
+ "local": {},
242
+ "is_owner": true,
243
+ "owner_of": [
244
+ "refs/*"
245
+ ],
246
+ "can_upload": true,
247
+ "can_add": true,
248
+ "config_visible": true
249
+ }
250
+ }