aboutsummaryrefslogtreecommitdiff
path: root/tapelibrary.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tapelibrary.rb')
-rw-r--r--tapelibrary.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/tapelibrary.rb b/tapelibrary.rb
index daf0e2e..ee57dbc 100644
--- a/tapelibrary.rb
+++ b/tapelibrary.rb
@@ -35,8 +35,8 @@ class RobotBuilder
@name = name
@libraries = Hash.new
end
- def uselibrary name, library
- @libraries[name] = library
+ def uselibrary library
+ @libraries[library.name] = library
end
def build
Robot.new @name, @libraries
@@ -46,3 +46,21 @@ end
def robot name, &block
Docile.dsl_eval(RobotBuilder.new(name), &block).build
end
+
+Backup = Struct.new(:name, :robot, :backups)
+
+class BackupBuilder
+ def initialize name, robot
+ @name = name
+ @robot = robot
+ end
+ def backup bkp = {}
+ bkp.each do |dir, lib|
+ puts "Backup #{@name}: Backing up #{dir} to library #{lib} on robot #{@robot.name}"
+ end
+ end
+end
+
+def backups name, robot, &block
+ Docile.dsl_eval(BackupBuilder.new(name, robot), &block)
+end