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
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
5253end
5354
You can’t perform that action at this time.
0 commit comments