gitlab-triage 0.8.0 → 0.8.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff4171b6337da58a1c33a3cd9bc903e1d2c31292462117b1b479b1445948a603
|
4
|
+
data.tar.gz: 219a8eac9342d358f4a6bccd2e1abc4338d5b10a766d3a7b81ab41a5ed797cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7123c4fc8ea9722acd47db48aafa651437e64a78bc5c5172aec35cf48a7714650d8385dd0842a4a7bc68a27bccf3af1d0275b29b139a4f9de14b8a36db99c9ec
|
7
|
+
data.tar.gz: d9308ca1eed39ca94712203796015763c846a042db1a1865001d2046ef94b146696aa3f26a0ad4f6a3474f335b4947cf61659eae38294655a1c76ea662fee506
|
@@ -38,17 +38,20 @@ module Gitlab
|
|
38
38
|
def format_item(item)
|
39
39
|
return item unless resource
|
40
40
|
|
41
|
-
SUPPORTED_PLACEHOLDERS.
|
42
|
-
next unless
|
41
|
+
SUPPORTED_PLACEHOLDERS.inject(item) do |comment, (placeholder, formatted_text)|
|
42
|
+
next comment unless comment.include?("{{#{placeholder}}}")
|
43
43
|
|
44
44
|
methods = formatted_text.match(/.*#{PLACEHOLDER_REGEX}.*/)[1].split('.')
|
45
45
|
fields = resource_fields(resource, methods)
|
46
46
|
|
47
47
|
final_fields = fields.map { |field| formatted_text.sub(PLACEHOLDER_REGEX, field.to_s) }
|
48
|
-
item.gsub!("{{#{placeholder}}}", final_fields.join(', ')) if final_fields.any?
|
49
|
-
end
|
50
48
|
|
51
|
-
|
49
|
+
if final_fields.any?
|
50
|
+
comment.gsub("{{#{placeholder}}}", final_fields.join(', '))
|
51
|
+
else
|
52
|
+
comment
|
53
|
+
end
|
54
|
+
end
|
52
55
|
end
|
53
56
|
|
54
57
|
def resource_fields(resource, methods)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-triage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|