sem_ver_components 0.2.0 → 0.2.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: 3d2992cb6bc3198b8bb2d72c34ebde42daf01a1c7aa3804fba463f65570557dc
|
4
|
+
data.tar.gz: 8fb753b456aaded0b3f8b806605223c5350bf4c1ac89e802bb35718e69aef8c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?
|