gitlab 4.2.0 → 4.3.0

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 (84) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +33 -0
  3. data/.travis.yml +8 -3
  4. data/README.md +7 -7
  5. data/Rakefile +11 -3
  6. data/gitlab.gemspec +11 -11
  7. data/lib/gitlab.rb +2 -2
  8. data/lib/gitlab/api.rb +2 -1
  9. data/lib/gitlab/cli.rb +2 -6
  10. data/lib/gitlab/cli_helpers.rb +18 -20
  11. data/lib/gitlab/client.rb +8 -5
  12. data/lib/gitlab/client/branches.rb +4 -4
  13. data/lib/gitlab/client/build_variables.rb +64 -2
  14. data/lib/gitlab/client/deployments.rb +32 -0
  15. data/lib/gitlab/client/groups.rb +49 -0
  16. data/lib/gitlab/client/issues.rb +71 -0
  17. data/lib/gitlab/client/merge_requests.rb +1 -0
  18. data/lib/gitlab/client/pipeline_schedules.rb +133 -0
  19. data/lib/gitlab/client/pipeline_triggers.rb +2 -2
  20. data/lib/gitlab/client/projects.rb +1 -1
  21. data/lib/gitlab/client/repository_files.rb +2 -2
  22. data/lib/gitlab/client/users.rb +5 -5
  23. data/lib/gitlab/configuration.rb +2 -2
  24. data/lib/gitlab/error.rb +10 -2
  25. data/lib/gitlab/file_response.rb +1 -1
  26. data/lib/gitlab/help.rb +5 -6
  27. data/lib/gitlab/page_links.rb +2 -2
  28. data/lib/gitlab/request.rb +34 -50
  29. data/lib/gitlab/shell.rb +5 -8
  30. data/lib/gitlab/version.rb +1 -1
  31. data/spec/fixtures/deployment.json +57 -0
  32. data/spec/fixtures/deployments.json +116 -0
  33. data/spec/fixtures/group_edit.json +14 -0
  34. data/spec/fixtures/group_subgroups.json +16 -0
  35. data/spec/fixtures/pipeline_schedule.json +32 -0
  36. data/spec/fixtures/pipeline_schedule_create.json +21 -0
  37. data/spec/fixtures/pipeline_schedule_update.json +26 -0
  38. data/spec/fixtures/pipeline_schedule_variable.json +5 -0
  39. data/spec/fixtures/pipeline_schedule_variable_update.json +5 -0
  40. data/spec/fixtures/pipeline_schedules.json +22 -0
  41. data/spec/gitlab/api_spec.rb +11 -0
  42. data/spec/gitlab/cli_helpers_spec.rb +14 -15
  43. data/spec/gitlab/cli_spec.rb +11 -11
  44. data/spec/gitlab/client/award_emojis_spec.rb +55 -55
  45. data/spec/gitlab/client/boards_spec.rb +12 -12
  46. data/spec/gitlab/client/branches_spec.rb +22 -22
  47. data/spec/gitlab/client/build_variables_spec.rb +93 -10
  48. data/spec/gitlab/client/builds_spec.rb +36 -36
  49. data/spec/gitlab/client/commits_spec.rb +21 -21
  50. data/spec/gitlab/client/deployments_spec.rb +38 -0
  51. data/spec/gitlab/client/environments_spec.rb +18 -18
  52. data/spec/gitlab/client/groups_spec.rb +73 -22
  53. data/spec/gitlab/client/issues_spec.rb +121 -22
  54. data/spec/gitlab/client/jobs_spec.rb +13 -13
  55. data/spec/gitlab/client/keys_spec.rb +2 -2
  56. data/spec/gitlab/client/labels_spec.rb +12 -12
  57. data/spec/gitlab/client/merge_requests_spec.rb +23 -23
  58. data/spec/gitlab/client/milestones_spec.rb +12 -12
  59. data/spec/gitlab/client/namespaces_spec.rb +3 -3
  60. data/spec/gitlab/client/notes_spec.rb +40 -40
  61. data/spec/gitlab/client/pipeline_schedules_spec.rb +158 -0
  62. data/spec/gitlab/client/pipeline_triggers_spec.rb +17 -17
  63. data/spec/gitlab/client/pipelines_spec.rb +22 -22
  64. data/spec/gitlab/client/projects_spec.rb +75 -75
  65. data/spec/gitlab/client/repositories_spec.rb +16 -16
  66. data/spec/gitlab/client/repository_files_spec.rb +10 -10
  67. data/spec/gitlab/client/runners_spec.rb +20 -22
  68. data/spec/gitlab/client/services_spec.rb +6 -6
  69. data/spec/gitlab/client/snippets_spec.rb +12 -12
  70. data/spec/gitlab/client/system_hooks_spec.rb +12 -12
  71. data/spec/gitlab/client/tags_spec.rb +19 -20
  72. data/spec/gitlab/client/todos_spec.rb +12 -12
  73. data/spec/gitlab/client/users_spec.rb +49 -49
  74. data/spec/gitlab/error_spec.rb +50 -23
  75. data/spec/gitlab/file_response_spec.rb +6 -6
  76. data/spec/gitlab/help_spec.rb +5 -5
  77. data/spec/gitlab/objectified_hash_spec.rb +8 -8
  78. data/spec/gitlab/page_links_spec.rb +1 -1
  79. data/spec/gitlab/paginated_response_spec.rb +4 -4
  80. data/spec/gitlab/request_spec.rb +19 -19
  81. data/spec/gitlab/shell_spec.rb +12 -12
  82. data/spec/gitlab_spec.rb +13 -14
  83. data/spec/spec_helper.rb +10 -45
  84. metadata +46 -3
@@ -25,50 +25,15 @@ RSpec.configure do |config|
25
25
  end
26
26
  end
27
27
 
28
- # GET
29
- def stub_get(path, fixture, status_code=200)
30
- stub_request(:get, "#{Gitlab.endpoint}#{path}").
31
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
32
- to_return(body: load_fixture(fixture), status: status_code)
33
- end
34
-
35
- def a_get(path)
36
- a_request(:get, "#{Gitlab.endpoint}#{path}").
37
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
38
- end
39
-
40
- # POST
41
- def stub_post(path, fixture, status_code=200)
42
- stub_request(:post, "#{Gitlab.endpoint}#{path}").
43
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
44
- to_return(body: load_fixture(fixture), status: status_code)
45
- end
46
-
47
- def a_post(path)
48
- a_request(:post, "#{Gitlab.endpoint}#{path}").
49
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
50
- end
51
-
52
- # PUT
53
- def stub_put(path, fixture)
54
- stub_request(:put, "#{Gitlab.endpoint}#{path}").
55
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
56
- to_return(body: load_fixture(fixture))
57
- end
58
-
59
- def a_put(path)
60
- a_request(:put, "#{Gitlab.endpoint}#{path}").
61
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
62
- end
63
-
64
- # DELETE
65
- def stub_delete(path, fixture)
66
- stub_request(:delete, "#{Gitlab.endpoint}#{path}").
67
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
68
- to_return(body: load_fixture(fixture))
69
- end
28
+ %i(get post put delete).each do |method|
29
+ define_method "stub_#{method}" do |path, fixture, status_code=200|
30
+ stub_request(method, "#{Gitlab.endpoint}#{path}")
31
+ .with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
32
+ .to_return(body: load_fixture(fixture), status: status_code)
33
+ end
70
34
 
71
- def a_delete(path)
72
- a_request(:delete, "#{Gitlab.endpoint}#{path}").
73
- with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
35
+ define_method "a_#{method}" do |path|
36
+ a_request(method, "#{Gitlab.endpoint}#{path}")
37
+ .with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
38
+ end
74
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nihad Abbasov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-13 00:00:00.000000000 Z
11
+ date: 2017-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Ruby client and CLI for GitLab API
98
112
  email:
99
113
  - mail@narkoz.me
@@ -103,6 +117,7 @@ extensions: []
103
117
  extra_rdoc_files: []
104
118
  files:
105
119
  - ".gitignore"
120
+ - ".rubocop.yml"
106
121
  - ".travis.yml"
107
122
  - CHANGELOG.md
108
123
  - CONTRIBUTING.md
@@ -125,6 +140,7 @@ files:
125
140
  - lib/gitlab/client/build_variables.rb
126
141
  - lib/gitlab/client/builds.rb
127
142
  - lib/gitlab/client/commits.rb
143
+ - lib/gitlab/client/deployments.rb
128
144
  - lib/gitlab/client/environments.rb
129
145
  - lib/gitlab/client/groups.rb
130
146
  - lib/gitlab/client/issues.rb
@@ -135,6 +151,7 @@ files:
135
151
  - lib/gitlab/client/milestones.rb
136
152
  - lib/gitlab/client/namespaces.rb
137
153
  - lib/gitlab/client/notes.rb
154
+ - lib/gitlab/client/pipeline_schedules.rb
138
155
  - lib/gitlab/client/pipeline_triggers.rb
139
156
  - lib/gitlab/client/pipelines.rb
140
157
  - lib/gitlab/client/projects.rb
@@ -172,6 +189,8 @@ files:
172
189
  - spec/fixtures/builds.json
173
190
  - spec/fixtures/builds_commits.json
174
191
  - spec/fixtures/compare_merge_request_diff.json
192
+ - spec/fixtures/deployment.json
193
+ - spec/fixtures/deployments.json
175
194
  - spec/fixtures/empty.json
176
195
  - spec/fixtures/environment.json
177
196
  - spec/fixtures/environments.json
@@ -182,12 +201,14 @@ files:
182
201
  - spec/fixtures/group_create.json
183
202
  - spec/fixtures/group_create_with_description.json
184
203
  - spec/fixtures/group_delete.json
204
+ - spec/fixtures/group_edit.json
185
205
  - spec/fixtures/group_member.json
186
206
  - spec/fixtures/group_member_delete.json
187
207
  - spec/fixtures/group_member_edit.json
188
208
  - spec/fixtures/group_members.json
189
209
  - spec/fixtures/group_projects.json
190
210
  - spec/fixtures/group_search.json
211
+ - spec/fixtures/group_subgroups.json
191
212
  - spec/fixtures/groups.json
192
213
  - spec/fixtures/issue.json
193
214
  - spec/fixtures/issue_award_emoji.json
@@ -224,6 +245,12 @@ files:
224
245
  - spec/fixtures/pipeline_create.json
225
246
  - spec/fixtures/pipeline_jobs.json
226
247
  - spec/fixtures/pipeline_retry.json
248
+ - spec/fixtures/pipeline_schedule.json
249
+ - spec/fixtures/pipeline_schedule_create.json
250
+ - spec/fixtures/pipeline_schedule_update.json
251
+ - spec/fixtures/pipeline_schedule_variable.json
252
+ - spec/fixtures/pipeline_schedule_variable_update.json
253
+ - spec/fixtures/pipeline_schedules.json
227
254
  - spec/fixtures/pipelines.json
228
255
  - spec/fixtures/project.json
229
256
  - spec/fixtures/project_commit.json
@@ -295,6 +322,7 @@ files:
295
322
  - spec/fixtures/users.json
296
323
  - spec/fixtures/variable.json
297
324
  - spec/fixtures/variables.json
325
+ - spec/gitlab/api_spec.rb
298
326
  - spec/gitlab/cli_helpers_spec.rb
299
327
  - spec/gitlab/cli_spec.rb
300
328
  - spec/gitlab/client/award_emojis_spec.rb
@@ -304,6 +332,7 @@ files:
304
332
  - spec/gitlab/client/builds_spec.rb
305
333
  - spec/gitlab/client/client_spec.rb
306
334
  - spec/gitlab/client/commits_spec.rb
335
+ - spec/gitlab/client/deployments_spec.rb
307
336
  - spec/gitlab/client/environments_spec.rb
308
337
  - spec/gitlab/client/groups_spec.rb
309
338
  - spec/gitlab/client/issues_spec.rb
@@ -314,6 +343,7 @@ files:
314
343
  - spec/gitlab/client/milestones_spec.rb
315
344
  - spec/gitlab/client/namespaces_spec.rb
316
345
  - spec/gitlab/client/notes_spec.rb
346
+ - spec/gitlab/client/pipeline_schedules_spec.rb
317
347
  - spec/gitlab/client/pipeline_triggers_spec.rb
318
348
  - spec/gitlab/client/pipelines_spec.rb
319
349
  - spec/gitlab/client/projects_spec.rb
@@ -357,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
357
387
  version: '0'
358
388
  requirements: []
359
389
  rubyforge_project:
360
- rubygems_version: 2.5.2
390
+ rubygems_version: 2.7.3
361
391
  signing_key:
362
392
  specification_version: 4
363
393
  summary: A Ruby wrapper and CLI for the GitLab API
@@ -376,6 +406,8 @@ test_files:
376
406
  - spec/fixtures/builds.json
377
407
  - spec/fixtures/builds_commits.json
378
408
  - spec/fixtures/compare_merge_request_diff.json
409
+ - spec/fixtures/deployment.json
410
+ - spec/fixtures/deployments.json
379
411
  - spec/fixtures/empty.json
380
412
  - spec/fixtures/environment.json
381
413
  - spec/fixtures/environments.json
@@ -386,12 +418,14 @@ test_files:
386
418
  - spec/fixtures/group_create.json
387
419
  - spec/fixtures/group_create_with_description.json
388
420
  - spec/fixtures/group_delete.json
421
+ - spec/fixtures/group_edit.json
389
422
  - spec/fixtures/group_member.json
390
423
  - spec/fixtures/group_member_delete.json
391
424
  - spec/fixtures/group_member_edit.json
392
425
  - spec/fixtures/group_members.json
393
426
  - spec/fixtures/group_projects.json
394
427
  - spec/fixtures/group_search.json
428
+ - spec/fixtures/group_subgroups.json
395
429
  - spec/fixtures/groups.json
396
430
  - spec/fixtures/issue.json
397
431
  - spec/fixtures/issue_award_emoji.json
@@ -428,6 +462,12 @@ test_files:
428
462
  - spec/fixtures/pipeline_create.json
429
463
  - spec/fixtures/pipeline_jobs.json
430
464
  - spec/fixtures/pipeline_retry.json
465
+ - spec/fixtures/pipeline_schedule.json
466
+ - spec/fixtures/pipeline_schedule_create.json
467
+ - spec/fixtures/pipeline_schedule_update.json
468
+ - spec/fixtures/pipeline_schedule_variable.json
469
+ - spec/fixtures/pipeline_schedule_variable_update.json
470
+ - spec/fixtures/pipeline_schedules.json
431
471
  - spec/fixtures/pipelines.json
432
472
  - spec/fixtures/project.json
433
473
  - spec/fixtures/project_commit.json
@@ -499,6 +539,7 @@ test_files:
499
539
  - spec/fixtures/users.json
500
540
  - spec/fixtures/variable.json
501
541
  - spec/fixtures/variables.json
542
+ - spec/gitlab/api_spec.rb
502
543
  - spec/gitlab/cli_helpers_spec.rb
503
544
  - spec/gitlab/cli_spec.rb
504
545
  - spec/gitlab/client/award_emojis_spec.rb
@@ -508,6 +549,7 @@ test_files:
508
549
  - spec/gitlab/client/builds_spec.rb
509
550
  - spec/gitlab/client/client_spec.rb
510
551
  - spec/gitlab/client/commits_spec.rb
552
+ - spec/gitlab/client/deployments_spec.rb
511
553
  - spec/gitlab/client/environments_spec.rb
512
554
  - spec/gitlab/client/groups_spec.rb
513
555
  - spec/gitlab/client/issues_spec.rb
@@ -518,6 +560,7 @@ test_files:
518
560
  - spec/gitlab/client/milestones_spec.rb
519
561
  - spec/gitlab/client/namespaces_spec.rb
520
562
  - spec/gitlab/client/notes_spec.rb
563
+ - spec/gitlab/client/pipeline_schedules_spec.rb
521
564
  - spec/gitlab/client/pipeline_triggers_spec.rb
522
565
  - spec/gitlab/client/pipelines_spec.rb
523
566
  - spec/gitlab/client/projects_spec.rb