Class: SupportOps::GitLab::RepositorySubmodules
- Defined in:
- lib/support_ops_gitlab/gitlab/repository_submodules.rb
Overview
Document attribute meaning
Defines the class RepositorySubmodules within the module SupportOps::GitLab.
Instance Attribute Summary collapse
-
#author_email ⇒ String
The current value of author_email.
-
#author_name ⇒ String
The current value of author_name.
-
#authored_date ⇒ String
The current value of authored_date.
-
#committed_date ⇒ String
The current value of committed_date.
-
#committer_email ⇒ String
The current value of committer_email.
-
#committer_name ⇒ String
The current value of committer_name.
-
#created_at ⇒ String
The current value of created_at.
-
#id ⇒ String
The current value of id.
-
#message ⇒ String
The current value of message.
-
#parent_ids ⇒ Array
The current value of parent_ids.
-
#short_id ⇒ String
The current value of short_id.
-
#status ⇒ String
The current value of status.
-
#title ⇒ String
The current value of title.
Class Method Summary collapse
-
.update!(project_id, path, branch, sha, message = nil) ⇒ Object
Update existing submodule reference in repository.
Methods inherited from Base
#activate!, #approve!, attributes, #badges, #ban!, #block!, client, #client=, #commits, configure, #contributors, #create_support_pin!, #deactivate!, define_attributes, #delete!, #diffs, #disable_2fa!, #discussions, #emails, #encoded_path, #events, #find, #find!, #gpg_keys, #hard_delete!, #impersonations, #initialize, #issues, #jobs, #latest_pipeline, #members, #memberships, #merge_requests, #move!, #notes, #paid?, #pats, #pipeline_variables, #pipelines, #preferences, #projects, readonly_attributes, #reject!, #revoke!, #rotate!, #save!, #ssh_keys, #store_original_attributes, #subscribe!, #support_pin, to_hash, #tokens, #unban!, #unblock!, #unsubscribe!, #webhooks
Constructor Details
This class inherits a constructor from SupportOps::GitLab::Base
Instance Attribute Details
#author_email ⇒ String
Returns the current value of author_email.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def @author_email end |
#author_name ⇒ String
Returns the current value of author_name.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def @author_name end |
#authored_date ⇒ String
Returns the current value of authored_date.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def @authored_date end |
#committed_date ⇒ String
Returns the current value of committed_date.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def committed_date @committed_date end |
#committer_email ⇒ String
Returns the current value of committer_email.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def committer_email @committer_email end |
#committer_name ⇒ String
Returns the current value of committer_name.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def committer_name @committer_name end |
#created_at ⇒ String
Returns the current value of created_at.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def created_at @created_at end |
#id ⇒ String
Returns the current value of id.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def id @id end |
#message ⇒ String
Returns the current value of message.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def @message end |
#parent_ids ⇒ Array
Returns the current value of parent_ids.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def parent_ids @parent_ids end |
#short_id ⇒ String
Returns the current value of short_id.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def short_id @short_id end |
#status ⇒ String
Returns the current value of status.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def status @status end |
#title ⇒ String
Returns the current value of title.
26 27 28 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 26 def title @title end |
Class Method Details
.update!(project_id, path, branch, sha, message = nil) ⇒ Object
Update existing submodule reference in repository
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/support_ops_gitlab/gitlab/repository_submodules.rb', line 62 def self.update!(project_id, path, branch, sha, = nil) data = { branch: branch, commit_sha: sha } data[:commit_message] = unless .nil? response = client.conneciton.put("projects/#{project_id}/repository/submodules/#{ERB::Util.url_encode(path)}", data.to_json) body = Oj.load(response.body) raise "Failed to update submodule #{path} => #{body}" unless response.status == 200 RepositorySubmodules.new(body) end |