Class: CiToolkit::Jira
- Inherits:
-
Object
- Object
- CiToolkit::Jira
- Defined in:
- lib/ci_toolkit/jira.rb
Overview
Utility class to parse a Jira ticket from a string
Instance Attribute Summary collapse
-
#ticket ⇒ Object
readonly
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(github_pr = CiToolkit::DvcsPrFactory.create(CiToolkit::BitriseEnv.new), git = CiToolkit::Git.new, ticket_regex_keys = ENV.fetch("SUPPORTED_JIRA_PROJECT_KEYS_REGEX", nil)) ⇒ Jira
constructor
A new instance of Jira.
Constructor Details
#initialize(github_pr = CiToolkit::DvcsPrFactory.create(CiToolkit::BitriseEnv.new), git = CiToolkit::Git.new, ticket_regex_keys = ENV.fetch("SUPPORTED_JIRA_PROJECT_KEYS_REGEX", nil)) ⇒ Jira
Returns a new instance of Jira.
8 9 10 11 12 13 14 15 |
# File 'lib/ci_toolkit/jira.rb', line 8 def initialize( github_pr = CiToolkit::DvcsPrFactory.create(CiToolkit::BitriseEnv.new), git = CiToolkit::Git.new, ticket_regex_keys = ENV.fetch("SUPPORTED_JIRA_PROJECT_KEYS_REGEX", nil) ) @ticket_regex_keys = ticket_regex_keys @ticket = parse_ticket(github_pr.nil? ? "" : github_pr.title) || parse_ticket(git.nil? ? "" : git.branch) end |
Instance Attribute Details
#ticket ⇒ Object (readonly)
Returns the value of attribute ticket.
6 7 8 |
# File 'lib/ci_toolkit/jira.rb', line 6 def ticket @ticket end |