lib/gap50/samsara/maker.rb in gap50-0.1.0 vs lib/gap50/samsara/maker.rb in gap50-0.1.1
- old
+ new
@@ -1,9 +1,9 @@
module Gap
class Maker
RND = Random.new
- attr_accessor :temp, :sam
+ attr_accessor :temp, :sam, :teardown
def initialize(sam = nil, temp = genname, &block)
@sam = sam
@temp = temp
@@ -28,10 +28,14 @@
def writefile(name, value)
@sam.writefile path(name), value
end
+ def tear
+ self.teardown = true
+ end
+
def copyfile(src, dest)
writefile dest, @sam.readfile(src)
end
def exec(cmd)
@@ -39,10 +43,10 @@
end
def transaction
_create
ret = yield self
- _import_all
+ _import_all unless self.teardown
_cleanup
ret
end
def asBase64
\ No newline at end of file