lib/appversion/git.rb in overview-0.0.2.1.40 vs lib/appversion/git.rb in overview-0.0.2.43
- old
+ new
@@ -19,12 +19,12 @@
CI.branch || `git rev-parse --abbrev-ref HEAD`.strip
end
def self.tag
(`git describe --tags --match 'v*' --abbrev=0 2>/dev/null` || 'HEAD').strip
end
- def self.clean_tag
- tag.strip.sub('v','').split('.').select { |e| e.is_number?}.join('.')
+ def self.clean_tag(tag=self.tag)
+ tag.strip.sub('v','').split(/[\.,-]/).select { |e| e.is_number?}.first(3).join('.')
end
def self.commit_count
`git rev-list --count HEAD`
end
def self.commit_count_since_tag(tag)
@@ -37,6 +37,5 @@
def clean_tag
tag.strip.sub('v','').split('.').select { |e| e.is_number?}.join('.')
end
end
-#puts Overview::Git.clean_tag
\ No newline at end of file