Skip to content

Commit ab2e772

Browse files
authored
Merge pull request #57 from OpenVoxProject/change_tag_format
Change version format to use periods
2 parents 5a58275 + 0495656 commit ab2e772

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tasks/vox.rake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Version
44
def initialize(v)
55
@raw = v
66

7-
if (m = v.match(%r{\A(?<date>\d{4}-\d{2}-\d{2})-(?<x>\d+)\z}))
7+
if (m = v.match(%r{\A(?<date>\d{4}[-|\.]\d{2}[-|\.]\d{2})[-|\.](?<x>\d+)\z}))
88
@date = m['date']
99
@x = m['x'].to_i
1010
else
@@ -16,6 +16,7 @@ class Version
1616
def self.load_from_changelog
1717
changelog = File.expand_path('../CHANGELOG.md', __dir__)
1818
version = File.read(changelog).match(/^## \[([^\]]+)\]/) { |match| match[1] }
19+
version = version.gsub('-', '.')
1920
new(version)
2021
rescue Errno::ENOENT
2122
new('')
@@ -25,7 +26,7 @@ class Version
2526
if malformed?
2627
raw
2728
else
28-
"#{date}-#{x}"
29+
"#{date}.#{x}"
2930
end
3031
end
3132

@@ -47,7 +48,7 @@ class Version
4748
end
4849

4950
def today
50-
Time.now.strftime('%Y-%m-%d')
51+
Time.now.strftime('%Y.%m.%d')
5152
end
5253
end
5354

0 commit comments

Comments
 (0)