require "baked_file_system"
class FileStorage
extend BakedFileSystem
bake_folder "../public"
end
path = "../public/index.html"
begin
file = FileStorage.get path
p "content = #{file.gets_to_end}"
rescue BakedFileSystem::NoSuchFileError
puts "File #{path} is missing"
end
require "baked_file_system"
class FileStorage
extend BakedFileSystem
bake_folder "../public"
end
path = "/index.html"
begin
file = FileStorage.get path
p "content = #{file.gets_to_end}"
rescue BakedFileSystem::NoSuchFileError
puts "File #{path} is missing"
end
Basically, the path inside the archive is the path “beyond” (i.e. not including) the orginal folder on which the archiving operation is performed.
In other words, the name of the original folder which has been archived does not act as a “root” inside the archive.