Class: RoboPigeon::Dsl::Jira

Inherits:
JiraRoot show all
Defined in:
lib/robopigeon/jira/dsl.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from JiraRoot

#api_key, #api_url, #enabled, #wait_for_state_timeout

Methods inherited from Base

#method_missing, #respond_to_missing?

Methods inherited from Job

#gitlab, #jenkins, #jira, #slack

Methods included from Helpers

#skip

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RoboPigeon::Dsl::Base

Class Method Details

.run(&block) ⇒ Object



53
54
55
56
57
58
59
60
# File 'lib/robopigeon/jira/dsl.rb', line 53

def self.run(&block)
  if RoboPigeon::Jira::Client.enabled
    jira = RoboPigeon::Dsl::Jira.new
    jira.instance_eval(&block)
  else
    puts 'Jira is disabled, please remove `enabled false` from your global jira config'
  end
end

Instance Method Details

#comment_on(number, comment) ⇒ Object



85
86
87
88
# File 'lib/robopigeon/jira/dsl.rb', line 85

def comment_on(number, comment)
  jira = RoboPigeon::Jira::Ticket.new(number)
  jira.add_comment(comment)
end

#ticket(number = nil, &block) ⇒ Object



71
72
73
# File 'lib/robopigeon/jira/dsl.rb', line 71

def ticket(number = nil, &block)
  RoboPigeon::Dsl::JiraTicket.run(number, &block)
end