gitlab-release-tools 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 20787d80dd2afc4ea5def81e040bf317891a2bfb5821c720b6998b97d0b1fc45
4
- data.tar.gz: f858b5b180f4669929d2abc1f29c866929f6ffebdfc3ace9d329dc86f8cffb90
3
+ metadata.gz: fc5b89c86cac432823c0c80465f2db7bca594f032f147acb2a44e3fc541eeca0
4
+ data.tar.gz: 486d3550693609d543427d5cbd4186c19db079289600384da6c6b57d256062f8
5
5
  SHA512:
6
- metadata.gz: 914e76075bd497179459a4358db51efc572d344ecf0e2ed2a62d2f41e88af04461a54eb76123f9bcc2ad150a8b45464fe938af340214a9ad6cdac90f4e0db574
7
- data.tar.gz: ac452f8aee493b030cb8f642b55dba855c6714bd3c02e22d40354736d46f40dffbed8a4bb8065defa367758a58355332d959d8ab90f72316013468d6e94cd878
6
+ metadata.gz: 9ae7ca58e5f26bfceddf60705098129908146e55f48e8be23efbe502778c1a9050bbe54d8f4bd7ee3241732d1efc05d45547c6daf9bb56813387c8c4ab01a81a
7
+ data.tar.gz: d58da60bac59b9342ee7feebc8985b778de4cf1c87bca5434a95558327ffb4284e71dea511a9b56c205d1d84f983edc19b9e13a0b3b10bab591cfbdff965d4b5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-release-tools (0.1.0)
4
+ gitlab-release-tools (0.2.0)
5
5
  gitlab (~> 4.12.0)
6
6
 
7
7
  GEM
@@ -13,16 +13,21 @@ module Gitlab
13
13
  end
14
14
 
15
15
  def to_s
16
- @elements.map { |element| element.to_s }
16
+ to_s_with_reference(true)
17
+ end
18
+
19
+ # @param [Boolean] with_reference
20
+ def to_s_with_reference(with_reference)
21
+ @elements.map { |element| element.to_s_with_reference(with_reference) }
17
22
  .join("\n")
18
- #.reject(&:empty?)
19
23
  end
20
24
 
21
25
  # @param [String] path
22
- # @param [TrueClass or FalseClass] appending default false
23
- def write_on_file(path, appending = false)
26
+ # @param [Boolean] appending default false
27
+ # @param [Boolean] with_reference default true
28
+ def write_on_file(path, appending = false, with_reference = true)
24
29
  # @type [String] changelog_string
25
- changelog_string = to_s
30
+ changelog_string = to_s_with_reference(with_reference)
26
31
 
27
32
  File.open(path, appending ? "a" : "w+") do |file|
28
33
  file.puts(changelog_string)
@@ -11,20 +11,21 @@ module Gitlab
11
11
  @title = title
12
12
  end
13
13
 
14
- def to_s
15
- "[#{@id}] #{@title}"
14
+ # @param [Boolean] with_reference
15
+ def to_s_with_reference(with_reference)
16
+ "- #{title}"
16
17
  end
17
18
  end
18
19
 
19
20
  class MergeRequest < Entry
20
- def to_s
21
- "- #{title} !#{id}"
21
+ def to_s_with_reference(with_reference)
22
+ with_reference ? "- #{title} !#{id}" : super
22
23
  end
23
24
  end
24
25
 
25
26
  class Issue < Entry
26
- def to_s
27
- "- #{title} ##{id}"
27
+ def to_s_with_reference(with_reference)
28
+ with_reference ? "- #{title} ##{id}" : super
28
29
  end
29
30
  end
30
31
  end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Release
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-release-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Del Fante
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-24 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab