sem_ver_components 0.2.0 → 0.2.1

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: c769d2f50e4b9b47d7244d596c497781797539059ae577b3922221a0b55fdfb4
4
- data.tar.gz: c265fe89c722f6092b0f8061ea556244131f1d3ce13de0ba24c2fb0714e05d04
3
+ metadata.gz: 3d2992cb6bc3198b8bb2d72c34ebde42daf01a1c7aa3804fba463f65570557dc
4
+ data.tar.gz: 8fb753b456aaded0b3f8b806605223c5350bf4c1ac89e802bb35718e69aef8c8
5
5
  SHA512:
6
- metadata.gz: fc08045f4e3552af8deefe3e4086b8d9e4e80c39bfe65a2c00a8ab25b7eeccbcf089207adcdcb5832308abaa3a2008343c393a124dba4948f8a49b0e161e82d6
7
- data.tar.gz: 021e88d06a2ce6fc31cb5d146e211c9436db6ec4da7eaafd151ce16df08347f179cd286782d42e4f10cfeb89f668bac14420a91786e449d757c51205f2b70905
6
+ metadata.gz: fe56b8eef4241043ac2980adcbde83961beb215f6a052b0430efb203cc813a8f91113bd5685bfd747092d91c021426e6b0dc603879c3340f394757cfee06f1da
7
+ data.tar.gz: e1ad8f9b10b33cf149f535c85f889ff499c94d9f038900f35545471c050213b5fe8d5b169a46feaf05b10d8a40cbdc0c91d5790ec2a790712ad9d4f68737cec2
@@ -10,7 +10,7 @@ module SemVerComponents
10
10
  # * *git_url* (String): The git URL
11
11
  # * *commit_sha* (String): The commit sha
12
12
  def commit_url(git_url, commit_sha)
13
- "#{git_url}/commits/#{commit_sha}"
13
+ "#{public_url(git_url)}/commits/#{commit_sha}"
14
14
  end
15
15
 
16
16
  # Get the URL to compare 2 tags
@@ -20,7 +20,26 @@ module SemVerComponents
20
20
  # * *tag_1* (String): The first tag
21
21
  # * *tag_2* (String): The second tag
22
22
  def compare_url(git_url, tag_1, tag_2)
23
- "#{git_url}/compare/commits?targetBranch=refs%2Ftags%2F#{tag_2}&sourceBranch=refs%2Ftags%2F#{tag_1}"
23
+ "#{public_url(git_url)}/compare/commits?targetBranch=refs%2Ftags%2F#{tag_2}&sourceBranch=refs%2Ftags%2F#{tag_1}"
24
+ end
25
+
26
+ private
27
+
28
+ # Convert the git remote URL to the public URL
29
+ #
30
+ # Parameters::
31
+ # * *git_url* (String): Git remote URL
32
+ # Result::
33
+ # * String: The corresponding public URL
34
+ def public_url(git_url)
35
+ if git_url =~ /^(.+)\/scm\/([^\/]+)\/(.+)$/
36
+ base_url = $1
37
+ project = $2
38
+ repo = $3
39
+ "#{base_url}/projects/#{project}/repos/#{repo}"
40
+ else
41
+ git_url
42
+ end
24
43
  end
25
44
 
26
45
  end
@@ -80,7 +80,7 @@ module SemVerComponents
80
80
  commits_per_component[component][bump_level] << git_commit
81
81
  end
82
82
  end
83
- puts "# [v#{new_version}](#{@git_hosting.compare_url(git_url, @local_git.git_from, new_version)}) (#{Time.now.utc.strftime('%F %T')})"
83
+ puts "# [v#{new_version}](#{@git_hosting.compare_url(git_url, @local_git.git_from, "v#{new_version}")}) (#{Time.now.utc.strftime('%F %T')})"
84
84
  puts
85
85
  commits_per_component.sort_by { |component, _component_info| component || '' }.each do |(component, component_info)|
86
86
  puts "## #{component.nil? ? 'Global changes' : "Changes for #{component}"}\n" if commits_per_component.size > 1 || !component.nil?
@@ -1,5 +1,5 @@
1
1
  module SemVerComponents
2
2
 
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sem_ver_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan