ruboty-redmine 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e90a7c8715980e024dcf49c34fbec39fc8ae48e
4
- data.tar.gz: 482337e7a40e9e8477dab1e7ad435d96be101a0e
3
+ metadata.gz: 0b3cbbbf92bef42386c6270f8e462b4502b62893
4
+ data.tar.gz: f6a2a3c0950bb1f3505a258a01a35738c2aded0c
5
5
  SHA512:
6
- metadata.gz: 25cb89b79d296d0efdbccea99fe1bc46862d3910f9ad833e77fbad432439d6ad238a692411db2b89624706daacc8d515dc52938a5f1db7f6f190c489225f86bd
7
- data.tar.gz: a8fa00ca1c418536b9ed64da242605abaa45e70816a7db9f17b0d2ddcbe277327a5ba5dbdc515a727bc3159218e2439b6b89a62444e0edf9bdba27ab8062263d
6
+ metadata.gz: 8d9511404ce55770fb6e3509d5ae32b5e230e9e0c9ddf5ddb69a8932daa25b2b8abe206874dcf3e9fa9470c7e63451a7ea257c7386688ce09a6d2c3dceea84de
7
+ data.tar.gz: ebaed6cfbd4205baec12c64e6d8ff1e7a3ed75ca5a2e9e8b6dc9c4ff9e83c0f19392de4eacc1ac8b0ed88ca7a3b303a76dc28a43aec95f75338aabc22063a245
@@ -3,6 +3,8 @@ module Ruboty
3
3
  class Redmine < Base
4
4
  env :REDMINE_URL, 'Redmine url (e.g. http://your-redmine)', optional: false
5
5
  env :REDMINE_API_KEY, 'Redmine REST API key', optional: false
6
+ env :REDMINE_BASIC_AUTH_USER, 'Basic Auth User', optional: true
7
+ env :REDMINE_BASIC_AUTH_PASSWORD, 'Basic Auth Password', optional: true
6
8
 
7
9
  on(
8
10
  /create issue (?<rest>.+)/,
@@ -67,6 +69,8 @@ module Ruboty
67
69
  Ruboty::Redmine::Client.new(
68
70
  ENV['REDMINE_URL'],
69
71
  ENV['REDMINE_API_KEY'],
72
+ basic_auth_user: ENV['REDMINE_BASIC_AUTH_USER'],
73
+ basic_auth_password: ENV['REDMINE_BASIC_AUTH_PASSWORD'],
70
74
  )
71
75
  end
72
76
  end
@@ -5,9 +5,10 @@ require 'uri'
5
5
  module Ruboty
6
6
  module Redmine
7
7
  class Client
8
- def initialize(url, api_key)
8
+ def initialize(url, api_key, options)
9
9
  @url = url
10
10
  @api_key = api_key
11
+ @options = options
11
12
  end
12
13
 
13
14
  def projects
@@ -50,6 +51,13 @@ module Ruboty
50
51
  faraday.response :logger if ENV['DEBUG']
51
52
  faraday.adapter Faraday.default_adapter
52
53
  end
54
+
55
+ basic_auth_user = @options[:basic_auth_user]
56
+ basic_auth_password = @options[:basic_auth_password]
57
+
58
+ if basic_auth_user && basic_auth_password
59
+ conn.basic_auth(basic_auth_user, basic_auth_password)
60
+ end
53
61
  end
54
62
 
55
63
  def get(path, params = {})
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Redmine
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-redmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai