Class: Git::TagDeleteResult
- Inherits:
-
Data
- Object
- Data
- Git::TagDeleteResult
- Defined in:
- lib/git/tag_delete_result.rb
Overview
Represents the result of a tag delete operation
This is an immutable data object returned by Commands::Tag::Delete#call. It contains information about which tags were successfully deleted and which failed to be deleted, along with the reason for each failure.
Git's git tag -d command uses "best effort" semantics - it deletes as many
tags as possible and reports errors for those that couldn't be deleted. This
result object reflects that behavior, allowing callers to inspect both
successes and failures.
Instance Attribute Summary collapse
-
#deleted ⇒ Array<Git::TagInfo>
readonly
Tags that were successfully deleted.
-
#not_deleted ⇒ Array<Git::TagDeleteFailure>
readonly
Tags that could not be deleted, with the reason for each failure.
Instance Method Summary collapse
-
#success? ⇒ Boolean
Returns true if all requested tags were successfully deleted.
Instance Attribute Details
#deleted ⇒ Array<Git::TagInfo> (readonly)
Tags that were successfully deleted
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/git/tag_delete_result.rb', line 49 TagDeleteResult = Data.define(:deleted, :not_deleted) do # Returns true if all requested tags were successfully deleted # # @example Check if the delete operation succeeded # result = tag_delete.call('v1.0.0') # if result.success? # puts "All tags deleted successfully" # else # puts "Some tags could not be deleted:" # result.not_deleted.each { |f| puts " #{f.name}: #{f.error_message}" } # end # # @return [Boolean] true if no tags failed to delete, false otherwise def success? not_deleted.empty? end end |
#not_deleted ⇒ Array<Git::TagDeleteFailure> (readonly)
Tags that could not be deleted, with the reason for each failure
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/git/tag_delete_result.rb', line 49 TagDeleteResult = Data.define(:deleted, :not_deleted) do # Returns true if all requested tags were successfully deleted # # @example Check if the delete operation succeeded # result = tag_delete.call('v1.0.0') # if result.success? # puts "All tags deleted successfully" # else # puts "Some tags could not be deleted:" # result.not_deleted.each { |f| puts " #{f.name}: #{f.error_message}" } # end # # @return [Boolean] true if no tags failed to delete, false otherwise def success? not_deleted.empty? end end |
Instance Method Details
#success? ⇒ Boolean
Returns true if all requested tags were successfully deleted
62 63 64 |
# File 'lib/git/tag_delete_result.rb', line 62 def success? not_deleted.empty? end |