Class: Fastlane::Helper::GitBuildTag
- Inherits:
-
Object
- Object
- Fastlane::Helper::GitBuildTag
- Defined in:
- lib/fastlane/plugin/git_build_versioning/helper/git_build_versioning_helper.rb
Instance Method Summary collapse
- #build_number ⇒ Object
- #hash ⇒ Object
-
#initialize(str, tag_prefix) ⇒ GitBuildTag
constructor
A new instance of GitBuildTag.
- #is_build_number? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(str, tag_prefix) ⇒ GitBuildTag
Returns a new instance of GitBuildTag.
13 14 15 16 17 |
# File 'lib/fastlane/plugin/git_build_versioning/helper/git_build_versioning_helper.rb', line 13 def initialize(str, tag_prefix) # Instance variables @tag_prefix = tag_prefix @str = str end |
Instance Method Details
#build_number ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/fastlane/plugin/git_build_versioning/helper/git_build_versioning_helper.rb', line 23 def build_number full_name = @str.split('refs/tags/').last m = full_name.match(/^#{@tag_prefix}(\d+)$/) if m && m[1] number_or_nil(m[1]) end end |
#hash ⇒ Object
19 20 21 |
# File 'lib/fastlane/plugin/git_build_versioning/helper/git_build_versioning_helper.rb', line 19 def hash (@str.split('refs/tags/').first || '').strip end |
#is_build_number? ⇒ Boolean
31 32 33 |
# File 'lib/fastlane/plugin/git_build_versioning/helper/git_build_versioning_helper.rb', line 31 def is_build_number? build_number != nil end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/fastlane/plugin/git_build_versioning/helper/git_build_versioning_helper.rb', line 35 def to_s "GitBuildTag<#{self.hash}, #{self.build_number}>" end |