captive-release 0.4.4 → 0.5.0

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: 53520ddc8d72e4aaba6efd5cf52398ddfb5b621316cd366269a9d3d3c78fa38e
4
- data.tar.gz: ed836c92b2e341a49b57136266a62e8a575ea97440db814f1b387ef9846cdc8d
3
+ metadata.gz: 03403604d3d533136b2f1901345f1a1192d698ec43ac8e54589e966e33d8a328
4
+ data.tar.gz: f822d4f46347d765a3c1beb5415b5e19d223f35f55a94592555d38fe4633ac4c
5
5
  SHA512:
6
- metadata.gz: a3c33fc6776c8dedee9e5686b6a59ff069a40035890097fc6a7c6f8f695dbabb3eaf86a6e4796c82f88c127818a99746019176f52d2dfd0cb14367fb8a27c843
7
- data.tar.gz: 50e1922a0ba1296719bab58e09cc1620b42e905adc75d4bd7653b7b3980b9fc8d71146f558a454d90fac2503c1ed77eb3ca3375beee8269f0ceb5bf21b7590bf
6
+ metadata.gz: c7db3c9d1f2289de5eaf34d7057dd8abdc2e1d39c3d52eedcca661f3f8d494810b36e130320137bb9c58993e33ecef257407ee6cfd8ff5caceb036975c1a4a83
7
+ data.tar.gz: d4f457a4cc32c465ca677def528172deb6d0efb2e48bc95ae5911c9ca742a34c0d1a79abfa2c31551383c04531ec16569745e84e15786e97cd462fe4bb5b48ea
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CaptiveRelease
4
+ # Le lien vers les commits inclus depuis la dernière version taguée. Absent tant que ce
5
+ # tag n'existe pas ou que le remote ne mène pas à GitHub — la release continue sans lui.
6
+ #
7
+ # Cette unité change quand la façon de comparer deux versions change, ReleaseCommand quand
8
+ # le moment où on l'affiche change.
9
+ class ChangesSince
10
+ def self.url(version)
11
+ return nil unless GitCommands.tag?("v#{version}")
12
+
13
+ GithubRepo.from_remote(GitCommands.remote_url).compare_url("v#{version}", GitCommands.current_branch)
14
+ rescue StandardError
15
+ nil
16
+ end
17
+ end
18
+ end
@@ -10,6 +10,8 @@ module CaptiveRelease
10
10
 
11
11
  def self.remote_url = Shell.capture("git remote get-url origin 2>/dev/null")
12
12
 
13
+ def self.tag?(nom) = !Shell.capture("git tag -l #{nom} 2>/dev/null").empty?
14
+
13
15
  def self.current_branch
14
16
  branche = Shell.capture("git rev-parse --abbrev-ref HEAD 2>/dev/null")
15
17
  branche.empty? ? "main" : branche
@@ -25,5 +25,7 @@ module CaptiveRelease
25
25
  def path(suite) = "repos/#{owner}/#{repo}/#{suite}"
26
26
 
27
27
  def actions_url = "https://github.com/#{owner}/#{repo}/actions"
28
+
29
+ def compare_url(from, to) = "https://github.com/#{owner}/#{repo}/compare/#{from}...#{to}"
28
30
  end
29
31
  end
@@ -17,6 +17,7 @@ module CaptiveRelease
17
17
  courante = @config.current_version
18
18
  @terminal.say "\n#{@terminal.bold("captive-release")}\n"
19
19
  @terminal.say "Current version: #{@terminal.bold(courante)}\n"
20
+ afficher_changements(courante)
20
21
 
21
22
  prochaine = VersionChoice.new(terminal: @terminal).call(courante, bump_arg)
22
23
  confirmer!(prochaine) if confirmation
@@ -29,6 +30,13 @@ module CaptiveRelease
29
30
 
30
31
  private
31
32
 
33
+ def afficher_changements(courante)
34
+ lien = ChangesSince.url(courante)
35
+ return unless lien
36
+
37
+ @terminal.say "Changement : #{@terminal.link(lien)}\n"
38
+ end
39
+
32
40
  def confirmer!(version)
33
41
  @terminal.say "\nNew version: #{@terminal.bold(version)}"
34
42
  reponse = @terminal.ask("Confirm? [Y/n] ").downcase
@@ -28,6 +28,9 @@ module CaptiveRelease
28
28
  # finissaient par ne plus être les mêmes.
29
29
  def done(etape) = say(" #{ok("✅")} #{etape}")
30
30
 
31
+ # OSC 8 : le terminal affiche `texte` mais ouvre `url` au clic, sans exposer l'URL brute.
32
+ def link(url, texte = url) = "\e]8;;#{url}\e\\#{texte}\e]8;;\e\\"
33
+
31
34
  def bold(str) = "\e[1m#{str}\e[0m"
32
35
  def dim(str) = "\e[2m#{str}\e[0m"
33
36
  def ok(str) = "\e[32m#{str}\e[0m"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CaptiveRelease
4
- VERSION = "0.4.4"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -32,6 +32,7 @@ require_relative "captive_release/build_command"
32
32
  require_relative "captive_release/menu"
33
33
  require_relative "captive_release/version_choice"
34
34
  require_relative "captive_release/git_release"
35
+ require_relative "captive_release/changes_since"
35
36
  require_relative "captive_release/release_publication"
36
37
  require_relative "captive_release/version_files_writing"
37
38
  require_relative "captive_release/release_preconditions"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captive-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Captive Studio
@@ -24,6 +24,7 @@ files:
24
24
  - lib/captive_release/build_config.rb
25
25
  - lib/captive_release/build_config_prompt.rb
26
26
  - lib/captive_release/build_dispatch_run.rb
27
+ - lib/captive_release/changes_since.rb
27
28
  - lib/captive_release/cli.rb
28
29
  - lib/captive_release/config.rb
29
30
  - lib/captive_release/config_file.rb