File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ class Version
4
4
def initialize ( v )
5
5
@raw = v
6
6
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 } ) )
8
8
@date = m [ 'date' ]
9
9
@x = m [ 'x' ] . to_i
10
10
else
@@ -16,6 +16,7 @@ class Version
16
16
def self . load_from_changelog
17
17
changelog = File . expand_path ( '../CHANGELOG.md' , __dir__ )
18
18
version = File . read ( changelog ) . match ( /^## \[ ([^\] ]+)\] / ) { |match | match [ 1 ] }
19
+ version = version . gsub ( '-' , '.' )
19
20
new ( version )
20
21
rescue Errno ::ENOENT
21
22
new ( '' )
@@ -25,7 +26,7 @@ class Version
25
26
if malformed?
26
27
raw
27
28
else
28
- "#{ date } - #{ x } "
29
+ "#{ date } . #{ x } "
29
30
end
30
31
end
31
32
@@ -47,7 +48,7 @@ class Version
47
48
end
48
49
49
50
def today
50
- Time . now . strftime ( '%Y-%m- %d' )
51
+ Time . now . strftime ( '%Y.%m. %d' )
51
52
end
52
53
end
53
54
You can’t perform that action at this time.
0 commit comments