class Redk::CapnPanda::JiraClient

Public Class Methods

from_keychain() click to toggle source
# File lib/redk/capn_panda/jira_client.rb, line 20
def self.from_keychain
  @keychain_client ||= (
    keychain_item = Keychain.default.internet_passwords.where(server: self.jira_domain).first
    raise Redk::CapnPanda::KeyChainError, "#{self.jira_domain} is in your keychain" unless keychain_item
    self.from_keychain_item(keychain_item) if keychain_item
  )
end
from_keychain_item(keychain_item) click to toggle source
# File lib/redk/capn_panda/jira_client.rb, line 28
def self.from_keychain_item(keychain_item)
  options = {
              :username => keychain_item.account,
              :password => keychain_item.password,
              :site     => "https://#{self.jira_domain}",
              :context_path => '',
              :auth_type => :basic
            }
  self.new(options)
end
jira_domain() click to toggle source
# File lib/redk/capn_panda/jira_client.rb, line 4
def self.jira_domain
  Redk::CapnPanda.config.jira_domain
end

Public Instance Methods

inspect() click to toggle source
# File lib/redk/capn_panda/jira_client.rb, line 8
def inspect
  "<Redk::CapnPanda::Jira::Client site: #{options[:site]}>"
end
my_issues() click to toggle source
# File lib/redk/capn_panda/jira_client.rb, line 12
def my_issues
  @my_issues ||= (
    my_issues_jql = "assignee = currentUser() AND resolution = Unresolved ORDER BY updatedDate DESC"
    issues = JIRA::Resource::Issue.jql(self, my_issues_jql)
    issues
  )
end