gitlab 4.5.0 → 5.1.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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +0 -267
  3. data/LICENSE.txt +1 -1
  4. data/README.md +40 -30
  5. data/exe/gitlab +5 -1
  6. data/lib/gitlab/api.rb +7 -3
  7. data/lib/gitlab/cli.rb +13 -9
  8. data/lib/gitlab/cli_helpers.rb +49 -45
  9. data/lib/gitlab/client/access_requests.rb +10 -1
  10. data/lib/gitlab/client/application_settings.rb +172 -0
  11. data/lib/gitlab/client/avatar.rb +21 -0
  12. data/lib/gitlab/client/award_emojis.rb +5 -3
  13. data/lib/gitlab/client/boards.rb +62 -4
  14. data/lib/gitlab/client/branches.rb +47 -8
  15. data/lib/gitlab/client/broadcast_messages.rb +75 -0
  16. data/lib/gitlab/client/build_variables.rb +19 -12
  17. data/lib/gitlab/client/builds.rb +13 -11
  18. data/lib/gitlab/client/commits.rb +73 -21
  19. data/lib/gitlab/client/container_registry.rb +85 -0
  20. data/lib/gitlab/client/deployments.rb +3 -1
  21. data/lib/gitlab/client/environments.rb +5 -3
  22. data/lib/gitlab/client/epic_issues.rb +23 -0
  23. data/lib/gitlab/client/epics.rb +73 -0
  24. data/lib/gitlab/client/events.rb +6 -4
  25. data/lib/gitlab/client/features.rb +48 -0
  26. data/lib/gitlab/client/group_badges.rb +88 -0
  27. data/lib/gitlab/client/group_boards.rb +141 -0
  28. data/lib/gitlab/client/group_labels.rb +88 -0
  29. data/lib/gitlab/client/group_milestones.rb +7 -6
  30. data/lib/gitlab/client/groups.rb +326 -12
  31. data/lib/gitlab/client/issue_links.rb +48 -0
  32. data/lib/gitlab/client/issues.rb +47 -13
  33. data/lib/gitlab/client/jobs.rb +96 -8
  34. data/lib/gitlab/client/keys.rb +13 -0
  35. data/lib/gitlab/client/labels.rb +6 -4
  36. data/lib/gitlab/client/lint.rb +19 -0
  37. data/lib/gitlab/client/markdown.rb +23 -0
  38. data/lib/gitlab/client/merge_request_approvals.rb +164 -9
  39. data/lib/gitlab/client/merge_requests.rb +148 -11
  40. data/lib/gitlab/client/merge_trains.rb +55 -0
  41. data/lib/gitlab/client/milestones.rb +19 -5
  42. data/lib/gitlab/client/namespaces.rb +4 -2
  43. data/lib/gitlab/client/notes.rb +38 -9
  44. data/lib/gitlab/client/packages.rb +95 -0
  45. data/lib/gitlab/client/pipeline_schedules.rb +36 -10
  46. data/lib/gitlab/client/pipeline_triggers.rb +10 -8
  47. data/lib/gitlab/client/pipelines.rb +65 -3
  48. data/lib/gitlab/client/project_badges.rb +85 -0
  49. data/lib/gitlab/client/project_clusters.rb +83 -0
  50. data/lib/gitlab/client/project_exports.rb +54 -0
  51. data/lib/gitlab/client/project_release_links.rb +76 -0
  52. data/lib/gitlab/client/project_releases.rb +90 -0
  53. data/lib/gitlab/client/projects.rb +307 -26
  54. data/lib/gitlab/client/protected_tags.rb +59 -0
  55. data/lib/gitlab/client/remote_mirrors.rb +51 -0
  56. data/lib/gitlab/client/repositories.rb +77 -6
  57. data/lib/gitlab/client/repository_files.rb +21 -3
  58. data/lib/gitlab/client/repository_submodules.rb +27 -0
  59. data/lib/gitlab/client/resource_label_events.rb +82 -0
  60. data/lib/gitlab/client/resource_state_events.rb +57 -0
  61. data/lib/gitlab/client/runners.rb +170 -18
  62. data/lib/gitlab/client/search.rb +66 -0
  63. data/lib/gitlab/client/services.rb +4 -1
  64. data/lib/gitlab/client/sidekiq.rb +2 -0
  65. data/lib/gitlab/client/snippets.rb +5 -3
  66. data/lib/gitlab/client/system_hooks.rb +9 -7
  67. data/lib/gitlab/client/tags.rb +10 -9
  68. data/lib/gitlab/client/templates.rb +100 -0
  69. data/lib/gitlab/client/todos.rb +7 -5
  70. data/lib/gitlab/client/user_snippets.rb +114 -0
  71. data/lib/gitlab/client/users.rb +302 -31
  72. data/lib/gitlab/client/versions.rb +18 -0
  73. data/lib/gitlab/client/wikis.rb +79 -0
  74. data/lib/gitlab/client.rb +48 -9
  75. data/lib/gitlab/configuration.rb +9 -6
  76. data/lib/gitlab/error.rb +73 -3
  77. data/lib/gitlab/file_response.rb +4 -2
  78. data/lib/gitlab/headers/page_links.rb +37 -0
  79. data/lib/gitlab/headers/total.rb +29 -0
  80. data/lib/gitlab/help.rb +16 -16
  81. data/lib/gitlab/objectified_hash.rb +27 -10
  82. data/lib/gitlab/paginated_response.rb +43 -25
  83. data/lib/gitlab/request.rb +51 -37
  84. data/lib/gitlab/shell.rb +6 -4
  85. data/lib/gitlab/shell_history.rb +11 -13
  86. data/lib/gitlab/version.rb +3 -1
  87. data/lib/gitlab.rb +23 -9
  88. metadata +59 -45
  89. data/.gitignore +0 -22
  90. data/CONTRIBUTING.md +0 -195
  91. data/Gemfile +0 -4
  92. data/Rakefile +0 -17
  93. data/bin/console +0 -10
  94. data/bin/setup +0 -6
  95. data/gitlab.gemspec +0 -33
  96. data/lib/gitlab/page_links.rb +0 -33
data/lib/gitlab/shell.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gitlab'
2
4
  require 'gitlab/help'
3
5
  require 'gitlab/cli_helpers'
@@ -15,7 +17,7 @@ class Gitlab::Shell
15
17
  trap('INT') { quit_shell } # capture ctrl-c
16
18
  setup
17
19
 
18
- while buffer = Readline.readline('gitlab> ')
20
+ while (buffer = Readline.readline('gitlab> '))
19
21
  begin
20
22
  parse_input buffer
21
23
 
@@ -34,7 +36,7 @@ class Gitlab::Shell
34
36
  data = execute command, arguments
35
37
  output_table command, arguments, data
36
38
  end
37
- rescue => e
39
+ rescue StandardError => e
38
40
  puts e.message
39
41
  end
40
42
  end
@@ -46,7 +48,7 @@ class Gitlab::Shell
46
48
  buf = Shellwords.shellwords(buffer)
47
49
 
48
50
  @command = buf.shift
49
- @arguments = buf.count > 0 ? buf : []
51
+ @arguments = buf.count.positive? ? buf : []
50
52
  end
51
53
 
52
54
  def setup
@@ -62,7 +64,7 @@ class Gitlab::Shell
62
64
  end
63
65
 
64
66
  # Execute a given command with arguements
65
- def execute(cmd=command, args=arguments)
67
+ def execute(cmd = command, args = arguments)
66
68
  raise "Unknown command: #{cmd}. See the 'help' for a list of valid commands." unless actions.include?(cmd.to_sym)
67
69
 
68
70
  confirm_command(cmd)
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Gitlab::Shell
2
4
  class History
3
5
  DEFAULT_HISTFILESIZE = 200
4
6
  DEFAULT_FILE_PATH = File.join(Dir.home, '.gitlab_shell_history')
5
7
 
6
- def initialize(options={})
8
+ def initialize(options = {})
7
9
  @file_path = options[:file_path] || DEFAULT_FILE_PATH
8
10
  Readline::HISTORY.clear
9
11
  end
@@ -13,13 +15,13 @@ class Gitlab::Shell
13
15
  end
14
16
 
15
17
  def save
16
- lines.each { |line| history_file.puts line if history_file }
18
+ lines.each { |line| history_file&.puts line }
17
19
  end
18
20
 
19
21
  def push(line)
20
22
  Readline::HISTORY << line
21
23
  end
22
- alias_method :<<, :push
24
+ alias << push
23
25
 
24
26
  def lines
25
27
  Readline::HISTORY.to_a.last(max_lines)
@@ -28,12 +30,8 @@ class Gitlab::Shell
28
30
  private
29
31
 
30
32
  def history_file
31
- if defined?(@history_file)
32
- @history_file
33
- else
34
- @history_file = File.open(history_file_path, 'w', 0600).tap do |file|
35
- file.sync = true
36
- end
33
+ @history_file ||= File.open(history_file_path, 'w', 0o600).tap do |file|
34
+ file.sync = true
37
35
  end
38
36
  rescue Errno::EACCES
39
37
  warn 'History not saved; unable to open your history file for writing.'
@@ -44,12 +42,12 @@ class Gitlab::Shell
44
42
  File.expand_path(@file_path)
45
43
  end
46
44
 
47
- def read_from_file
45
+ def read_from_file(&block)
48
46
  path = history_file_path
49
47
 
50
- File.foreach(path) { |line| yield(line) } if File.exist?(path)
51
- rescue => error
52
- warn "History file not loaded: #{error.message}"
48
+ File.foreach(path, &block) if File.exist?(path)
49
+ rescue StandardError => e
50
+ warn "History file not loaded: #{e.message}"
53
51
  end
54
52
 
55
53
  def max_lines
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
- VERSION = '4.5.0'.freeze
4
+ VERSION = '5.1.0'
3
5
  end
data/lib/gitlab.rb CHANGED
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gitlab/version'
2
4
  require 'gitlab/objectified_hash'
3
5
  require 'gitlab/configuration'
4
6
  require 'gitlab/error'
5
- require 'gitlab/page_links'
7
+ require 'gitlab/headers/page_links'
8
+ require 'gitlab/headers/total'
6
9
  require 'gitlab/paginated_response'
7
10
  require 'gitlab/file_response'
8
11
  require 'gitlab/request'
@@ -15,23 +18,31 @@ module Gitlab
15
18
  # Alias for Gitlab::Client.new
16
19
  #
17
20
  # @return [Gitlab::Client]
18
- def self.client(options={})
21
+ def self.client(options = {})
19
22
  Gitlab::Client.new(options)
20
23
  end
21
24
 
22
- # Delegate to Gitlab::Client
23
- def self.method_missing(method, *args, &block)
24
- return super unless client.respond_to?(method)
25
- client.send(method, *args, &block)
25
+ if Gem::Version.new(RUBY_VERSION).release >= Gem::Version.new('3.0.0')
26
+ def self.method_missing(method, *args, **keywargs, &block)
27
+ return super unless client.respond_to?(method)
28
+
29
+ client.send(method, *args, **keywargs, &block)
30
+ end
31
+ else
32
+ def self.method_missing(method, *args, &block)
33
+ return super unless client.respond_to?(method)
34
+
35
+ client.send(method, *args, &block)
36
+ end
26
37
  end
27
38
 
28
39
  # Delegate to Gitlab::Client
29
- def self.respond_to_missing?(method_name, include_private=false)
40
+ def self.respond_to_missing?(method_name, include_private = false)
30
41
  client.respond_to?(method_name) || super
31
42
  end
32
43
 
33
44
  # Delegate to HTTParty.http_proxy
34
- def self.http_proxy(address=nil, port=nil, username=nil, password=nil)
45
+ def self.http_proxy(address = nil, port = nil, username = nil, password = nil)
35
46
  Gitlab::Request.http_proxy(address, port, username, password)
36
47
  end
37
48
 
@@ -39,7 +50,10 @@ module Gitlab
39
50
  #
40
51
  # @return [Array<Symbol>]
41
52
  def self.actions
42
- hidden = /endpoint|private_token|auth_token|user_agent|sudo|get|post|put|\Adelete\z|validate|request_defaults|httparty/
53
+ # rubocop:disable Layout/LineLength
54
+ hidden =
55
+ /endpoint|private_token|auth_token|user_agent|sudo|get|post|put|patch|\Adelete\z|validate\z|request_defaults|httparty/
56
+ # rubocop:enable Layout/LineLength
43
57
  (Gitlab::Client.instance_methods - Object.methods).reject { |e| e[hidden] }
44
58
  end
45
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nihad Abbasov
@@ -9,50 +9,50 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-08-07 00:00:00.000000000 Z
12
+ date: 2024-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: httparty
15
+ name: base64
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.14.0
20
+ version: 0.2.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.14.0
27
+ version: 0.2.0
28
28
  - !ruby/object:Gem::Dependency
29
- name: terminal-table
29
+ name: httparty
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 1.5.1
34
+ version: '0.20'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.5.1
41
+ version: '0.20'
42
42
  - !ruby/object:Gem::Dependency
43
- name: pry
43
+ name: terminal-table
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :development
48
+ version: 1.5.1
49
+ type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 1.5.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -95,95 +95,110 @@ dependencies:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: rubocop
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
98
  description: Ruby client and CLI for GitLab API
113
99
  email:
114
- - mail@narkoz.me
100
+ - nihad@42na.in
115
101
  - asedge@gmail.com
116
102
  executables:
117
103
  - gitlab
118
104
  extensions: []
119
105
  extra_rdoc_files: []
120
106
  files:
121
- - ".gitignore"
122
107
  - CHANGELOG.md
123
- - CONTRIBUTING.md
124
- - Gemfile
125
108
  - LICENSE.txt
126
109
  - README.md
127
- - Rakefile
128
- - bin/console
129
- - bin/setup
130
110
  - exe/gitlab
131
- - gitlab.gemspec
132
111
  - lib/gitlab.rb
133
112
  - lib/gitlab/api.rb
134
113
  - lib/gitlab/cli.rb
135
114
  - lib/gitlab/cli_helpers.rb
136
115
  - lib/gitlab/client.rb
137
116
  - lib/gitlab/client/access_requests.rb
117
+ - lib/gitlab/client/application_settings.rb
118
+ - lib/gitlab/client/avatar.rb
138
119
  - lib/gitlab/client/award_emojis.rb
139
120
  - lib/gitlab/client/boards.rb
140
121
  - lib/gitlab/client/branches.rb
122
+ - lib/gitlab/client/broadcast_messages.rb
141
123
  - lib/gitlab/client/build_variables.rb
142
124
  - lib/gitlab/client/builds.rb
143
125
  - lib/gitlab/client/commits.rb
126
+ - lib/gitlab/client/container_registry.rb
144
127
  - lib/gitlab/client/deployments.rb
145
128
  - lib/gitlab/client/environments.rb
129
+ - lib/gitlab/client/epic_issues.rb
130
+ - lib/gitlab/client/epics.rb
146
131
  - lib/gitlab/client/events.rb
132
+ - lib/gitlab/client/features.rb
133
+ - lib/gitlab/client/group_badges.rb
134
+ - lib/gitlab/client/group_boards.rb
135
+ - lib/gitlab/client/group_labels.rb
147
136
  - lib/gitlab/client/group_milestones.rb
148
137
  - lib/gitlab/client/groups.rb
138
+ - lib/gitlab/client/issue_links.rb
149
139
  - lib/gitlab/client/issues.rb
150
140
  - lib/gitlab/client/jobs.rb
151
141
  - lib/gitlab/client/keys.rb
152
142
  - lib/gitlab/client/labels.rb
143
+ - lib/gitlab/client/lint.rb
144
+ - lib/gitlab/client/markdown.rb
153
145
  - lib/gitlab/client/merge_request_approvals.rb
154
146
  - lib/gitlab/client/merge_requests.rb
147
+ - lib/gitlab/client/merge_trains.rb
155
148
  - lib/gitlab/client/milestones.rb
156
149
  - lib/gitlab/client/namespaces.rb
157
150
  - lib/gitlab/client/notes.rb
151
+ - lib/gitlab/client/packages.rb
158
152
  - lib/gitlab/client/pipeline_schedules.rb
159
153
  - lib/gitlab/client/pipeline_triggers.rb
160
154
  - lib/gitlab/client/pipelines.rb
155
+ - lib/gitlab/client/project_badges.rb
156
+ - lib/gitlab/client/project_clusters.rb
157
+ - lib/gitlab/client/project_exports.rb
158
+ - lib/gitlab/client/project_release_links.rb
159
+ - lib/gitlab/client/project_releases.rb
161
160
  - lib/gitlab/client/projects.rb
161
+ - lib/gitlab/client/protected_tags.rb
162
+ - lib/gitlab/client/remote_mirrors.rb
162
163
  - lib/gitlab/client/repositories.rb
163
164
  - lib/gitlab/client/repository_files.rb
165
+ - lib/gitlab/client/repository_submodules.rb
166
+ - lib/gitlab/client/resource_label_events.rb
167
+ - lib/gitlab/client/resource_state_events.rb
164
168
  - lib/gitlab/client/runners.rb
169
+ - lib/gitlab/client/search.rb
165
170
  - lib/gitlab/client/services.rb
166
171
  - lib/gitlab/client/sidekiq.rb
167
172
  - lib/gitlab/client/snippets.rb
168
173
  - lib/gitlab/client/system_hooks.rb
169
174
  - lib/gitlab/client/tags.rb
175
+ - lib/gitlab/client/templates.rb
170
176
  - lib/gitlab/client/todos.rb
177
+ - lib/gitlab/client/user_snippets.rb
171
178
  - lib/gitlab/client/users.rb
179
+ - lib/gitlab/client/versions.rb
180
+ - lib/gitlab/client/wikis.rb
172
181
  - lib/gitlab/configuration.rb
173
182
  - lib/gitlab/error.rb
174
183
  - lib/gitlab/file_response.rb
184
+ - lib/gitlab/headers/page_links.rb
185
+ - lib/gitlab/headers/total.rb
175
186
  - lib/gitlab/help.rb
176
187
  - lib/gitlab/objectified_hash.rb
177
- - lib/gitlab/page_links.rb
178
188
  - lib/gitlab/paginated_response.rb
179
189
  - lib/gitlab/request.rb
180
190
  - lib/gitlab/shell.rb
181
191
  - lib/gitlab/shell_history.rb
182
192
  - lib/gitlab/version.rb
183
- homepage: https://github.com/narkoz/gitlab
193
+ homepage: https://github.com/NARKOZ/gitlab
184
194
  licenses:
185
- - BSD
186
- metadata: {}
195
+ - BSD-2-Clause
196
+ metadata:
197
+ homepage_uri: https://github.com/NARKOZ/gitlab
198
+ source_code_uri: https://github.com/NARKOZ/gitlab
199
+ bug_tracker_uri: https://github.com/NARKOZ/gitlab/issues
200
+ changelog_uri: https://github.com/NARKOZ/gitlab/releases
201
+ funding_uri: https://github.com/NARKOZ/SponsorMe
187
202
  post_install_message:
188
203
  rdoc_options: []
189
204
  require_paths:
@@ -192,15 +207,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
192
207
  requirements:
193
208
  - - ">="
194
209
  - !ruby/object:Gem::Version
195
- version: 2.0.0
210
+ version: '3.1'
196
211
  required_rubygems_version: !ruby/object:Gem::Requirement
197
212
  requirements:
198
213
  - - ">="
199
214
  - !ruby/object:Gem::Version
200
215
  version: '0'
201
216
  requirements: []
202
- rubyforge_project:
203
- rubygems_version: 2.7.7
217
+ rubygems_version: 3.5.16
204
218
  signing_key:
205
219
  specification_version: 4
206
220
  summary: A Ruby wrapper and CLI for the GitLab API
data/.gitignore DELETED
@@ -1,22 +0,0 @@
1
- *.gem
2
- *.rbc
3
- *.swp
4
- .bundle
5
- .config
6
- .yardoc
7
- Gemfile.lock
8
- InstalledFiles
9
- _yardoc
10
- coverage
11
- doc/
12
- lib/bundler/man
13
- pkg
14
- rdoc
15
- spec/reports
16
- test/tmp
17
- test/version_tmp
18
- tmp
19
- vendor/bundle
20
- .idea
21
- .ruby-version
22
- .ruby-gemset
data/CONTRIBUTING.md DELETED
@@ -1,195 +0,0 @@
1
- # Contributing to Gitlab
2
-
3
- Please take a moment to review this document in order to make the contribution
4
- process easy and effective for everyone involved!
5
-
6
- ## Using the issue tracker
7
-
8
- You can use the issues tracker for:
9
-
10
- * [bug reports](#bug-reports)
11
- * [feature requests](#feature-requests)
12
- * [submitting pull requests](#pull-requests)
13
-
14
- Use [Stackoverflow](http://stackoverflow.com/) for questions and personal support requests.
15
-
16
- ## Bug reports
17
-
18
- A bug is a _demonstrable problem_ that is caused by the code in the repository.
19
- Good bug reports are extremely helpful - thank you!
20
-
21
- Guidelines for bug reports:
22
-
23
- 1. **Use the GitHub issue search** &mdash; check if the issue has already been
24
- reported.
25
-
26
- 2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
27
- `master` branch in the repository.
28
-
29
- 3. **Isolate and report the problem** &mdash; ideally create a reduced test
30
- case.
31
-
32
- Please try to be as detailed as possible in your report. Include information about
33
- your Ruby, Gitlab client and GitLab instance versions. Please provide steps to
34
- reproduce the issue as well as the outcome you were expecting! All these details
35
- will help developers to fix any potential bugs.
36
-
37
- Example:
38
-
39
- > Short and descriptive example bug report title
40
- >
41
- > A summary of the issue and the environment in which it occurs. If suitable,
42
- > include the steps required to reproduce the bug.
43
- >
44
- > 1. This is the first step
45
- > 2. This is the second step
46
- > 3. Further steps, etc.
47
- >
48
- > Any other information you want to share that is relevant to the issue being
49
- > reported. This might include the lines of code that you have identified as
50
- > causing the bug, and potential solutions (and your opinions on their
51
- > merits).
52
-
53
- ## Feature requests
54
-
55
- Feature requests are welcome. But take a moment to find out whether your idea
56
- fits with the scope and aims of the project. It's up to *you* to make a strong
57
- case to convince the community of the merits of this feature.
58
- Please provide as much detail and context as possible.
59
-
60
- ## Contributing Documentation
61
-
62
- Code documentation has a special convention: it uses [YARD](http://yardoc.org/)
63
- formatting and the first paragraph is considered to be a short summary.
64
-
65
- For methods say what it will do. For example write something like:
66
-
67
- ```ruby
68
- # Reverses the contents of a String or IO object.
69
- #
70
- # @param [String, #read] contents the contents to reverse
71
- # @return [String] the contents reversed lexically
72
- def reverse(contents)
73
- contents = contents.read if contents.respond_to? :read
74
- contents.reverse
75
- end
76
- ```
77
-
78
- For classes, modules say what it is. For example write something like:
79
-
80
- ```ruby
81
- # Defines methods related to groups.
82
- module Groups
83
- ```
84
-
85
- Keep in mind that the documentation notes might show up in a summary somewhere,
86
- long texts in the documentation notes create very ugly summaries. As a rule of thumb
87
- anything longer than 80 characters is too long.
88
-
89
- Try to keep unnecessary details out of the first paragraph, it's only there to
90
- give a user a quick idea of what the documented "thing" does/is. The rest of the
91
- documentation notes can contain the details, for example parameters and what
92
- is returned.
93
-
94
- If possible include examples. For example:
95
-
96
- ```ruby
97
- # Gets information about a project.
98
- #
99
- # @example
100
- # Gitlab.project(3)
101
- # Gitlab.project('gitlab')
102
- #
103
- # @param [Integer, String] id The ID or name of a project.
104
- # @return [Gitlab::ObjectifiedHash]
105
- def project(id)
106
- ```
107
-
108
- This makes it easy to test the examples so that they don't go stale and examples
109
- are often a great help in explaining what a method does.
110
-
111
- ## Pull requests
112
-
113
- Good pull requests - patches, improvements, new features - are a fantastic
114
- help. They should remain focused in scope and avoid containing unrelated
115
- commits.
116
-
117
- **IMPORTANT**: By submitting a patch, you agree that your work will be
118
- licensed under the license used by the project.
119
-
120
- If you have any large pull request in mind (e.g. implementing features,
121
- refactoring code, etc), **please ask first** otherwise you risk spending
122
- a lot of time working on something that the project's developers might
123
- not want to merge into the project.
124
-
125
- Please adhere to the coding conventions in the project (indentation,
126
- accurate comments, etc.) and don't forget to add your own tests and
127
- documentation. When working with git, we recommend the following process
128
- in order to craft an excellent pull request:
129
-
130
- 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
131
- and configure the remotes:
132
-
133
- ```sh
134
- # Clone your fork of the repo into the current directory
135
- git clone https://github.com/<your-username>/gitlab
136
- # Navigate to the newly cloned directory
137
- cd gitlab
138
- # Assign the original repo to a remote called "upstream"
139
- git remote add upstream https://github.com/NARKOZ/gitlab
140
- ```
141
-
142
- 2. If you cloned a while ago, get the latest changes from upstream:
143
-
144
- ```bash
145
- git checkout master
146
- git pull upstream master
147
- ```
148
-
149
- 3. Create a new topic branch (off of `master`) to contain your feature, change,
150
- or fix.
151
-
152
- **IMPORTANT**: Making changes in `master` is discouraged. You should always
153
- keep your local `master` in sync with upstream `master` and make your
154
- changes in topic branches.
155
-
156
- ```sh
157
- git checkout -b <topic-branch-name>
158
- ```
159
-
160
- 4. Commit your changes in logical chunks. Keep your commit messages organized,
161
- with a short description in the first line and more detailed information on
162
- the following lines. Feel free to use Git's
163
- [interactive rebase](https://help.github.com/articles/about-git-rebase/)
164
- feature to tidy up your commits before making them public.
165
-
166
- 5. Make sure all the tests are still passing.
167
-
168
- ```sh
169
- rake
170
- ```
171
-
172
- 6. Push your topic branch up to your fork:
173
-
174
- ```sh
175
- git push origin <topic-branch-name>
176
- ```
177
-
178
- 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
179
- with a clear title and description.
180
-
181
- 8. If you haven't updated your pull request for a while, you should consider
182
- rebasing on master and resolving any conflicts.
183
-
184
- **IMPORTANT**: _Never ever_ merge upstream `master` into your branches. You
185
- should always `git rebase` on `master` to bring your changes up to date when
186
- necessary.
187
-
188
- ```sh
189
- git checkout master
190
- git pull upstream master
191
- git checkout <your-topic-branch>
192
- git rebase master
193
- ```
194
-
195
- Thank you for your contributions!
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in gitlab.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- require 'rspec/core/rake_task'
4
- RSpec::Core::RakeTask.new(:spec) do |spec|
5
- spec.rspec_opts = ['--color', '--format d']
6
- end
7
-
8
- require 'rubocop/rake_task'
9
- RuboCop::RakeTask.new(:rubocop) do |task|
10
- task.options = ['-D', '--parallel']
11
- end
12
-
13
- if ENV['TRAVIS_CI_RUBOCOP']
14
- task default: :rubocop
15
- else
16
- task default: :spec
17
- end
data/bin/console DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # ENV['GITLAB_API_ENDPOINT'] = ''
4
- # ENV['GITLAB_API_PRIVATE_TOKEN'] = ''
5
-
6
- require 'bundler/setup'
7
- require 'gitlab'
8
- require 'pry'
9
-
10
- Pry.start
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install &&
6
- echo 'NOTE: You may need to set GITLAB_API_ENDPOINT and GITLAB_API_PRIVATE_TOKEN environment variables.'