diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2008-09-21 00:41:12 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2008-09-21 00:41:12 +0200 |
commit | a5b348806458057f2e76f648e9a2d339c5a27614 (patch) | |
tree | e575a9ae6884d806da89ebffd71ffb5cf7ed3025 | |
parent | 8d669d2263bdcfb870a0f734de9fe7c76e2ec266 (diff) | |
download | trivium-a5b348806458057f2e76f648e9a2d339c5a27614.tar.gz trivium-a5b348806458057f2e76f648e9a2d339c5a27614.tar.xz trivium-a5b348806458057f2e76f648e9a2d339c5a27614.zip |
More strict entry parsing
-rw-r--r-- | trivium.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trivium.rb b/trivium.rb index 23d76a8..5a6462d 100644 --- a/trivium.rb +++ b/trivium.rb @@ -18,7 +18,7 @@ end def parse(f) head, body = File.read(f).split("\n\n", 2) rescue (return nil) entry = {:body => body, :id => File.basename(f, ".entry"), :file => f} - head.scan(/(\w+):\s*(.*)/) { entry[$1.downcase.to_sym] = $2 } + head.scan(/(\w+): *(.*)/) { entry[$1.downcase.to_sym] = $2 } entry[:date] = Time.parse(entry[:date]) if entry[:date] entry[:title] = entry[:date].strftime("%d%b%Y").downcase if entry[:date] entry |