diff options
Diffstat (limited to 'lib/byteback/restore_file.rb')
-rw-r--r-- | lib/byteback/restore_file.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/byteback/restore_file.rb b/lib/byteback/restore_file.rb index 5811b0f..daceb83 100644 --- a/lib/byteback/restore_file.rb +++ b/lib/byteback/restore_file.rb @@ -45,10 +45,13 @@ module Byteback # @snapshot = full_path.sub(%r(^#{Regexp.escape @byteback_root}),'').split("/")[1] - if @snapshot == "current" - @snapshot_time = @now - else + # + # If we can parse the time, use it, otherwise assume "now". + # + begin @snapshot_time = Time.parse(@snapshot) + rescue ArgumentError + @snapshot_time = @now end # |