Sha256: 43b0a4a06259c822708628710aebe2f83075ed549ea57edfbe4c75c7b72d0122
Contents?: true
Size: 941 Bytes
Versions: 4
Compression:
Stored size: 941 Bytes
Contents
MOD_FILE_DIR = "file".freeze def store_dir will_become_coded? ? coded_dir(@new_mod) : upload_dir end def retrieve_dir coded? ? coded_dir : upload_dir end # place for files of regular file cards def upload_dir id ? "#{files_base_dir}/#{id}" : tmp_upload_dir end # place for files of mod file cards def coded_dir new_mod=nil dir = File.join mod_dir(new_mod), MOD_FILE_DIR, codename FileUtils.mkdir_p dir dir end def mod_dir new_mod=nil find_mod = new_mod || mod Card::Mod::Loader.mod_dirs.path(find_mod) || raise(Error, "can't find mod \"#{find_mod}\"") end def files_base_dir bucket ? bucket_config[:subdirectory] : Card.paths["files"].existent.first end # used in the indentifier def file_dir if coded? ":#{codename}" elsif cloud? "(#{bucket})/#{file_id}" else "~#{file_id}" end end def public? who_can(:read).include? Card::AnyoneID end def file_id id? ? id : upload_cache_card.id end
Version data entries
4 entries across 4 versions & 1 rubygems