summaryrefslogtreecommitdiff
path: root/lib/byteback
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 10:00:40 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2015-12-02 10:00:40 +0000
commit95c2d95f42385aabdb961593dd9e6d1d5d494457 (patch)
tree1adbe163e27ee3dd0d281f01bbe10ef1af04ca70 /lib/byteback
parentb186a1b6ff0ac7a9558eb3618f2c42a69599c145 (diff)
Changed the word "revision" to "snapshot" everywhere
This is for consistency and understanding. We use btrfs snapshots, so this makes sense. To me at least.
Diffstat (limited to 'lib/byteback')
-rw-r--r--lib/byteback/restore.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/byteback/restore.rb b/lib/byteback/restore.rb
index e2df3fe..82fab82 100644
--- a/lib/byteback/restore.rb
+++ b/lib/byteback/restore.rb
@@ -5,9 +5,9 @@ module Byteback
class Restore
- def self.find(byteback_root, revision, paths)
+ def self.find(byteback_root, snapshot, paths)
x = Byteback::Restore.new(byteback_root)
- x.revision = revision
+ x.snapshot = snapshot
x.find(paths)
return x
end
@@ -39,15 +39,15 @@ module Byteback
#
@byteback_root = File.expand_path(byteback_root)
@now = Time.now
- @revision = "*"
+ @snapshot = "*"
@results = []
end
- def revision=(r)
+ def snapshot=(r)
if r =~ /^[a-z0-9:\+\*\-]+$/i
- @revision = r
+ @snapshot = r
else
- puts "*** Warning: Bad revision #{r.inspect}"
+ puts "*** Warning: Bad snapshot #{r.inspect}"
end
end
@@ -64,7 +64,7 @@ module Byteback
seen = []
@results = paths.collect do |path|
- Dir.glob(File.expand_path(File.join(@byteback_root, @revision, path))).collect do |f|
+ Dir.glob(File.expand_path(File.join(@byteback_root, @snapshot, path))).collect do |f|
restore_file = Byteback::RestoreFile.new(f, @byteback_root, @now)
end
end.flatten.sort{|a,b| [a.path, a.snapshot_time] <=> [b.path, b.snapshot_time]}