Breathing room

上级 1e05e628
......@@ -8,6 +8,7 @@ def initialize(root)
@root = root
end
def upload(key, data)
File.open(make_path_for(key), "wb") do |file|
while chunk = data.read(65536)
......@@ -45,6 +46,7 @@ def checksum(key)
Digest::MD5.file(path_for(key)).hexdigest
end
private
def path_for(key)
File.join root, folder_for(key), key
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册