Class: Packages::Composer::VersionParserService
- Inherits:
-
Object
- Object
- Packages::Composer::VersionParserService
- Defined in:
- app/services/packages/composer/version_parser_service.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(tag_name: nil, branch_name: nil) ⇒ VersionParserService
constructor
A new instance of VersionParserService.
Constructor Details
#initialize(tag_name: nil, branch_name: nil) ⇒ VersionParserService
Returns a new instance of VersionParserService.
6 7 8 9 |
# File 'app/services/packages/composer/version_parser_service.rb', line 6 def initialize(tag_name: nil, branch_name: nil) @tag_name = tag_name @branch_name = branch_name end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/services/packages/composer/version_parser_service.rb', line 11 def execute if @tag_name.present? @tag_name.delete_prefix('v') elsif @branch_name.present? branch_suffix_or_prefix(@branch_name.match(Gitlab::Regex.composer_package_version_regex)) end end |