lib/system_file.rb in machinery-tool-1.9.1 vs lib/system_file.rb in machinery-tool-1.10.0
- old
+ new
@@ -38,7 +38,32 @@
true
else
false
end
end
+
+ def on_disk?
+ assert_scope
+
+ scope.extracted && file? && !deleted?
+ end
+
+ def binary?
+ assert_scope
+ scope.binary?(self)
+ end
+
+ def content
+ assert_scope
+ scope.file_content(self)
+ end
+
+ private
+
+ def assert_scope
+ return if scope
+
+ raise Machinery::Errors::MachineryError,
+ "File store related method unavailable, the SystemFile does not have a Scope associated."
+ end
end
end