diff --git a/lib/document.rb b/lib/document.rb index 20c309d..64283a2 100644 --- a/lib/document.rb +++ b/lib/document.rb @@ -101,7 +101,7 @@ def title=(new_title) # Returns an array of the document version identifiers. def versions versions = Dir.glob(directory + 'v*') - versions.reject { |v| !v =~ /^v\d+$/ }.map { |v| File.basename v }.sort + versions.map { |v| File.basename(v) }.grep(/\Av\d+\z/).sort end # Returns true if the document has the specified version.