Sha256: 082b690544ea05874ac44ab0342e8e4b04653a74908525d0cd68cfd506345c98

Contents?: true

Size: 617 Bytes

Versions: 4

Compression:

Stored size: 617 Bytes

Contents

require 'jira-ruby'

module JiraIssues
  class JiraAdapter
    def create_task(task)
      issue = client.Issue.build
      issue.save(task.print)
    end

    def available?
      response = client.get('/')
      response.code == '200'
    end

    def jql(jql_query, fields)
      client.Issue.jql(jql_query, fields)
    end

    private

    def client
      @client = JIRA::Client.new(
          username: ENV['JIRA_USERNAME'],
          password: ENV['JIRA_PASSWORD'],
          site: ENV['JIRA_URL'],
          context_path: '',
          auth_type: :basic,
          read_timeout: 120
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
jira_issues-0.0.5 lib/jira_issues/jira_adapter.rb
jira-issues-0.0.4 lib/jira_issues/jira_adapter.rb
jira-issues-0.0.2 lib/jira_issues/jira_adapter.rb
jira-issues-0.0.1 lib/jira_issues/jira_adapter.rb