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: 0b8300cf129b3aefc203d528814c84eb8e06fa54154599b1b4e818f9365ab93c
4
- data.tar.gz: e9d4b656207d0fa3322e10cd8618d6ac4bed5122b02f2dca34220d576cf81f57
3
+ metadata.gz: ff4171b6337da58a1c33a3cd9bc903e1d2c31292462117b1b479b1445948a603
4
+ data.tar.gz: 219a8eac9342d358f4a6bccd2e1abc4338d5b10a766d3a7b81ab41a5ed797cbd
5
5
  SHA512:
6
- metadata.gz: 2ceb150c8d07902495e80852aa914c91a14bbd82f84ab4123713f086282a5a7445bb141228eb50a9caef65d78957aecc0e889ec948a95193c046d659feaf31ba
7
- data.tar.gz: b5e183ed3ab41aea72b54c4eb790d24e61c2422297d652139b22170da2cab69a04fe38e07e5de0ba9c99d95fd1a0a9c8c3169a7241f62bafffb94c2947a5263b
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.each do |placeholder, formatted_text|
42
- next unless item.include?("{{#{placeholder}}}")
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
- item
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)
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Triage
3
- VERSION = '0.8.0'.freeze
3
+ VERSION = '0.8.1'.freeze
4
4
  end
5
5
  end
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.0
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-14 00:00:00.000000000 Z
11
+ date: 2018-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport