apadmi_grout 2.8.0 → 2.9.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: 75c06e02304d0547ca158b319c9c88e895753233fd06da8d864c402ae89946e1
4
- data.tar.gz: 6fda7788c5401a14481f715f4007dec869219438304b0206dfce5eb3735c3e07
3
+ metadata.gz: fa7ac0cd2f88e84cd7dfbde2c5d303d7387e83ba83e0cc8e1d8f503599b61e01
4
+ data.tar.gz: 21e9a197f5e22264462e01394e1c1b87bb289cbc3a7f20a65c7e50b254e1754c
5
5
  SHA512:
6
- metadata.gz: b34320096c5d746f833c48ab31d00933188fdfe86c607a5529f58f03f15b8fb2636ba752b8d5a2743bf4b0d98563c39d21a64b950fb8706b278cc4ddca2500fb
7
- data.tar.gz: 38c1b2705c12d5fb8480270a26022f1266f0bb9b15da84ffde2447ada05e7de497356a46ae759a1fc3a91fefb1aa50524a30bf52094e0da6fec31ebcdc9f763c
6
+ metadata.gz: cf9f60b7ecc1a71bc307147afdd178ac8761a4a4938c6382d51fd449297750a8d7f918a3a7eaa614631be8b989d722bbedbbdbfe89231a1803a2b868b7b3f26c
7
+ data.tar.gz: b68eac0ceac55699401b7679278f6958c0b595c4cab8999281c4bd4f0bcf10bf90dc0af31627ff7455e4dfe5eb9b7f89f21036d8abbcb0e877c058d2ba8402a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Core Changelog
2
2
 
3
+ ## [2.9.0] - 2025-05-28
4
+ * Add git util for getting the last tag of a given pattern which is on an ancestor commit of HEAD
5
+
3
6
  ## [2.8.0] - 2025-05-22
4
7
  * Add ability to disable use of the undocumented JIRA apis
5
8
 
@@ -68,6 +68,29 @@ module Apadmi
68
68
  @@default.commit_hash
69
69
  end
70
70
 
71
+ # Returns the hash of the last git tag which is an ancestor commit of the current HEAD and matches the given pattern
72
+ # @param pattern [String]
73
+ def self.last_ancestor_tag_hash(pattern)
74
+ @@default.last_ancestor_tag_hash(pattern)
75
+ end
76
+
77
+ def last_ancestor_tag_hash(pattern)
78
+ tag_name = last_ancestor_tag(pattern)
79
+ stdout, stderr, status = Open3.capture3("git #{@repo_path_arg} rev-list -n 1 #{tag_name}")
80
+ raise "Failed to find a tag: #{tag_name}: #{stderr}" unless status.success?
81
+
82
+ stdout.strip
83
+ end
84
+
85
+ # Returns the name of the last git tag which is an ancestor commit of the current HEAD and matches the given pattern
86
+ # @param pattern [String]
87
+ def last_ancestor_tag(pattern)
88
+ stdout, stderr, status = Open3.capture3("git #{@repo_path_arg} describe --tags --match '#{pattern}' --abbrev=0")
89
+ raise "Failed to find a tag matching pattern: #{pattern}: #{stderr}" unless status.success?
90
+
91
+ stdout.strip
92
+ end
93
+
71
94
  # Gets the number of commits accessible from HEAD treating the history as a graph.
72
95
  # See more details here: https://git-scm.com/docs/git-rev-list
73
96
  # @return [String] The number of commits
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Apadmi
4
4
  module Grout
5
- VERSION = "2.8.0"
5
+ VERSION = "2.9.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apadmi_grout
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apadmi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-22 00:00:00.000000000 Z
11
+ date: 2025-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday