Module: Gluttonberg::Library::Storage::Filesystem::ClassMethods

Defined in:
lib/gluttonberg/library/storage/filesystem.rb

Instance Method Summary collapse

Instance Method Details

#storage_setupObject

It run when the engine is loaded. It makes sure that all the required directories for storing assets are in the public dir, creating them if they are missing. It also stores the various paths so they can be retreived using the assets_dir method.



11
12
13
14
# File 'lib/gluttonberg/library/storage/filesystem.rb', line 11

def storage_setup
  Library.set_asset_root(File.join(Rails.root, "public/user_assets"), File.join(Rails.root, "public/user_assets"), File.join(Rails.root, "public/test_assets"))
  FileUtils.mkdir(Library.root) unless File.exists?(Library.root) || File.symlink?(Library.root)
end