File: clients_helper.rb

package info (click to toggle)
ruby-jira 2.1.5-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 968 kB
  • sloc: ruby: 5,125; makefile: 12
file content (16 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ClientsHelper
  def with_each_client
    clients = {}

    oauth_client = JIRA::Client.new(consumer_key: 'foo', consumer_secret: 'bar')
    oauth_client.set_access_token('abc', '123')
    clients['http://localhost:2990'] = oauth_client

    basic_client = JIRA::Client.new(username: 'foo', password: 'bar', auth_type: :basic, use_ssl: false)
    clients['http://foo:bar@localhost:2990'] = basic_client

    clients.each do |site_url, client|
      yield site_url, client
    end
  end
end