ruboty-redmine 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruboty/handlers/redmine.rb +4 -0
- data/lib/ruboty/redmine/client.rb +9 -1
- data/lib/ruboty/redmine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b3cbbbf92bef42386c6270f8e462b4502b62893
|
4
|
+
data.tar.gz: f6a2a3c0950bb1f3505a258a01a35738c2aded0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = {})
|