lita-gitlab 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/lita/handlers/gitlab.rb +4 -4
- data/lita-gitlab.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f37561665bdfd52aab2af51b43f6b076d5b763d
|
4
|
+
data.tar.gz: 6b0e0d041e495003ffaba88b71e8723e34811b70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65177e85af88ad971cc18166821d989c73cd4d84fd29cbd5aa1073270159c07550dbdd783599c602fb4be9f82efb4f68a0b0e568e0d78926357fec0419593e94
|
7
|
+
data.tar.gz: b3e4fb379463ee6f58f0e36392ed7f1756a4ed9623c0bdbb4690b90933eb0a2b5469e7325ee1232f971c1c4898a630aa98c6d929d59d33eb15f74f2936713608
|
data/README.md
CHANGED
@@ -32,15 +32,17 @@ ie: `my_team`.
|
|
32
32
|
``` ruby
|
33
33
|
Lita.configure do |config|
|
34
34
|
config.handlers.gitlab.default_room = '#general'
|
35
|
-
config.url = 'http://example.gitlab/'
|
36
|
-
config.group = 'group_name'
|
35
|
+
config.handlers.gitlab.url = 'http://example.gitlab/'
|
36
|
+
config.handlers.gitlab.group = 'group_name'
|
37
37
|
end
|
38
38
|
```
|
39
39
|
|
40
40
|
## Usage
|
41
41
|
|
42
42
|
* `targets` Channel(s) separated by commas.
|
43
|
-
|
43
|
+
* `project` The name of the specific project (only needed for webhooks).
|
44
|
+
|
45
|
+
You will need to add a GitLab Webhook url that points to: `http://address.of./lita/gitlab?targets=<targets>&project=<project>`
|
44
46
|
|
45
47
|
## License
|
46
48
|
|
data/lib/lita/handlers/gitlab.rb
CHANGED
@@ -16,7 +16,7 @@ module Lita
|
|
16
16
|
data[:project] = request.params['project']
|
17
17
|
message = format_message(data)
|
18
18
|
if message
|
19
|
-
targets = request.params['targets'] ||
|
19
|
+
targets = request.params['targets'] || Lita.config.handlers.gitlab.default_room
|
20
20
|
rooms = []
|
21
21
|
targets.split(',').each do |param_target|
|
22
22
|
rooms << param_target
|
@@ -49,9 +49,9 @@ module Lita
|
|
49
49
|
if data.key? :object_kind
|
50
50
|
if data[:object_attributes].key? :target_branch
|
51
51
|
# Merge request
|
52
|
-
url = "#{
|
53
|
-
url += data[:project] ? "#{
|
54
|
-
data[:object_attributes][:link] = "<#{url}|#{data[:title]}>"
|
52
|
+
url = "#{Lita.config.handlers.gitlab.url}"
|
53
|
+
url += data[:project] ? "#{Lita.config.handlers.gitlab.group}/#{data[:project]}/merge_requests/#{data[:object_attributes][:iid]}" : "groups/#{Lita.config.handlers.gitlab.group}"
|
54
|
+
data[:object_attributes][:link] = "<#{url}|#{data[:object_attributes][:title]}>"
|
55
55
|
build_message "web.#{data[:object_kind]}.#{data[:object_attributes][:state]}", data[:object_attributes]
|
56
56
|
else
|
57
57
|
# Issue
|
data/lita-gitlab.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-gitlab'
|
3
|
-
spec.version = '1.0.
|
3
|
+
spec.version = '1.0.3'
|
4
4
|
spec.authors = ['Emilio Figueroa']
|
5
5
|
spec.email = ['emiliofigueroatorres@gmail.com']
|
6
6
|
spec.description = %q{A Lita handler that will display GitLab messages in the channel}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-gitlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emilio Figueroa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|