Class: RoboPigeon::Dsl::GitLabCommit
- Defined in:
- lib/robopigeon/gitlab/commit_dsl.rb
Instance Attribute Summary collapse
-
#commit ⇒ Object
Returns the value of attribute commit.
Class Method Summary collapse
Instance Method Summary collapse
- #author(name, email) ⇒ Object
- #branch(name) ⇒ Object
- #file(path, content = nil) ⇒ Object
-
#initialize ⇒ GitLabCommit
constructor
A new instance of GitLabCommit.
- #message(message) ⇒ Object
Methods inherited from Base
#method_missing, #respond_to_missing?
Methods inherited from Job
#gitlab, #jenkins, #jira, #slack
Methods included from Helpers
Methods included from Helpers::Markdown
#confluence_from_md, #html_from_md, #jira_from_md, #slack_from_md
Methods included from Helpers::GitLab
#deployment_code_change_stats, #deployment_diff_link, #deployment_ref, #deployment_sha, #deployment_shortlog, #deployment_time, #environment_link, #tickets_in_log_since_deployment_to
Methods included from Helpers::Slack
#slack_name_for, #slack_user_for, #slack_user_group
Methods included from Helpers::Jira
#jira_last_created_ticket, #jira_last_created_ticket_link, #jira_last_created_ticket_slack_link, #jira_slack_link
Methods included from Helpers::Git
#changed_since?, #git_branch_merged_source, #git_branch_merged_target, #git_committer_email, #git_committer_name, #git_merger_email, #git_merger_name
Constructor Details
#initialize ⇒ GitLabCommit
Returns a new instance of GitLabCommit.
5 6 7 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 5 def initialize self.commit = RoboPigeon::GitLab::Commit.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RoboPigeon::Dsl::Base
Instance Attribute Details
#commit ⇒ Object
Returns the value of attribute commit.
4 5 6 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 4 def commit @commit end |
Class Method Details
.run(&block) ⇒ Object
9 10 11 12 13 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 9 def self.run(&block) instance = new instance.instance_eval(&block) instance.commit.commit! end |
Instance Method Details
#author(name, email) ⇒ Object
50 51 52 53 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 50 def (name, email) commit. = email commit. = name end |
#branch(name) ⇒ Object
63 64 65 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 63 def branch(name) commit.branch = name end |
#file(path, content = nil) ⇒ Object
24 25 26 27 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 24 def file(path, content=nil) method = File.exist?(path) ? 'update' : 'create' commit.add_file(path, content, method) end |
#message(message) ⇒ Object
37 38 39 |
# File 'lib/robopigeon/gitlab/commit_dsl.rb', line 37 def () commit. = end |