Sha256: 8a898c0f940d3d7a24c60ac3416de55b8a1bfaeec62414749dc14dae7ae717e7
Contents?: true
Size: 1.31 KB
Versions: 37
Compression:
Stored size: 1.31 KB
Contents
# -*- encoding : utf-8 -*- class Card; module Set; class Abstract; module Attachment; module Paths; extend Card::Set # ~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/carrierwave/set/abstract/attachment/paths.rb ~~ 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[:anyone].id end def file_id id? ? id : upload_cache_card.id end # ~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/carrierwave/set/abstract/attachment/paths.rb ~~ end;end;end;end;end;
Version data entries
37 entries across 37 versions & 1 rubygems